PR python/11060:
* python/py-type.c (typy_legacy_template_argument): New function,
extracted from typy_template_argument.
(typy_template_argument): Use TYPE_TEMPLATE_ARGUMENT. Return a
value when needed.
gdb/testsuite
PR python/11060:
* gdb.python/py-type.c (Temargs): New template.
(temvar): New variable.
* gdb.python/py-type.exp (test_template): New proc.
This is a problem that I noticed on GNU/Linux, when using both GDB
and GDBserver to debug an Ada program. To reproduce, use any Ada
program, built with debug info ("gnatmake -g ...").
Then start the program with gdbserver:
% gdbserver :4444 simple_main
And then insert a breakpoint using the name of an Ada function,
followed by connecting to the target server:
(gdb) b simple.test_simple
Breakpoint 1 at 0x401f28: file simple.adb, line 16.
(gdb) tar rem :4444
Remote debugging using :4444
Reading symbols from /lib64/ld-linux-x86-64.so.2...
Reading symbols from /usr/lib/debug/lib/ld-2.11.1.so...done.
done.
Loaded symbols for /lib64/ld-linux-x86-64.so.2
!! -> Error in re-setting breakpoint 1: Can't find member of namespace, class,
!! -> struct, or union named "simple.test_simple"
!! -> Hint: try 'simple.test_simple<TAB> or 'simple.test_simple<ESC-?>
!! -> (Note leading single quote.)
0x00007f4db3cf2af0 in _start () from /lib64/ld-linux-x86-64.so.2
Created trace state variable $trace_timestamp for target's variable 1.
The problem is related to the fact that GDB found debug symbols for
ld.so in /usr/lib/debug. For debugger configured with a prefix that
is different from /usr, one way to force the problem to reproduce is
to use:
(gdb) set debug-file-directory /usr/lib/debug
(assuming that debug info has been installed at that location).
The problem is that the wrong language is used to parse the breakpoint
location because it gets changed from under us as a side effect of
some of the code that we do in prepration for re-parsing. In particular,
breakpoint_re_set_one reads:
set_language (b->language);
input_radix = b->input_radix;
s = b->addr_string;
save_current_space_and_thread ();
switch_to_program_space_and_thread (b->pspace);
marker_spec = b->type == bp_static_tracepoint && is_marker_spec (s);
[if (marker_spec) decode_tracepoint_spec (...) else decode_line_1]
What happens in our case is that debugging information gets found
for ld.so. As a result, the current_frame language is C whereas it
would have been unknown if we did not have debugging info. And
save_current_space_and_thread() implicitly causes the current frame
to be selected, which changes the language automatically if the new
language is not uknown and the the language mode is auto.
The fix, until all parsing routines (including decode_line_1) get upgraded
to take a language, is to select the breakpoint language as late as possible.
In this case, we don't need to do that until we actually try to parse
the breakpoint addr_string.
gdb/ChangeLog:
* breakpoint.c (breakpoint_re_set_one): Move call to set_language
down, just before the block that parse the breakpoint addr_string.
This patch moves a couple of write-after-approval names up to keep
the list in alphabetical order.
2010-07-27 Joel Brobecker <brobecker@adacore.com>
* MAINTAINERS (Write After Approval): Reorder a couple of entries.
* linux-nat.c (linux_nat_lp_status_is_event): New function.
(count_events_callback, select_event_lwp_callback)
(cancel_breakpoints_callback, linux_nat_wait_1): Use it.
* top.c (input_from_terminal_p): Return 0 on BATCH_FLAG.
* utils.c (defaulted_query): Do not explicitly check for BATCH_FLAG.
(fputs_maybe_filtered): Do not do filtering also on
! INPUT_FROM_TERMINAL_P.