1 https://bugzilla.redhat.com/show_bug.cgi?id=610986
2 http://sourceware.org/ml/gdb-cvs/2010-08/msg00112.html
4 ### src/gdb/ChangeLog 2010/08/18 22:57:45 1.12097
5 ### src/gdb/ChangeLog 2010/08/19 07:34:26 1.12098
7 +2010-08-19 Jan Kratochvil <jan.kratochvil@redhat.com>
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.
13 2010-08-18 Tom Tromey <tromey@redhat.com>
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,
21 struct frame_info *fi;
22 - struct frame_info *old_fi = NULL;
23 + struct frame_id old_id = null_frame_id;
25 struct cleanup *old_chain;
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));
37 var->root->rootvar = var;
39 /* Reset the selected frame */
41 - select_frame (old_fi);
42 + if (frame_id_p (old_id))
43 + select_frame (frame_find_by_id (old_id));
46 /* If the variable object name is null, that means this
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
55 ### src/gdb/ChangeLog 2010/09/03 01:29:09 1.12149
56 ### src/gdb/ChangeLog 2010/09/03 15:41:59 1.12150
58 +2010-09-03 Jan Kratochvil <jan.kratochvil@redhat.com>
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
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.
83 [ cli/cli-logging.c removed. ]
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");
90 ui_out_redirect (uiout, fp);
91 - TRY_CATCH (ex, RETURN_MASK_ERROR)
92 + TRY_CATCH (ex, RETURN_MASK_ALL)
94 print_command_lines (uiout, tp->commands->commands, 2);
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
100 #include "gdb_string.h"
101 #include "gdb_assert.h"
104 typedef struct cli_ui_out_data cli_out_data;
106 @@ -224,11 +225,13 @@
109 cli_out_data *data = ui_out_data (uiout);
110 + struct ui_file *stream;
112 if (data->suppress_output)
115 - vfprintf_filtered (data->stream, format, args);
116 + stream = VEC_last (ui_filep, data->streams);
117 + vfprintf_filtered (stream, format, args);
119 if (align != ui_noalign)
121 @@ -238,20 +241,26 @@
122 cli_spaces (struct ui_out *uiout, int numspaces)
124 cli_out_data *data = ui_out_data (uiout);
125 + struct ui_file *stream;
127 if (data->suppress_output)
129 - print_spaces_filtered (numspaces, data->stream);
131 + stream = VEC_last (ui_filep, data->streams);
132 + print_spaces_filtered (numspaces, stream);
136 cli_text (struct ui_out *uiout, const char *string)
138 cli_out_data *data = ui_out_data (uiout);
139 + struct ui_file *stream;
141 if (data->suppress_output)
143 - fputs_filtered (string, data->stream);
145 + stream = VEC_last (ui_filep, data->streams);
146 + fputs_filtered (string, stream);
149 static void ATTRIBUTE_PRINTF (3, 0)
152 if (data->suppress_output)
155 if (ui_out_get_verblvl (uiout) >= verbosity)
156 - vfprintf_unfiltered (data->stream, format, args);
158 + struct ui_file *stream = VEC_last (ui_filep, data->streams);
160 + vfprintf_unfiltered (stream, format, args);
165 @@ -280,25 +294,24 @@
166 cli_flush (struct ui_out *uiout)
168 cli_out_data *data = ui_out_data (uiout);
169 + struct ui_file *stream = VEC_last (ui_filep, data->streams);
171 - gdb_flush (data->stream);
172 + gdb_flush (stream);
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. */
180 cli_redirect (struct ui_out *uiout, struct ui_file *outstream)
182 cli_out_data *data = ui_out_data (uiout);
184 if (outstream != NULL)
186 - data->original_stream = data->stream;
187 - data->stream = outstream;
189 - else if (data->original_stream != NULL)
191 - data->stream = data->original_stream;
192 - data->original_stream = NULL;
194 + VEC_safe_push (ui_filep, data->streams, outstream);
196 + VEC_pop (ui_filep, data->streams);
200 @@ -315,10 +328,11 @@
201 const char *format,...)
203 cli_out_data *data = ui_out_data (uiout);
204 + struct ui_file *stream = VEC_last (ui_filep, data->streams);
207 va_start (args, format);
208 - vfprintf_filtered (data->stream, format, args);
209 + vfprintf_filtered (stream, format, args);
214 field_separator (void)
216 cli_out_data *data = ui_out_data (uiout);
217 + struct ui_file *stream = VEC_last (ui_filep, data->streams);
219 - fputc_filtered (' ', data->stream);
220 + fputc_filtered (' ', stream);
223 /* This is the CLI ui-out implementation functions vector */
226 cli_out_data_ctor (cli_out_data *self, struct ui_file *stream)
228 - self->stream = stream;
229 - self->original_stream = NULL;
230 + gdb_assert (stream != NULL);
232 + self->streams = NULL;
233 + VEC_safe_push (ui_filep, self->streams, stream);
235 self->suppress_output = 0;
239 cli_out_set_stream (struct ui_out *uiout, struct ui_file *stream)
241 cli_out_data *data = ui_out_data (uiout);
242 - struct ui_file *old = data->stream;
243 + struct ui_file *old;
245 + old = VEC_pop (ui_filep, data->streams);
246 + VEC_quick_push (ui_filep, data->streams, stream);
248 - data->stream = stream;
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
259 +/* Used for cli_ui_out_data->streams. */
261 +typedef struct ui_file *ui_filep;
262 +DEF_VEC_P (ui_filep);
264 /* These are exported so that they can be extended by other `ui_out'
265 implementations, like TUI's. */
267 struct cli_ui_out_data
269 - struct ui_file *stream;
270 - struct ui_file *original_stream;
271 + VEC (ui_filep) *streams;
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);
281 + ui_out_redirect (uiout, string_file);
282 TRY_CATCH (except, RETURN_MASK_ALL)
284 - ui_out_redirect (uiout, string_file);
285 print_command_lines (uiout, breakpoint_commands (bp), 0);
286 - ui_out_redirect (uiout, NULL);
288 + ui_out_redirect (uiout, NULL);
289 cmdstr = ui_file_xstrdup (string_file, &length);
290 GDB_PY_HANDLE_EXCEPTION (except);
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
295 +2010-09-03 Jan Kratochvil <jan.kratochvil@redhat.com>
297 + * gdb.base/ui-redirect.exp: New file.
299 2010-09-02 Jan Kratochvil <jan.kratochvil@redhat.com>
300 Joel Brobecker <brobecker@adacore.com>
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
305 +# Copyright (C) 2010 Free Software Foundation, Inc.
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.
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.
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/>.
320 +if { [prepare_for_testing ui-redirect.exp ui-redirect start.c] } {
327 +gdb_test_multiple $test $test {
328 + -re "End with a line saying just \"end\"\\.\r\n>$" {
334 +gdb_test_multiple $test $test {
339 +gdb_test_no_output "end"
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:.*"
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
354 ### src/gdb/ChangeLog 2010/09/10 16:17:11 1.12170
355 ### src/gdb/ChangeLog 2010/09/11 16:00:20 1.12171
357 +2010-09-11 Jan Kratochvil <jan.kratochvil@redhat.com>
358 + Paul Bolle <pebolle@tiscali.nl>
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
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):
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
379 +2010-09-11 Jan Kratochvil <jan.kratochvil@redhat.com>
381 + * gdb.python/python.exp (set height 0, collect help from uiout)
382 + (verify help to uiout): New tests.
385 [ gdb_stdtargerr handling dropped. ]
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
391 extern struct cleanup *make_cleanup_ui_file_delete (struct ui_file *);
394 +extern struct cleanup *
395 + make_cleanup_ui_out_redirect_pop (struct ui_out *uiout);
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 @@
404 str_file = mem_fileopen ();
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);
414 + if (ui_out_redirect (uiout, str_file) < 0)
415 + warning (_("Current output protocol does not support redirection"));
417 + make_cleanup_ui_out_redirect_pop (uiout);
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;
425 execute_command (p, from_tty);
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
430 return make_my_cleanup (&cleanup_chain, do_ui_file_delete, arg);
433 +/* Helper function for make_cleanup_ui_out_redirect_pop. */
436 +do_ui_out_redirect_pop (void *arg)
438 + struct ui_out *uiout = arg;
440 + if (ui_out_redirect (uiout, NULL) < 0)
441 + warning (_("Cannot restore redirection of the current output protocol"));
444 +/* Return a new cleanup that pops the last redirection by ui_out_redirect
445 + with NULL parameter. */
448 +make_cleanup_ui_out_redirect_pop (struct ui_out *uiout)
450 + return make_my_cleanup (&cleanup_chain, do_ui_out_redirect_pop, uiout);
454 do_free_section_addr_info (void *arg)
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\"
461 gdb_test "q" "Quit" "verify pagination afterwards: q"
463 +gdb_test_no_output "set height 0"
465 +gdb_test_no_output "python a = gdb.execute('help', to_string=True)" "collect help from uiout"
467 +gdb_test "python print a" ".*aliases -- Aliases of other commands.*" "verify help to uiout"
471 http://sourceware.org/ml/gdb-cvs/2011-02/msg00063.html
473 ### src/gdb/ChangeLog 2011/02/12 13:07:38 1.12557
474 ### src/gdb/ChangeLog 2011/02/13 09:09:33 1.12558
476 +2011-02-13 Jan Kratochvil <jan.kratochvil@redhat.com>
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.
482 2011-02-12 Yao Qi <yao@codesourcery.com>
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;
493 /* Info on best line seen so far, and where it starts, and its file. */
495 @@ -2031,13 +2032,17 @@
498 bv = BLOCKVECTOR (s);
499 + objfile = s->objfile;
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. */
505 - for (; s && BLOCKVECTOR (s) == bv; s = s->next)
506 + ALL_OBJFILE_SYMTABS (objfile, s)
508 + if (BLOCKVECTOR (s) != bv)
511 /* Find the best line in this symtab. */
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
521 - /* Chain of all existing symtabs. */
522 + /* Unordered chain of all existing symtabs of this objfile. */
529 http://sourceware.org/ml/gdb-cvs/2011-02/msg00064.html
531 ### src/gdb/ChangeLog 2011/02/13 09:09:33 1.12558
532 ### src/gdb/ChangeLog 2011/02/13 09:15:50 1.12559
534 2011-02-13 Jan Kratochvil <jan.kratochvil@redhat.com>
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.
541 +2011-02-13 Jan Kratochvil <jan.kratochvil@redhat.com>
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
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.
563 c_type_print_args (struct type *type, struct ui_file *stream,
566 for (i = 0; i < TYPE_NFIELDS (type); i++)
568 + struct type *param_type;
570 if (TYPE_FIELD_ARTIFICIAL (type, i) && !show_artificial)
573 @@ -398,10 +403,24 @@ c_type_print_args (struct type *type, st
577 + param_type = TYPE_FIELD_TYPE (type, i);
579 + if (language == language_cplus && !show_artificial)
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.
585 + And the const/volatile qualifiers are not present in the mangled
586 + names as produced by GCC. */
588 + param_type = make_cv_type (0, 0, param_type, NULL);
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);
595 - c_print_type (TYPE_FIELD_TYPE (type, i), "", stream, -1, 0);
596 + c_print_type (param_type, "", stream, -1, 0);
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
603 +2011-02-13 Jan Kratochvil <jan.kratochvil@redhat.com>
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.
609 2011-02-08 Ulrich Weigand <uweigand@de.ibm.com>
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
615 +/* This test case is part of GDB, the GNU debugger.
617 + Copyright 2011 Free Software Foundation, Inc.
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.
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.
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/>. */
635 + static void func(const int aa) {}
641 + myclass::func (42);
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
646 +# Copyright 2011 Free Software Foundation, Inc.
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.
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.
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/>.
661 +# This file is part of the gdb testsuite.
663 +if {[skip_cplus_tests]} { continue }
665 +set testfile "overload-const"
666 +if [prepare_for_testing $testfile $testfile $testfile.cc {c++ debug}] {
670 +gdb_test_no_output "set language c++"
672 +if [gdb_breakpoint "myclass::func"] {
673 + pass "setting breakpoint at myclass::func"
678 https://bugzilla.redhat.com/show_bug.cgi?id=678454
679 http://sourceware.org/ml/gdb-cvs/2011-02/msg00133.html
681 ### src/gdb/ChangeLog 2011/02/18 16:43:50 1.12607
682 ### src/gdb/ChangeLog 2011/02/18 19:10:44 1.12608
684 +2011-02-18 Jan Kratochvil <jan.kratochvil@redhat.com>
685 + Tom Tromey <tromey@redhat.com>
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.
691 2011-02-18 Pedro Alves <pedro@codesourcery.com>
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 @@
698 /* Look in the static block. */
699 block = block_static_block (get_selected_block (0));
700 - make_symbol_overload_list_block (name, block);
702 + make_symbol_overload_list_block (name, block);
704 /* Look in the global block. */
705 block = block_global_block (block);
706 - make_symbol_overload_list_block (name, block);
708 + make_symbol_overload_list_block (name, block);
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
717 type1 = check_typedef (value_type (arg1));
720 - if (TYPE_CODE (type1) == TYPE_CODE_STRUCT)
722 - else if (TYPE_CODE (type1) == TYPE_CODE_REF)
723 - type1 = TYPE_TARGET_TYPE (type1);
727 + if (TYPE_CODE (type1) == TYPE_CODE_REF)
728 + type1 = check_typedef (TYPE_TARGET_TYPE (type1));
729 + return TYPE_CODE (type1) == TYPE_CODE_STRUCT;
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
736 +2011-02-18 Jan Kratochvil <jan.kratochvil@redhat.com>
738 + * gdb.cp/typedef-operator.exp: New file.
739 + * gdb.cp/typedef-operator.cc: New file.
741 2011-02-17 Michael Snyder <msnyder@vmware.com>
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
747 +/* This test case is part of GDB, the GNU debugger.
749 + Copyright 2011 Free Software Foundation, Inc.
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.
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.
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/>. */
767 + int operator* () { return 42; }
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
781 +# Copyright 2011 Free Software Foundation, Inc.
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.
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.
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/>.
796 +# This file is part of the gdb testsuite.
798 +if {[skip_cplus_tests]} { continue }
800 +set testfile "typedef-operator"
801 +if [prepare_for_testing $testfile $testfile $testfile.cc {c++ debug}] {
805 +gdb_test_no_output "set language c++"
807 +gdb_test "p *u" {You can't do that without a process to debug.} "test crash"
813 +gdb_test "p *v" " = 42" "test typedef"