]> git.pld-linux.org Git - packages/gdb.git/blob - gdb-upstream.patch
- update some patches from gdb-7.2-51.fc14 (this fixes at least artifical arrays...
[packages/gdb.git] / gdb-upstream.patch
1 https://bugzilla.redhat.com/show_bug.cgi?id=610986
2 http://sourceware.org/ml/gdb-cvs/2010-08/msg00112.html
3
4 ### src/gdb/ChangeLog   2010/08/18 22:57:45     1.12097
5 ### src/gdb/ChangeLog   2010/08/19 07:34:26     1.12098
6 ## -1,3 +1,9 @@
7 +2010-08-19  Jan Kratochvil  <jan.kratochvil@redhat.com>
8 +
9 +       * varobj.c (varobj_create): Replace variable old_fi with old_id,
10 +       initialize it by null_frame_id, wrap its usage by get_frame_id,
11 +       frame_id_p and frame_find_by_id.
12 +
13  2010-08-18  Tom Tromey  <tromey@redhat.com>
14  
15         PR python/11900:
16 --- src/gdb/varobj.c    2010/08/06 14:17:56     1.159
17 +++ src/gdb/varobj.c    2010/08/19 07:34:27     1.160
18 @@ -524,7 +524,7 @@ varobj_create (char *objname,
19  {
20    struct varobj *var;
21    struct frame_info *fi;
22 -  struct frame_info *old_fi = NULL;
23 +  struct frame_id old_id = null_frame_id;
24    struct block *block;
25    struct cleanup *old_chain;
26  
27 @@ -611,7 +611,7 @@
28  
29           var->root->frame = get_frame_id (fi);
30           var->root->thread_id = pid_to_thread_id (inferior_ptid);
31 -         old_fi = get_selected_frame (NULL);
32 +         old_id = get_frame_id (get_selected_frame (NULL));
33           select_frame (fi);     
34         }
35  
36 @@ -639,8 +639,8 @@
37        var->root->rootvar = var;
38  
39        /* Reset the selected frame */
40 -      if (old_fi != NULL)
41 -       select_frame (old_fi);
42 +      if (frame_id_p (old_id))
43 +       select_frame (frame_find_by_id (old_id));
44      }
45  
46    /* If the variable object name is null, that means this
47
48
49
50 https://bugzilla.redhat.com/show_bug.cgi?id=627506
51 Re: [patch] Fix nesting of ui_out_redirect
52 http://sourceware.org/ml/gdb-patches/2010-09/msg00122.html
53 http://sourceware.org/ml/gdb-cvs/2010-09/msg00031.html
54
55 ### src/gdb/ChangeLog   2010/09/03 01:29:09     1.12149
56 ### src/gdb/ChangeLog   2010/09/03 15:41:59     1.12150
57 ## -1,3 +1,27 @@
58 +2010-09-03  Jan Kratochvil  <jan.kratochvil@redhat.com>
59 +
60 +       * breakpoint.c (save_breakpoints): Use RETURN_MASK_ALL.
61 +       * cli-out.c: Include vec.h.
62 +       (cli_field_fmt, cli_spaces, cli_text, cli_message, cli_flush): New
63 +       variable stream, initialize it, use it.
64 +       (cli_redirect): New function comment.  Replace the stream and
65 +       original_stream fields by the new streams field.  Remove the
66 +       original_stream != NULL conditional, assert error on NULL instead.
67 +       (out_field_fmt, field_separator): New variable stream, initialize it, use it.
68 +       (cli_out_data_ctor): Assert non-NULL stream.  Replace the stream and
69 +       original_stream fields by the new streams field.
70 +       (cli_out_set_stream): Replace the stream field by the new streams
71 +       field.
72 +       * cli-out.h: Include vec.h.
73 +       (ui_filep): New typedef, call DEF_VEC_P for it.
74 +       (struct cli_ui_out_data): Replace the stream and original_stream
75 +       fields by the new streams field.
76 +       * cli/cli-logging.c (set_logging_redirect): Call ui_out_redirect with
77 +       NULL first.  Extend the comment.
78 +       (handle_redirections): Call ui_out_redirect with output.
79 +       * python/py-breakpoint.c (bppy_get_commands): Move ui_out_redirect
80 +       calls outside of the TRY_CATCH block.
81 +
82
83 [ cli/cli-logging.c removed.  ]
84
85 --- src/gdb/breakpoint.c        2010/08/30 09:49:12     1.511
86 +++ src/gdb/breakpoint.c        2010/09/03 15:42:02     1.512
87 @@ -11487,7 +11487,7 @@
88         fprintf_unfiltered (fp, "  commands\n");
89         
90         ui_out_redirect (uiout, fp);
91 -       TRY_CATCH (ex, RETURN_MASK_ERROR)
92 +       TRY_CATCH (ex, RETURN_MASK_ALL)
93           {
94             print_command_lines (uiout, tp->commands->commands, 2);
95           }
96 --- src/gdb/cli-out.c   2010/05/13 23:53:32     1.30
97 +++ src/gdb/cli-out.c   2010/09/03 15:42:02     1.31
98 @@ -26,6 +26,7 @@
99  #include "cli-out.h"
100  #include "gdb_string.h"
101  #include "gdb_assert.h"
102 +#include "vec.h"
103  
104  typedef struct cli_ui_out_data cli_out_data;
105  
106 @@ -224,11 +225,13 @@
107                va_list args)
108  {
109    cli_out_data *data = ui_out_data (uiout);
110 +  struct ui_file *stream;
111  
112    if (data->suppress_output)
113      return;
114  
115 -  vfprintf_filtered (data->stream, format, args);
116 +  stream = VEC_last (ui_filep, data->streams);
117 +  vfprintf_filtered (stream, format, args);
118  
119    if (align != ui_noalign)
120      field_separator ();
121 @@ -238,20 +241,26 @@
122  cli_spaces (struct ui_out *uiout, int numspaces)
123  {
124    cli_out_data *data = ui_out_data (uiout);
125 +  struct ui_file *stream;
126  
127    if (data->suppress_output)
128      return;
129 -  print_spaces_filtered (numspaces, data->stream);
130 +
131 +  stream = VEC_last (ui_filep, data->streams);
132 +  print_spaces_filtered (numspaces, stream);
133  }
134  
135  static void
136  cli_text (struct ui_out *uiout, const char *string)
137  {
138    cli_out_data *data = ui_out_data (uiout);
139 +  struct ui_file *stream;
140  
141    if (data->suppress_output)
142      return;
143 -  fputs_filtered (string, data->stream);
144 +
145 +  stream = VEC_last (ui_filep, data->streams);
146 +  fputs_filtered (string, stream);
147  }
148  
149  static void ATTRIBUTE_PRINTF (3, 0)
150 @@ -262,8 +271,13 @@
151  
152    if (data->suppress_output)
153      return;
154 +
155    if (ui_out_get_verblvl (uiout) >= verbosity)
156 -    vfprintf_unfiltered (data->stream, format, args);
157 +    {
158 +      struct ui_file *stream = VEC_last (ui_filep, data->streams);
159 +
160 +      vfprintf_unfiltered (stream, format, args);
161 +    }
162  }
163  
164  static void
165 @@ -280,25 +294,24 @@
166  cli_flush (struct ui_out *uiout)
167  {
168    cli_out_data *data = ui_out_data (uiout);
169 +  struct ui_file *stream = VEC_last (ui_filep, data->streams);
170  
171 -  gdb_flush (data->stream);
172 +  gdb_flush (stream);
173  }
174  
175 +/* OUTSTREAM as non-NULL will push OUTSTREAM on the stack of output streams
176 +   and make it therefore active.  OUTSTREAM as NULL will pop the last pushed
177 +   output stream; it is an internal error if it does not exist.  */
178 +
179  static int
180  cli_redirect (struct ui_out *uiout, struct ui_file *outstream)
181  {
182    cli_out_data *data = ui_out_data (uiout);
183  
184    if (outstream != NULL)
185 -    {
186 -      data->original_stream = data->stream;
187 -      data->stream = outstream;
188 -    }
189 -  else if (data->original_stream != NULL)
190 -    {
191 -      data->stream = data->original_stream;
192 -      data->original_stream = NULL;
193 -    }
194 +    VEC_safe_push (ui_filep, data->streams, outstream);
195 +  else
196 +    VEC_pop (ui_filep, data->streams);
197  
198    return 0;
199  }
200 @@ -315,10 +328,11 @@
201                const char *format,...)
202  {
203    cli_out_data *data = ui_out_data (uiout);
204 +  struct ui_file *stream = VEC_last (ui_filep, data->streams);
205    va_list args;
206  
207    va_start (args, format);
208 -  vfprintf_filtered (data->stream, format, args);
209 +  vfprintf_filtered (stream, format, args);
210  
211    va_end (args);
212  }
213 @@ -329,8 +343,9 @@
214  field_separator (void)
215  {
216    cli_out_data *data = ui_out_data (uiout);
217 +  struct ui_file *stream = VEC_last (ui_filep, data->streams);
218  
219 -  fputc_filtered (' ', data->stream);
220 +  fputc_filtered (' ', stream);
221  }
222  
223  /* This is the CLI ui-out implementation functions vector */
224 @@ -364,8 +379,11 @@
225  void
226  cli_out_data_ctor (cli_out_data *self, struct ui_file *stream)
227  {
228 -  self->stream = stream;
229 -  self->original_stream = NULL;
230 +  gdb_assert (stream != NULL);
231 +
232 +  self->streams = NULL;
233 +  VEC_safe_push (ui_filep, self->streams, stream);
234 +
235    self->suppress_output = 0;
236  }
237  
238 @@ -385,8 +403,10 @@
239  cli_out_set_stream (struct ui_out *uiout, struct ui_file *stream)
240  {
241    cli_out_data *data = ui_out_data (uiout);
242 -  struct ui_file *old = data->stream;
243 +  struct ui_file *old;
244 +  
245 +  old = VEC_pop (ui_filep, data->streams);
246 +  VEC_quick_push (ui_filep, data->streams, stream);
247  
248 -  data->stream = stream;
249    return old;
250  }
251 --- src/gdb/cli-out.h   2010/04/18 00:11:55     1.11
252 +++ src/gdb/cli-out.h   2010/09/03 15:42:02     1.12
253 @@ -22,14 +22,19 @@
254  #define CLI_OUT_H
255  
256  #include "ui-out.h"
257 +#include "vec.h"
258 +
259 +/* Used for cli_ui_out_data->streams.  */
260 +
261 +typedef struct ui_file *ui_filep;
262 +DEF_VEC_P (ui_filep);
263  
264  /* These are exported so that they can be extended by other `ui_out'
265     implementations, like TUI's.  */
266  
267  struct cli_ui_out_data
268    {
269 -    struct ui_file *stream;
270 -    struct ui_file *original_stream;
271 +    VEC (ui_filep) *streams;
272      int suppress_output;
273    };
274  
275 --- src/gdb/python/py-breakpoint.c      2010/07/01 10:36:12     1.4
276 +++ src/gdb/python/py-breakpoint.c      2010/09/03 15:42:03     1.5
277 @@ -474,12 +474,12 @@
278    string_file = mem_fileopen ();
279    chain = make_cleanup_ui_file_delete (string_file);
280  
281 +  ui_out_redirect (uiout, string_file);
282    TRY_CATCH (except, RETURN_MASK_ALL)
283      {
284 -      ui_out_redirect (uiout, string_file);
285        print_command_lines (uiout, breakpoint_commands (bp), 0);
286 -      ui_out_redirect (uiout, NULL);
287      }
288 +  ui_out_redirect (uiout, NULL);
289    cmdstr = ui_file_xstrdup (string_file, &length);
290    GDB_PY_HANDLE_EXCEPTION (except);
291  
292 ### src/gdb/testsuite/ChangeLog 2010/09/02 15:19:56     1.2435
293 ### src/gdb/testsuite/ChangeLog 2010/09/03 15:42:04     1.2436
294 ## -1,3 +1,7 @@
295 +2010-09-03  Jan Kratochvil  <jan.kratochvil@redhat.com>
296 +
297 +       * gdb.base/ui-redirect.exp: New file.
298 +
299  2010-09-02  Jan Kratochvil  <jan.kratochvil@redhat.com>
300              Joel Brobecker  <brobecker@adacore.com>
301  
302 --- src/gdb/testsuite/gdb.base/ui-redirect.exp
303 +++ src/gdb/testsuite/gdb.base/ui-redirect.exp  2010-09-11 18:42:40.040910000 +0000
304 @@ -0,0 +1,41 @@
305 +# Copyright (C) 2010 Free Software Foundation, Inc.
306 +
307 +# This program is free software; you can redistribute it and/or modify
308 +# it under the terms of the GNU General Public License as published by
309 +# the Free Software Foundation; either version 3 of the License, or
310 +# (at your option) any later version.
311 +#
312 +# This program is distributed in the hope that it will be useful,
313 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
314 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
315 +# GNU General Public License for more details.
316 +#
317 +# You should have received a copy of the GNU General Public License
318 +# along with this program.  If not, see <http://www.gnu.org/licenses/>.
319 +
320 +if { [prepare_for_testing ui-redirect.exp ui-redirect start.c] } {
321 +    return -1
322 +}
323 +
324 +gdb_breakpoint main
325 +
326 +set test "commands"
327 +gdb_test_multiple $test $test {
328 +    -re "End with a line saying just \"end\"\\.\r\n>$" {
329 +       pass $test
330 +    }
331 +}
332 +
333 +set test "print 1"
334 +gdb_test_multiple $test $test {
335 +    -re "\r\n>$" {
336 +       pass $test
337 +    }
338 +}
339 +gdb_test_no_output "end"
340 +
341 +gdb_test_no_output "set logging file /dev/null"
342 +gdb_test "set logging on" "Copying output to /dev/null\\."
343 +gdb_test "save breakpoints /dev/null" "Saved to file '/dev/null'\\."
344 +gdb_test "set logging off" "Done logging to /dev/null\\."
345 +gdb_test "help" "List of classes of commands:.*"
346
347
348
349 https://bugzilla.redhat.com/show_bug.cgi?id=627506
350 Re: [patch] Fix uiout for execute_command_to_string
351 http://sourceware.org/ml/gdb-patches/2010-09/msg00235.html
352 http://sourceware.org/ml/gdb-cvs/2010-09/msg00080.html
353
354 ### src/gdb/ChangeLog   2010/09/10 16:17:11     1.12170
355 ### src/gdb/ChangeLog   2010/09/11 16:00:20     1.12171
356 ## -1,3 +1,21 @@
357 +2010-09-11  Jan Kratochvil  <jan.kratochvil@redhat.com>
358 +           Paul Bolle  <pebolle@tiscali.nl>
359 +
360 +       Redirect also uiout and stdtarg{,err} in execute_command_to_string.
361 +       * cli-logging.c (struct saved_output_files) <targerr>: New.
362 +       (set_logging_redirect, pop_output_files, handle_redirections):
363 +       Redirect also gdb_stdtargerr.
364 +       * defs.h (struct ui_out, make_cleanup_ui_out_redirect_pop): New
365 +       declarations.
366 +       * event-top.c (gdb_setup_readline, gdb_disable_readline): Redirect
367 +       also gdb_stdtargerr.
368 +       * top.c (execute_command_to_string): Move make_cleanup_ui_file_delete
369 +       to the top.  Redirect also gdb_stdlog, gdb_stdtarg and gdb_stdtargerr.
370 +       Use ui_out_redirect, register make_cleanup_ui_out_redirect_pop.
371 +       * tui/tui-io.c (tui_setup_io): Redirect also gdb_stdtargerr.
372 +       * utils.c (do_ui_out_redirect_pop, make_cleanup_ui_out_redirect_pop):
373 +       New functions.
374 +
375
376 ### src/gdb/testsuite/ChangeLog 2010/09/10 20:29:25     1.2444
377 ### src/gdb/testsuite/ChangeLog 2010/09/11 16:00:26     1.2445
378 ## -1,3 +1,8 @@
379 +2010-09-11  Jan Kratochvil  <jan.kratochvil@redhat.com>
380 +
381 +       * gdb.python/python.exp (set height 0, collect help from uiout)
382 +       (verify help to uiout): New tests.
383 +
384
385 [ gdb_stdtargerr handling dropped.  ]
386
387 --- src/gdb/defs.h      2010/08/31 18:08:43     1.278
388 +++ src/gdb/defs.h      2010/09/11 16:00:25     1.279
389 @@ -337,6 +337,10 @@
390  struct ui_file;
391  extern struct cleanup *make_cleanup_ui_file_delete (struct ui_file *);
392  
393 +struct ui_out;
394 +extern struct cleanup *
395 +  make_cleanup_ui_out_redirect_pop (struct ui_out *uiout);
396 +
397  struct section_addr_info;
398  extern struct cleanup *(make_cleanup_free_section_addr_info 
399                          (struct section_addr_info *));
400 --- src/gdb/top.c       2010/08/07 15:00:37     1.183
401 +++ src/gdb/top.c       2010/09/11 16:00:25     1.184
402 @@ -475,12 +475,23 @@
403  
404    str_file = mem_fileopen ();
405  
406 +  make_cleanup_ui_file_delete (str_file);
407    make_cleanup_restore_ui_file (&gdb_stdout);
408    make_cleanup_restore_ui_file (&gdb_stderr);
409 -  make_cleanup_ui_file_delete (str_file);
410 +  make_cleanup_restore_ui_file (&gdb_stdlog);
411 +  make_cleanup_restore_ui_file (&gdb_stdtarg);
412 +  make_cleanup_restore_ui_file (&gdb_stdtargerr);
413 +
414 +  if (ui_out_redirect (uiout, str_file) < 0)
415 +    warning (_("Current output protocol does not support redirection"));
416 +  else
417 +    make_cleanup_ui_out_redirect_pop (uiout);
418  
419    gdb_stdout = str_file;
420    gdb_stderr = str_file;
421 +  gdb_stdlog = str_file;
422 +  gdb_stdtarg = str_file;
423 +  gdb_stdtargerr = str_file;
424  
425    execute_command (p, from_tty);
426  
427 --- src/gdb/utils.c     2010/08/07 15:00:37     1.239
428 +++ src/gdb/utils.c     2010/09/11 16:00:25     1.240
429 @@ -311,6 +311,26 @@
430    return make_my_cleanup (&cleanup_chain, do_ui_file_delete, arg);
431  }
432  
433 +/* Helper function for make_cleanup_ui_out_redirect_pop.  */
434 +
435 +static void
436 +do_ui_out_redirect_pop (void *arg)
437 +{
438 +  struct ui_out *uiout = arg;
439 +
440 +  if (ui_out_redirect (uiout, NULL) < 0)
441 +    warning (_("Cannot restore redirection of the current output protocol"));
442 +}
443 +
444 +/* Return a new cleanup that pops the last redirection by ui_out_redirect
445 +   with NULL parameter.  */
446 +
447 +struct cleanup *
448 +make_cleanup_ui_out_redirect_pop (struct ui_out *uiout)
449 +{
450 +  return make_my_cleanup (&cleanup_chain, do_ui_out_redirect_pop, uiout);
451 +}
452 +
453  static void
454  do_free_section_addr_info (void *arg)
455  {
456 --- gdb-7.2/gdb/testsuite/gdb.python/python.exp-orig    2010-08-09 21:23:00.000000000 +0200
457 +++ gdb-7.2/gdb/testsuite/gdb.python/python.exp 2010-09-11 20:49:22.000000000 +0200
458 @@ -110,3 +110,9 @@ gdb_test_multiple "python print \"\\n\" 
459      }
460  }
461  gdb_test "q" "Quit" "verify pagination afterwards: q"
462 +
463 +gdb_test_no_output "set height 0"
464 +
465 +gdb_test_no_output "python a = gdb.execute('help', to_string=True)" "collect help from uiout"
466 +
467 +gdb_test "python print a" ".*aliases -- Aliases of other commands.*" "verify help to uiout"
468
469
470
471 http://sourceware.org/ml/gdb-cvs/2011-02/msg00063.html
472
473 ### src/gdb/ChangeLog   2011/02/12 13:07:38     1.12557
474 ### src/gdb/ChangeLog   2011/02/13 09:09:33     1.12558
475 ## -1,3 +1,9 @@
476 +2011-02-13  Jan Kratochvil  <jan.kratochvil@redhat.com>
477 +
478 +       * symtab.c (find_pc_sect_line): New variable objfile, initialize it
479 +       from S.  Iterate S using ALL_OBJFILE_SYMTABS.  Verify BV for each S.
480 +       * symtab.h (struct symtab) <next>: Comment extension.
481 +
482  2011-02-12  Yao Qi  <yao@codesourcery.com>
483  
484         * Makefile.in (CLEANDIRS): Remove duplicated common dir.
485 --- src/gdb/symtab.c    2011/01/11 21:53:24     1.257
486 +++ src/gdb/symtab.c    2011/02/13 09:09:36     1.258
487 @@ -1904,6 +1904,7 @@
488    struct blockvector *bv;
489    struct minimal_symbol *msymbol;
490    struct minimal_symbol *mfunsym;
491 +  struct objfile *objfile;
492  
493    /* Info on best line seen so far, and where it starts, and its file.  */
494  
495 @@ -2031,13 +2032,17 @@
496      }
497  
498    bv = BLOCKVECTOR (s);
499 +  objfile = s->objfile;
500  
501    /* Look at all the symtabs that share this blockvector.
502       They all have the same apriori range, that we found was right;
503       but they have different line tables.  */
504  
505 -  for (; s && BLOCKVECTOR (s) == bv; s = s->next)
506 +  ALL_OBJFILE_SYMTABS (objfile, s)
507      {
508 +      if (BLOCKVECTOR (s) != bv)
509 +       continue;
510 +
511        /* Find the best line in this symtab.  */
512        l = LINETABLE (s);
513        if (!l)
514 --- src/gdb/symtab.h    2011/01/11 21:53:25     1.168
515 +++ src/gdb/symtab.h    2011/02/13 09:09:36     1.169
516 @@ -738,8 +738,7 @@
517  
518  struct symtab
519  {
520 -
521 -  /* Chain of all existing symtabs.  */
522 +  /* Unordered chain of all existing symtabs of this objfile.  */
523  
524    struct symtab *next;
525  
526
527
528
529 http://sourceware.org/ml/gdb-cvs/2011-02/msg00064.html
530
531 ### src/gdb/ChangeLog   2011/02/13 09:09:33     1.12558
532 ### src/gdb/ChangeLog   2011/02/13 09:15:50     1.12559
533 ## -1,5 +1,12 @@
534  2011-02-13  Jan Kratochvil  <jan.kratochvil@redhat.com>
535  
536 +       Fix const/volatile qualifiers of C++ types, PR c++/12328.
537 +       * c-typeprint.c (c_type_print_args): Update the function comment.  New
538 +       variable param_type, initialize it.  Remove const/volatile qualifiers
539 +       for language_cplus and !show_artificial.  Use param_type.
540 +
541 +2011-02-13  Jan Kratochvil  <jan.kratochvil@redhat.com>
542 +
543         * symtab.c (find_pc_sect_line): New variable objfile, initialize it
544         from S.  Iterate S using ALL_OBJFILE_SYMTABS.  Verify BV for each S.
545         * symtab.h (struct symtab) <next>: Comment extension.
546 --- src/gdb/c-typeprint.c       2011/01/07 19:36:15     1.68
547 +++ src/gdb/c-typeprint.c       2011/02/13 09:15:53     1.69
548 @@ -371,9 +371,12 @@ c_type_print_modifier (struct type *type
549  /* Print out the arguments of TYPE, which should have TYPE_CODE_METHOD
550     or TYPE_CODE_FUNC, to STREAM.  Artificial arguments, such as "this"
551     in non-static methods, are displayed if SHOW_ARTIFICIAL is
552 -   non-zero. LANGUAGE is the language in which TYPE was defined.  This is
553 -   a necessary evil since this code is used by the C, C++, and Java
554 -   backends. */
555 +   non-zero.  If SHOW_ARTIFICIAL is zero and LANGUAGE is language_cplus
556 +   the topmost parameter types get removed their possible const and volatile
557 +   qualifiers to match demangled linkage name parameters part of such function
558 +   type.  LANGUAGE is the language in which TYPE was defined.  This is
559 +   a necessary evil since this code is used by the C, C++, and Java backends.
560 +   */
561  
562  void
563  c_type_print_args (struct type *type, struct ui_file *stream,
564 @@ -406,6 +409,8 @@
565  
566    for (i = 0; i < TYPE_NFIELDS (type); i++)
567      {
568 +      struct type *param_type;
569 +
570        if (TYPE_FIELD_ARTIFICIAL (type, i) && !show_artificial)
571         continue;
572  
573 @@ -398,10 +403,24 @@ c_type_print_args (struct type *type, st
574           wrap_here ("    ");
575         }
576  
577 +      param_type = TYPE_FIELD_TYPE (type, i);
578 +
579 +      if (language == language_cplus && !show_artificial)
580 +       {
581 +         /* C++ standard, 13.1 Overloadable declarations, point 3, item:
582 +            - Parameter declarations that differ only in the presence or
583 +              absence of const and/or volatile are equivalent.
584 +
585 +            And the const/volatile qualifiers are not present in the mangled
586 +            names as produced by GCC.  */
587 +
588 +         param_type = make_cv_type (0, 0, param_type, NULL);
589 +       }
590 +
591        if (language == language_java)
592 -       java_print_type (TYPE_FIELD_TYPE (type, i), "", stream, -1, 0);
593 +       java_print_type (param_type, "", stream, -1, 0);
594        else
595 -       c_print_type (TYPE_FIELD_TYPE (type, i), "", stream, -1, 0);
596 +       c_print_type (param_type, "", stream, -1, 0);
597        printed_any = 1;
598      }
599  
600 ### src/gdb/testsuite/ChangeLog 2011/02/08 13:30:08     1.2576
601 ### src/gdb/testsuite/ChangeLog 2011/02/13 09:15:53     1.2577
602 ## -1,3 +1,9 @@
603 +2011-02-13  Jan Kratochvil  <jan.kratochvil@redhat.com>
604 +
605 +       Fix const/volatile qualifiers of C++ types, PR c++/12328.
606 +       * gdb.cp/overload-const.exp: New file.
607 +       * gdb.cp/overload-const.cc: New file.
608 +
609  2011-02-08  Ulrich Weigand  <uweigand@de.ibm.com>
610  
611         * gdb.opencl/callfuncs.cl: New file.
612 --- src/gdb/testsuite/gdb.cp/overload-const.cc
613 +++ src/gdb/testsuite/gdb.cp/overload-const.cc  2011-02-13 09:24:14.258748000 +0000
614 @@ -0,0 +1,28 @@
615 +/* This test case is part of GDB, the GNU debugger.
616 +
617 +   Copyright 2011 Free Software Foundation, Inc.
618 +
619 +   This program is free software; you can redistribute it and/or modify
620 +   it under the terms of the GNU General Public License as published by
621 +   the Free Software Foundation; either version 3 of the License, or
622 +   (at your option) any later version.
623 +
624 +   This program is distributed in the hope that it will be useful,
625 +   but WITHOUT ANY WARRANTY; without even the implied warranty of
626 +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
627 +   GNU General Public License for more details.
628 +
629 +   You should have received a copy of the GNU General Public License
630 +   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
631 +
632 +class myclass
633 +{
634 +public:
635 +  static void func(const int aa) {}
636 +};
637 +
638 +int
639 +main ()
640 +{
641 +  myclass::func (42);
642 +}
643 --- src/gdb/testsuite/gdb.cp/overload-const.exp
644 +++ src/gdb/testsuite/gdb.cp/overload-const.exp 2011-02-13 09:24:14.561175000 +0000
645 @@ -0,0 +1,29 @@
646 +# Copyright 2011 Free Software Foundation, Inc.
647 +#
648 +# This program is free software; you can redistribute it and/or modify
649 +# it under the terms of the GNU General Public License as published by
650 +# the Free Software Foundation; either version 3 of the License, or
651 +# (at your option) any later version.
652 +#
653 +# This program is distributed in the hope that it will be useful,
654 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
655 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
656 +# GNU General Public License for more details.
657 +#
658 +# You should have received a copy of the GNU General Public License
659 +# along with this program.  If not, see <http://www.gnu.org/licenses/>.
660 +
661 +# This file is part of the gdb testsuite.
662 +
663 +if {[skip_cplus_tests]} { continue }
664 +
665 +set testfile "overload-const"
666 +if [prepare_for_testing $testfile $testfile $testfile.cc {c++ debug}] {
667 +    return -1
668 +}
669 +
670 +gdb_test_no_output "set language c++"
671 +
672 +if [gdb_breakpoint "myclass::func"] {
673 +    pass "setting breakpoint at myclass::func"
674 +}
675
676
677
678 https://bugzilla.redhat.com/show_bug.cgi?id=678454
679 http://sourceware.org/ml/gdb-cvs/2011-02/msg00133.html
680
681 ### src/gdb/ChangeLog   2011/02/18 16:43:50     1.12607
682 ### src/gdb/ChangeLog   2011/02/18 19:10:44     1.12608
683 ## -1,3 +1,10 @@
684 +2011-02-18  Jan Kratochvil  <jan.kratochvil@redhat.com>
685 +           Tom Tromey  <tromey@redhat.com>
686 +
687 +       * cp-support.c (make_symbol_overload_list_namespace): Do not call
688 +       make_symbol_overload_list_block with NULL BLOCK.
689 +       * valarith.c (unop_user_defined_p): Resolve also TYPE_CODE_TYPEDEF.
690 +
691  2011-02-18  Pedro Alves  <pedro@codesourcery.com>
692  
693         * breakpoint.c (get_number_trailer): No longer accept a NULL PP.
694 --- src/gdb/cp-support.c        2011/01/05 22:22:47     1.47
695 +++ src/gdb/cp-support.c        2011/02/18 19:10:46     1.48
696 @@ -778,11 +778,13 @@
697  
698    /* Look in the static block.  */
699    block = block_static_block (get_selected_block (0));
700 -  make_symbol_overload_list_block (name, block);
701 +  if (block)
702 +    make_symbol_overload_list_block (name, block);
703  
704    /* Look in the global block.  */
705    block = block_global_block (block);
706 -  make_symbol_overload_list_block (name, block);
707 +  if (block)
708 +    make_symbol_overload_list_block (name, block);
709  
710  }
711  
712 --- src/gdb/valarith.c  2011/02/14 11:30:37     1.98
713 +++ src/gdb/valarith.c  2011/02/18 19:10:46     1.99
714 @@ -315,15 +315,9 @@
715    if (op == UNOP_ADDR)
716      return 0;
717    type1 = check_typedef (value_type (arg1));
718 -  for (;;)
719 -    {
720 -      if (TYPE_CODE (type1) == TYPE_CODE_STRUCT)
721 -       return 1;
722 -      else if (TYPE_CODE (type1) == TYPE_CODE_REF)
723 -       type1 = TYPE_TARGET_TYPE (type1);
724 -      else
725 -       return 0;
726 -    }
727 +  if (TYPE_CODE (type1) == TYPE_CODE_REF)
728 +    type1 = check_typedef (TYPE_TARGET_TYPE (type1));
729 +  return TYPE_CODE (type1) == TYPE_CODE_STRUCT;
730  }
731  
732  /* Try to find an operator named OPERATOR which takes NARGS arguments
733 ### src/gdb/testsuite/ChangeLog 2011/02/17 22:08:12     1.2594
734 ### src/gdb/testsuite/ChangeLog 2011/02/18 19:10:46     1.2595
735 ## -1,3 +1,8 @@
736 +2011-02-18  Jan Kratochvil  <jan.kratochvil@redhat.com>
737 +
738 +       * gdb.cp/typedef-operator.exp: New file.
739 +       * gdb.cp/typedef-operator.cc: New file.
740 +
741  2011-02-17  Michael Snyder  <msnyder@vmware.com>
742  
743         * gdb.threads/thread-find.exp: Fix regular expressions.
744 --- src/gdb/testsuite/gdb.cp/typedef-operator.cc
745 +++ src/gdb/testsuite/gdb.cp/typedef-operator.cc        2011-02-21 17:18:30.419734000 +0000
746 @@ -0,0 +1,31 @@
747 +/* This test case is part of GDB, the GNU debugger.
748 +
749 +   Copyright 2011 Free Software Foundation, Inc.
750 +
751 +   This program is free software; you can redistribute it and/or modify
752 +   it under the terms of the GNU General Public License as published by
753 +   the Free Software Foundation; either version 3 of the License, or
754 +   (at your option) any later version.
755 +
756 +   This program is distributed in the hope that it will be useful,
757 +   but WITHOUT ANY WARRANTY; without even the implied warranty of
758 +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
759 +   GNU General Public License for more details.
760 +
761 +   You should have received a copy of the GNU General Public License
762 +   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
763 +
764 +class C
765 +{
766 +public:
767 +  int operator* () { return 42; }
768 +};
769 +typedef C D;
770 +
771 +D u;
772 +D &v = u;
773 +
774 +int main ()
775 +{
776 +  return *v;
777 +}
778 --- src/gdb/testsuite/gdb.cp/typedef-operator.exp
779 +++ src/gdb/testsuite/gdb.cp/typedef-operator.exp       2011-02-21 17:18:30.916753000 +0000
780 @@ -0,0 +1,33 @@
781 +# Copyright 2011 Free Software Foundation, Inc.
782 +#
783 +# This program is free software; you can redistribute it and/or modify
784 +# it under the terms of the GNU General Public License as published by
785 +# the Free Software Foundation; either version 3 of the License, or
786 +# (at your option) any later version.
787 +#
788 +# This program is distributed in the hope that it will be useful,
789 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
790 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
791 +# GNU General Public License for more details.
792 +#
793 +# You should have received a copy of the GNU General Public License
794 +# along with this program.  If not, see <http://www.gnu.org/licenses/>.
795 +
796 +# This file is part of the gdb testsuite.
797 +
798 +if {[skip_cplus_tests]} { continue }
799 +
800 +set testfile "typedef-operator"
801 +if [prepare_for_testing $testfile $testfile $testfile.cc {c++ debug}] {
802 +    return -1
803 +}
804 +
805 +gdb_test_no_output "set language c++"
806 +
807 +gdb_test "p *u" {You can't do that without a process to debug.} "test crash"
808 +
809 +if ![runto_main] {
810 +    return -1
811 +}
812 +
813 +gdb_test "p *v" " = 42" "test typedef"
This page took 1.664366 seconds and 3 git commands to generate.