Basically the problem is that "symtab" is ambiguous.
Is it the primary symtab (where we canonically think of
blockvectors as being stored) or is it for a specific file
(where each file's line table is stored) ?
gdb_disassembly wants the symtab that contains the line table
but is instead getting the primary symtab.
gdb/ChangeLog:
PR symtab/17559
* symtab.c (find_pc_line_symtab): New function.
* symtab.h (find_pc_line_symtab): Declare.
* disasm.c (gdb_disassembly): Call find_pc_line_symtab instead of
find_pc_symtab.
* tui/tui-disasm.c (tui_set_disassem_content): Ditto.
* tui/tui-hooks.c (tui_selected_frame_level_changed_hook): Ditto.
* tui/tui-source.c (tui_vertical_source_scroll): Ditto.
* tui/tui-win.c (make_visible_with_new_height): Ditto.
* tui/tui-winsource.c (tui_horizontal_source_scroll): Ditto.
(tui_display_main): Call find_pc_line_symtab instead of find_pc_line.
gdb/testsuite/ChangeLog:
PR symtab/17559
* gdb.base/line-symtabs.exp: New file.
* gdb.base/line-symtabs.c: New file.
* gdb.base/line-symtabs.h: New file.
This patch just renames one function.
Its only caller is in stack.c where we're printing a backtrace
with non-zero info_verbose and we want to make sure all the needed
symtabs are expanded before printing the backtrace
so that debug symbol reading messages don't pollute the backtrace.
I think the new name of the function makes clearer to the reader
what is going on.
gdb/ChangeLog:
* symtab.c (expand_symtab_containing_pc): Renamed from
find_pc_sect_symtab_via_partial. All callers updated.
When searching static symbols, gdb would search over all
expanded symtabs of all objfiles, and if that fails only then
would it search all partial/gdb_index tables of all objfiles.
This means that the user could get a random instance of the
symbol depending on what symtabs have been previously expanded.
Now the search is consistent, searching each objfile completely
before proceeding to the next one.
gdb/ChangeLog:
PR symtab/17564
* symtab.c (lookup_symbol_in_all_objfiles): Delete.
(lookup_static_symbol): Move definition to new location and rewrite.
(lookup_symbol_in_objfile): New function.
(lookup_symbol_global_iterator_cb): Call it.
gdb/testsuite/ChangeLog:
PR symtab/17564
* gdb.base/symtab-search-order.exp: New file.
* gdb.base/symtab-search-order.c: New file.
* gdb.base/symtab-search-order-1.c: New file.
* gdb.base/symtab-search-order-shlib-1.c: New file.
The in_prologue check in the nexti code is obsolete; this commit
removes that, and then removes the in_prologue function as nothing
else uses it.
Looking at the code in GDB that makes use in_prologue, all we find is
this one caller:
if ((ecs->event_thread->control.step_over_calls == STEP_OVER_NONE)
|| ((ecs->event_thread->control.step_range_end == 1)
&& in_prologue (gdbarch, ecs->event_thread->prev_pc,
ecs->stop_func_start)))
{
/* I presume that step_over_calls is only 0 when we're
supposed to be stepping at the assembly language level
("stepi"). Just stop. */
/* Also, maybe we just did a "nexti" inside a prolog, so we
thought it was a subroutine call but it was not. Stop as
well. FENN */
/* And this works the same backward as frontward. MVS */
end_stepping_range (ecs);
return;
}
This was added by:
commit 100a02e1de
...
From Fernando Nasser:
* infrun.c (handle_inferior_event): Handle "nexti" inside function
prologues.
The mailing list thread is here:
https://sourceware.org/ml/gdb-patches/2001-01/msg00047.html
Not much discussion there, and no test, but looking at the code around
what was patched in that revision, we see that the checks that detect
whether the program has just stepped into a subroutine didn't rely on
the unwinders at all back then.
From 'git show 100a02e1:gdb/infrun.c':
if (stop_pc == ecs->stop_func_start /* Quick test */
|| (in_prologue (stop_pc, ecs->stop_func_start) &&
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
!IN_SOLIB_RETURN_TRAMPOLINE (stop_pc, ecs->stop_func_name))
|| IN_SOLIB_CALL_TRAMPOLINE (stop_pc, ecs->stop_func_name)
|| ecs->stop_func_name == 0)
{
/* It's a subroutine call. */
if ((step_over_calls == STEP_OVER_NONE)
|| ((step_range_end == 1)
&& in_prologue (prev_pc, ecs->stop_func_start)))
{
/* I presume that step_over_calls is only 0 when we're
supposed to be stepping at the assembly language level
("stepi"). Just stop. */
/* Also, maybe we just did a "nexti" inside a prolog,
so we thought it was a subroutine call but it was not.
Stop as well. FENN */
stop_step = 1;
print_stop_reason (END_STEPPING_RANGE, 0);
stop_stepping (ecs);
return;
}
Stripping the IN_SOLIB_RETURN_TRAMPOLINE checks for simplicity, we had:
if (stop_pc == ecs->stop_func_start /* Quick test */
|| in_prologue (stop_pc, ecs->stop_func_start)
|| ecs->stop_func_name == 0)
{
/* It's a subroutine call. */
That is, detecting a subroutine call was based on prologue detection
back then. So the in_prologue check in the current tree only made
sense back then as it was undoing a bad decision the in_prologue check
that used to exist above did.
Today, the check for a subroutine call relies on frame ids instead,
which are stable throughout the function. So we can just remove the
in_prologue check for nexti, and the whole in_prologue function along
with it.
Tested on x86_64 Fedora 20, and also by nexti-ing manually a prologue.
gdb/
2014-11-07 Pedro Alves <palves@redhat.com>
* infrun.c (process_event_stop_test) <subroutine check>: Don't
check if we did a "nexti" inside a prologue.
* symtab.c (in_prologue): Delete function.
* symtab.h (in_prologue): Delete declaration.
"aux" doesn't contribute anything to the name, and it makes the
reader wonder what it's supposed to mean.
gdb/ChangeLog:
* symtab.c (lookup_local_symbol): Renamed from lookup_symbol_aux_local.
All callers updated.
(lookup_symbol_in_all_objfiles): Renamed from
lookup_symbol_aux_symtabs. All callers updated.
(lookup_symbol_via_quick_fns): Renamed from lookup_symbol_aux_quick.
All callers updated.
(lookup_symbol_in_objfile_symtabs): Renamed from
lookup_symbol_aux_objfile. All callers updated.
and lookup_static_symbol_aux to lookup_static_symbol.
gdb/ChangeLog:
* symtab.c (lookup_static_symbol): Renamed from
lookup_static_symbol_aux. All callers updated.
(lookup_symbol_in_static_block): Renamed from lookup_symbol_static.
All callers updated.
gdb/ChangeLog:
* block.h (ALL_BLOCK_SYMBOLS_WITH_NAME): New macro.
* block.c (block_lookup_symbol): Use it.
* cp-support.c (make_symbol_overload_list_block): Use it.
* symtab.c (iterate_over_symbols): Use it.
There is another function, lookup_symbol_aux_block, and
the names lookup_block_symbol and lookup_symbol_aux_block don't
convey any real difference between them.
The difference is that lookup_block_symbol lives in the lower level
block API, and lookup_symbol_aux_block lives in the higher level symtab API.
This patch makes this distinction clear.
gdb/ChangeLog:
* symtab.c (lookup_block_symbol): Moved to ...
* block.c (block_lookup_symbol): ... here and renamed.
All callers updated.
* block.h (block_lookup_symbol): Declare.
* symtab.h (lookup_block_symbol): Delete.
Non-primary symtabs share the block vector with their primary symtabs.
In these cases there's no need to use ALL_SYMTABS.
gdb/ChangeLog:
* ada-lang.c (ada_make_symbol_completion_list): Use
ALL_PRIMARY_SYMTABS instead of ALL_SYMTABS.
* symtab.c (lookup_objfile_from_block): Ditto.
This constifies the parameters to search_symbols and fixes up the
fallout.
Tested by rebuilding.
2014-06-30 Tom Tromey <tromey@redhat.com>
* symtab.c (operator_chars): Make parameters and return type
const.
(file_matches): Make "files" const.
(struct search_symbols_data) <files>: Now const.
(search_symbols): Make "regexp" and "files" parameters const.
Update.
(symtab_symbol_info): Remove cast.
(rbreak_command): Update.
* symtab.h (search_symbols): Update.
Generally, the blockvector ought to be readonly. So, this patch makes
the blockvector const in the symtab, and also changes various
blockvector APIs to be const.
This patch has a couple of spots that cast away const. I consider
these to be ok because they occur in mdebugread and are used while
constructing the blockvector. I have added comments at these spots.
2014-06-18 Tom Tromey <tromey@redhat.com>
* symtab.h (struct symtab) <blockvector>: Now const.
* ada-lang.c (ada_add_global_exceptions): Update.
* buildsym.c (augment_type_symtab): Update.
* dwarf2read.c (dw2_lookup_symbol): Update.
* jit.c (finalize_symtab): Update.
* jv-lang.c (add_class_symtab_symbol): Update.
* mdebugread.c (parse_symbol, add_block, sort_blocks, new_symtab):
Update.
* objfiles.c (objfile_relocate1): Update.
* psymtab.c (lookup_symbol_aux_psymtabs)
(maintenance_check_psymtabs): Update.
* python/py-symtab.c (stpy_global_block, stpy_static_block):
Update.
* spu-tdep.c (spu_catch_start): Update.
* symmisc.c (dump_symtab_1): Update.
* symtab.c (lookup_global_symbol_from_objfile)
(lookup_symbol_aux_objfile, lookup_symbol_aux_quick)
(basic_lookup_transparent_type_quick)
(basic_lookup_transparent_type, find_pc_sect_symtab)
(find_pc_sect_line, search_symbols): Update.
* block.c (find_block_in_blockvector): Make "bl" const.
(blockvector_for_pc_sect, blockvector_for_pc): Make return type
const.
(blockvector_contains_pc): Make "bv" const.
(block_for_pc_sect): Update.
* block.h (blockvector_for_pc, blockvector_for_pc_sect)
(blockvector_contains_pc): Update.
* breakpoint.c (resolve_sal_pc): Update.
* inline-frame.c (block_starting_point_at): Update.
This removes an unneeded const cast from symtab.c:add_macro_name.
2014-06-18 Tom Tromey <tromey@redhat.com>
* symtab.c (add_macro_name): Remove unneeded cast.
PR c++/16253.
symbol_matches_domain was permitting searches for a VAR_DOMAIN
symbol to also match STRUCT_DOMAIN symbols for languages like C++
where STRUCT_DOMAIN symbols also define a typedef of the same name,
e.g., "struct foo {}" introduces a typedef of the name "foo".
Problems occur if there exists both a VAR_DOMAIN and STRUCT_DOMAIN
symbol of the same name. Then it is essentially a race between which
symbol is found first. The other symbol is obscurred.
[This is a relatively common idiom: enum e { ... } e;]
This patchset moves this "language defines a typedef" logic to
lookup_symbol[_in_language], looking first for a symbol in the given
domain and falling back to searching STRUCT_DOMAIN when/if appropriate.
2014-04-14 Keith Seitz <keiths@redhat.com>
PR c++/16253
* ada-lang.c (ada_symbol_matches_domain): Moved here and renamed
from symbol_matches_domain in symtab.c. All local callers
of symbol_matches_domain updated.
(standard_lookup): If DOMAIN is VAR_DOMAIN and no symbol is found,
search STRUCT_DOMAIN.
(ada_find_any_type_symbol): Do not search STRUCT_DOMAIN
independently. standard_lookup will do that automatically.
* cp-namespace.c (cp_lookup_symbol_nonlocal): Explain when/why
VAR_DOMAIN searches may return a STRUCT_DOMAIN match.
(cp_lookup_symbol_in_namespace): Likewise.
If no VAR_DOMAIN symbol is found, search STRUCT_DOMAIN.
(cp_lookup_symbol_exports): Explain when/why VAR_DOMAIN searches
may return a STRUCT_DOMAIN match.
(lookup_symbol_file): Search for the class name in STRUCT_DOMAIN.
* cp-support.c: Include language.h.
(inspect_type): Explicitly search STRUCT_DOMAIN before searching
VAR_DOMAIN.
* psymtab.c (match_partial_symbol): Compare the requested
domain with the symbol's domain directly.
(lookup_partial_symbol): Likewise.
* symtab.c (lookup_symbol_in_language): Explain when/why
VAR_DOMAIN searches may return a STRUCT_DOMAIN match.
If no VAR_DOMAIN symbol is found, search STRUCT_DOMAIN for
appropriate languages.
(symbol_matches_domain): Renamed `ada_symbol_matches_domain'
and moved to ada-lang.c
(lookup_block_symbol): Explain that this function only returns
symbol matching the requested DOMAIN.
Compare the requested domain with the symbol's domain directly.
(iterate_over_symbols): Compare the requested domain with the
symbol's domain directly.
* symtab.h (symbol_matches_domain): Remove.
2014-04-14 Keith Seitz <keiths@redhat.com>
PR c++/16253
* gdb.cp/var-tag.cc: New file.
* gdb.cp/var-tag.exp: New file.
* gdb.dwarf2/dw2-ada-ffffffff.exp: Set the language to C++.
* gdb.dwarf2/dw2-anon-mptr.exp: Likewise.
* gdb.dwarf2/dw2-double-set-die-type.exp: Likewise.
* gdb.dwarf2/dw2-inheritance.exp: Likewise.
This changes the probes to be independent of the program space.
After this, when a probe's address is needed, it is determined by
applying offsets at the point of use.
This introduces a bound_probe object, similar to bound minimal
symbols. Objects of this type are used when it's necessary to pass a
probe and its corresponding objfile.
This removes the backlink from probe to objfile, which was primarily
used to fetch the architecture to use.
This adds a get_probe_address function which calls a probe method to
compute the probe's relocated address. Similarly, it adds an objfile
parameter to the semaphore methods so they can do the relocation
properly as well.
2014-03-03 Tom Tromey <tromey@redhat.com>
* break-catch-throw.c (fetch_probe_arguments): Use bound probes.
* breakpoint.c (create_longjmp_master_breakpoint): Use
get_probe_address.
(add_location_to_breakpoint, bkpt_probe_insert_location)
(bkpt_probe_remove_location): Update.
* breakpoint.h (struct bp_location) <probe>: Now a bound_probe.
* elfread.c (elf_symfile_relocate_probe): Remove.
(elf_probe_fns): Update.
(insert_exception_resume_breakpoint): Change type of "probe"
parameter to bound_probe.
(check_exception_resume): Update.
* objfiles.c (objfile_relocate1): Don't relocate probes.
* probe.c (bound_probe_s): New typedef.
(parse_probes): Use get_probe_address. Set sal's objfile.
(find_probe_by_pc): Return a bound_probe.
(collect_probes): Return a VEC(bound_probe_s).
(compare_probes): Update.
(gen_ui_out_table_header_info): Change type of "probes"
parameter. Update.
(info_probes_for_ops): Update.
(get_probe_address): New function.
(probe_safe_evaluate_at_pc): Update.
* probe.h (struct probe_ops) <get_probe_address>: New field.
<set_semaphore, clear_semaphore>: Add objfile parameter.
(struct probe) <objfile>: Remove field.
<arch>: New field.
<address>: Update comment.
(struct bound_probe): New.
(find_probe_by_pc): Return a bound_probe.
(get_probe_address): Declare.
* solib-svr4.c (struct probe_and_action) <address>: New field.
(hash_probe_and_action, equal_probe_and_action): Update.
(register_solib_event_probe): Add address parameter.
(solib_event_probe_at): Update.
(svr4_create_probe_breakpoints): Add objfile parameter. Use
get_probe_address.
* stap-probe.c (struct stap_probe) <sem_addr>: Update comment.
(stap_get_probe_address): New function.
(stap_can_evaluate_probe_arguments, compute_probe_arg)
(compile_probe_arg): Update.
(stap_set_semaphore, stap_clear_semaphore): Compute semaphore's
address.
(handle_stap_probe): Don't relocate the probe.
(stap_relocate): Remove.
(stap_gen_info_probes_table_values): Update.
(stap_probe_ops): Remove stap_relocate.
* symfile-debug.c (debug_sym_relocate_probe): Remove.
(debug_sym_probe_fns): Update.
* symfile.h (struct sym_probe_fns) <sym_relocate_probe>: Remove.
* symtab.c (init_sal): Use memset.
* symtab.h (struct symtab_and_line) <objfile>: New field.
* tracepoint.c (start_tracing, stop_tracing): Update.
This patch handles another aspect of the ELFv2 ABI, which unfortunately
requires common code changes.
In ELFv2, functions may provide both a global and a local entry point.
The global entry point (where the function symbol points to) is intended
to be used for function-pointer or cross-module (PLT) calls, and requires
r12 to be set up to the entry point address itself. The local entry
point (which is found at a fixed offset after the global entry point,
as defined by bits in the symbol table entries' st_other field), instead
expects r2 to be set up to the current TOC.
Now, when setting a breakpoint on a function by name, you really want
that breakpoint to trigger either way, no matter whether the function
is called via its local or global entry point. Since the global entry
point will always fall through into the local entry point, the way to
achieve that is to simply set the breakpoint at the local entry point.
One way to do that would be to have prologue parsing skip the code
sequence that makes up the global entry point. Unfortunately, this
does not work reliably, since -for optimized code- GDB these days
will not actuall invoke the prologue parsing code but instead just
set the breakpoint at the symbol address and rely on DWARF being
correct at any point throughout the function ...
Unfortunately, I don't really see any way to express the notion of
local entry points with the current set of gdbarch callbacks.
Thus this patch adds a new callback, skip_entrypoint, that is
somewhat analogous to skip_prologue, but is called every time
GDB needs to determine a function start address, even in those
cases where GDB decides to not call skip_prologue.
As a side effect, the skip_entrypoint implementation on ppc64
does not need to perform any instruction parsing; it can simply
rely on the local entry point flags in the symbol table entry.
With this implemented, two test cases would still fail to set
the breakpoint correctly, but that's because they use the construct:
gdb_test "break *hello"
Now, using "*hello" explicitly instructs GDB to set the breakpoint
at the numerical value of "hello" treated as function pointer, so
it will by definition only hit the global entry point.
I think this behaviour is unavoidable, but acceptable -- most people
do not use this construct, and if they do, they get what they
asked for ...
In one of those two test cases, use of this construct is really
not appropriate. I think this was added way back when as a means
to work around prologue skipping problems on some platforms. These
days that shouldn't really be necessary any more ...
For the other (step-bt), we really want to make sure backtracing
works on the very first instruction of the routine. To enable that
test also on powerpc64le-linux, we can modify the code to call the
test function via function pointer (which makes it use the global
entry point in the ELFv2 ABI).
gdb/ChangeLog:
* gdbarch.sh (skip_entrypoint): New callback.
* gdbarch.c, gdbarch.h: Regenerate.
* symtab.c (skip_prologue_sal): Call gdbarch_skip_entrypoint.
* infrun.c (fill_in_stop_func): Likewise.
* ppc-linux-tdep.c: Include "elf/ppc64.h".
(ppc_elfv2_elf_make_msymbol_special): New function.
(ppc_elfv2_skip_entrypoint): Likewise.
(ppc_linux_init_abi): Install them for ELFv2.
gdb/testsuite/ChangeLog:
* gdb.base/sigbpt.exp: Do not use "*" when setting breakpoint
on a function.
* gdb.base/step-bt.c: Call hello via function pointer to make
sure its first instruction is executed on powerpc64le-linux.
This adds the "main"-related data into the per-BFD. This is needed
because once symbol sharing across objfiles is complete, computing the
main name as a side effect of symbol reading will no longer work --
the symbols simply won't be re-read.
After this change, set_main_name is only used by the main_name
machinery itself, so this patch makes it static.
2014-01-15 Tom Tromey <tromey@redhat.com>
* dbxread.c (process_one_symbol): Use set_objfile_main_name.
* dwarf2read.c (read_partial_die): Use set_objfile_main_name.
* objfiles.c (get_objfile_bfd_data): Initialize language_of_main.
(set_objfile_main_name): New function.
* objfiles.h (struct objfile_per_bfd_storage) <name_of_main,
language_of_main>: New fields.
(set_objfile_main_name): Declare.
* symtab.c (find_main_name): Loop over objfiles to find the main
name and language.
(set_main_name): Now static.
(get_main_info): Add comment.
* symtab.h (set_main_name): Don't declare.
This moves the "main" name and language into an object attached to the
current progspace. This prevents problems if there are multiple
inferiors tha have different ideas of "main" -- which matters at least
for unwinding, see frame.c:inside_main_func.
2014-01-15 Tom Tromey <tromey@redhat.com>
* symtab.c (main_progspace_key): New global.
(struct main_info): New.
(name_of_main, language_of_main): Remove.
(get_main_info, main_info_cleanup): New function.
(set_main_name, main_name, main_language): Use get_main_info.
(_initialize_symtab): Initialize main_progspace_key.
This makes the global language_of_main static. Now it can be set only
via a new argument to set_main_name.
2014-01-15 Tom Tromey <tromey@redhat.com>
* dbxread.c (process_one_symbol): Update.
* dwarf2read.c (read_partial_die): Update.
* symfile.c (set_initial_language): Call main_language.
* symtab.c (language_of_main): Now static.
(set_main_name): Add 'lang' parameter.
(find_main_name): Update.
(main_language): New function.
(symtab_observer_executable_changed): Update.
* symtab.h (set_main_name): Update.
(language_of_main): Remove.
(main_language): Declare.
This last patch removes "partial" from the names of
expand_partial_symbol_names and map_partial_symbol_filenames.
It also renames expand_partial_symbol_names to match the
struct quick_symbol_functions "method" that it wraps:
expand_symtabs_matching.
This patch also adds two parameters to expand_symtabs_matching
so that it can fully wrap the underlying quick_symbol_functions method.
This makes it usable in more places.
I thought of having a cover function that still had the same
signature as the old expand_partial_symbol_names function,
but I couldn't think of a good name, and it wasn't clear it was
worth it anyway.
* symfile.h (expand_symtabs_matching): Renamed from
expand_partial_symbol_names. Update prototype.
(map_symbol_filenames): Renamed from map_partial_symbol_filenames.
* symfile.c (expand_symtabs_matching): Renamed from
expand_partial_symbol_names. New args file_matcher, kind.
Rename arg fun to symbol_matcher.
(map_symbol_filenames): Renamed from map_partial_symbol_filenames.
* ada-lang.c (ada_complete_symbol_matcher): Renamed from
ada_expand_partial_symbol_name.
(ada_make_symbol_completion_list): Update to call
expand_symtabs_matching.
(ada_add_global_exceptions): Call expand_symtabs_matching.
* mi/mi-cmd-file.c (mi_cmd_file_list_exec_source_files): Update to
call map_symbol_filenames.
* symtab.c (sources_info): Update to call map_symbol_filenames.
(search_symbols): Call expand_symtabs_matching.
(symbol_completion_matcher): Renamed from expand_partial_symbol_name.
(default_make_symbol_completion_list_break_on): Update to call
expand_symtabs_matching.
(make_source_files_completion_list): Update to call
map_symbol_filenames.
This is the first of a set of three patches to cleanup psymtab.c a bit.
Basically, these two functions do not belong in psymtab.c:
expand_partial_symbol_names, map_partial_symbol_filenames,
and "partial" does not belong in the function name.
This first patch moves them to a better location.
The second patch adds some typedefs for function parameters to
quick_symbol_functions.expand_symtabs_matching.
The third patch removes "partial" from the function names
and uses them in more places.
* psymtab.c (expand_partial_symbol_names): Delete, moved to symfile.c.
(map_partial_symbol_filenames): Ditto.
* psymtab.h (expand_partial_symbol_names): Delete, moved to symfile.h.
(map_partial_symbol_filenames): Ditto.
* symfile.c (expand_partial_symbol_names): Moved here from psymtab.c.
(map_partial_symbol_filenames): Ditto.
* symfile.h (expand_partial_symbol_names): Moved here from psymtab.h.
(map_partial_symbol_filenames): Ditto.
* symtab.c: Delete #include "psymtab.h".
This helps with the following issue: Given an Ada program defining
a global variable:
package Pck is
Watch : Integer := 1974;
end Pck;
When printing the address of this variable, GDB also tries to print
the associated symbol name:
(gdb) p watch'address
$1 = (access integer) 0x6139d8 <pck__watch>
^^
||
The problem is that GDB prints the variable's linkage name, instead
of its natural name. This is because the language of the associated
minimal symbol never really gets set.
This patch adds handling for Ada symbols in symbol_find_demangled_name.
After this patch, we now get:
(gdb) p watch'address
$1 = (access integer) 0x6139d8 <pck.watch>
^
|
gdb/ChangeLog:
* symtab.c (symbol_find_demangled_name): Add handling of
Ada symbols.
gdb/testsuite/ChangeLog:
* gdb.ada/int_deref.exp: Add test verifying that we print
the decoded symbol name when printing the address of Ada
symbols.
This patch is purely mechanical. It removes gdb_stat.h and changes
the code to use sys/stat.h.
2013-11-18 Tom Tromey <tromey@redhat.com>
* common/gdb_stat.h: Remove.
* ada-lang.c: Use sys/stat.h, not gdb_stat.h.
* common/filestuff.c: Use sys/stat.h, not gdb_stat.h.
* common/linux-osdata.c: Use sys/stat.h, not gdb_stat.h.
* corefile.c: Use sys/stat.h, not gdb_stat.h.
* ctf.c: Use sys/stat.h, not gdb_stat.h.
* darwin-nat.c: Use sys/stat.h, not gdb_stat.h.
* dbxread.c: Use sys/stat.h, not gdb_stat.h.
* dwarf2read.c: Use sys/stat.h, not gdb_stat.h.
* exec.c: Use sys/stat.h, not gdb_stat.h.
* gdbserver/linux-low.c: Use sys/stat.h, not gdb_stat.h.
* gdbserver/remote-utils.c: Use sys/stat.h, not gdb_stat.h.
* inf-child.c: Use sys/stat.h, not gdb_stat.h.
* jit.c: Use sys/stat.h, not gdb_stat.h.
* linux-nat.c: Use sys/stat.h, not gdb_stat.h.
* m68klinux-nat.c: Use sys/stat.h, not gdb_stat.h.
* main.c: Use sys/stat.h, not gdb_stat.h.
* mdebugread.c: Use sys/stat.h, not gdb_stat.h.
* mi/mi-cmd-env.c: Use sys/stat.h, not gdb_stat.h.
* nto-tdep.c: Use sys/stat.h, not gdb_stat.h.
* objfiles.c: Use sys/stat.h, not gdb_stat.h.
* procfs.c: Use sys/stat.h, not gdb_stat.h.
* remote-fileio.c: Use sys/stat.h, not gdb_stat.h.
* remote-mips.c: Use sys/stat.h, not gdb_stat.h.
* remote.c: Use sys/stat.h, not gdb_stat.h.
* rs6000-nat.c: Use sys/stat.h, not gdb_stat.h.
* sol-thread.c: Use sys/stat.h, not gdb_stat.h.
* solib-spu.c: Use sys/stat.h, not gdb_stat.h.
* source.c: Use sys/stat.h, not gdb_stat.h.
* symfile.c: Use sys/stat.h, not gdb_stat.h.
* symmisc.c: Use sys/stat.h, not gdb_stat.h.
* symtab.c: Use sys/stat.h, not gdb_stat.h.
* top.c: Use sys/stat.h, not gdb_stat.h.
* xcoffread.c: Use sys/stat.h, not gdb_stat.h.
This removes gdb_string.h. This patch is purely mechanical. I
created it by running the two commands:
git rm common/gdb_string.h
perl -pi -e's/"gdb_string.h"/<string.h>/;' *.[chyl] */*.[chyl]
2013-11-18 Tom Tromey <tromey@redhat.com>
* common/gdb_string.h: Remove.
* aarch64-tdep.c: Use string.h, not gdb_string.h.
* ada-exp.y: Use string.h, not gdb_string.h.
* ada-lang.c: Use string.h, not gdb_string.h.
* ada-lex.l: Use string.h, not gdb_string.h.
* ada-typeprint.c: Use string.h, not gdb_string.h.
* ada-valprint.c: Use string.h, not gdb_string.h.
* aix-thread.c: Use string.h, not gdb_string.h.
* alpha-linux-tdep.c: Use string.h, not gdb_string.h.
* alpha-mdebug-tdep.c: Use string.h, not gdb_string.h.
* alpha-nat.c: Use string.h, not gdb_string.h.
* alpha-osf1-tdep.c: Use string.h, not gdb_string.h.
* alpha-tdep.c: Use string.h, not gdb_string.h.
* alphanbsd-tdep.c: Use string.h, not gdb_string.h.
* amd64-dicos-tdep.c: Use string.h, not gdb_string.h.
* amd64-linux-nat.c: Use string.h, not gdb_string.h.
* amd64-linux-tdep.c: Use string.h, not gdb_string.h.
* amd64-nat.c: Use string.h, not gdb_string.h.
* amd64-sol2-tdep.c: Use string.h, not gdb_string.h.
* amd64fbsd-tdep.c: Use string.h, not gdb_string.h.
* amd64obsd-tdep.c: Use string.h, not gdb_string.h.
* arch-utils.c: Use string.h, not gdb_string.h.
* arm-linux-nat.c: Use string.h, not gdb_string.h.
* arm-linux-tdep.c: Use string.h, not gdb_string.h.
* arm-tdep.c: Use string.h, not gdb_string.h.
* arm-wince-tdep.c: Use string.h, not gdb_string.h.
* armbsd-tdep.c: Use string.h, not gdb_string.h.
* armnbsd-nat.c: Use string.h, not gdb_string.h.
* armnbsd-tdep.c: Use string.h, not gdb_string.h.
* armobsd-tdep.c: Use string.h, not gdb_string.h.
* avr-tdep.c: Use string.h, not gdb_string.h.
* ax-gdb.c: Use string.h, not gdb_string.h.
* ax-general.c: Use string.h, not gdb_string.h.
* bcache.c: Use string.h, not gdb_string.h.
* bfin-tdep.c: Use string.h, not gdb_string.h.
* breakpoint.c: Use string.h, not gdb_string.h.
* build-id.c: Use string.h, not gdb_string.h.
* buildsym.c: Use string.h, not gdb_string.h.
* c-exp.y: Use string.h, not gdb_string.h.
* c-lang.c: Use string.h, not gdb_string.h.
* c-typeprint.c: Use string.h, not gdb_string.h.
* c-valprint.c: Use string.h, not gdb_string.h.
* charset.c: Use string.h, not gdb_string.h.
* cli-out.c: Use string.h, not gdb_string.h.
* cli/cli-cmds.c: Use string.h, not gdb_string.h.
* cli/cli-decode.c: Use string.h, not gdb_string.h.
* cli/cli-dump.c: Use string.h, not gdb_string.h.
* cli/cli-interp.c: Use string.h, not gdb_string.h.
* cli/cli-logging.c: Use string.h, not gdb_string.h.
* cli/cli-script.c: Use string.h, not gdb_string.h.
* cli/cli-setshow.c: Use string.h, not gdb_string.h.
* cli/cli-utils.c: Use string.h, not gdb_string.h.
* coffread.c: Use string.h, not gdb_string.h.
* common/common-utils.c: Use string.h, not gdb_string.h.
* common/filestuff.c: Use string.h, not gdb_string.h.
* common/linux-procfs.c: Use string.h, not gdb_string.h.
* common/linux-ptrace.c: Use string.h, not gdb_string.h.
* common/signals.c: Use string.h, not gdb_string.h.
* common/vec.h: Use string.h, not gdb_string.h.
* core-regset.c: Use string.h, not gdb_string.h.
* corefile.c: Use string.h, not gdb_string.h.
* corelow.c: Use string.h, not gdb_string.h.
* cp-abi.c: Use string.h, not gdb_string.h.
* cp-support.c: Use string.h, not gdb_string.h.
* cp-valprint.c: Use string.h, not gdb_string.h.
* cris-tdep.c: Use string.h, not gdb_string.h.
* d-lang.c: Use string.h, not gdb_string.h.
* dbxread.c: Use string.h, not gdb_string.h.
* dcache.c: Use string.h, not gdb_string.h.
* demangle.c: Use string.h, not gdb_string.h.
* dicos-tdep.c: Use string.h, not gdb_string.h.
* disasm.c: Use string.h, not gdb_string.h.
* doublest.c: Use string.h, not gdb_string.h.
* dsrec.c: Use string.h, not gdb_string.h.
* dummy-frame.c: Use string.h, not gdb_string.h.
* dwarf2-frame.c: Use string.h, not gdb_string.h.
* dwarf2loc.c: Use string.h, not gdb_string.h.
* dwarf2read.c: Use string.h, not gdb_string.h.
* elfread.c: Use string.h, not gdb_string.h.
* environ.c: Use string.h, not gdb_string.h.
* eval.c: Use string.h, not gdb_string.h.
* event-loop.c: Use string.h, not gdb_string.h.
* exceptions.c: Use string.h, not gdb_string.h.
* exec.c: Use string.h, not gdb_string.h.
* expprint.c: Use string.h, not gdb_string.h.
* f-exp.y: Use string.h, not gdb_string.h.
* f-lang.c: Use string.h, not gdb_string.h.
* f-typeprint.c: Use string.h, not gdb_string.h.
* f-valprint.c: Use string.h, not gdb_string.h.
* fbsd-nat.c: Use string.h, not gdb_string.h.
* findcmd.c: Use string.h, not gdb_string.h.
* findvar.c: Use string.h, not gdb_string.h.
* fork-child.c: Use string.h, not gdb_string.h.
* frame.c: Use string.h, not gdb_string.h.
* frv-linux-tdep.c: Use string.h, not gdb_string.h.
* frv-tdep.c: Use string.h, not gdb_string.h.
* gdb.c: Use string.h, not gdb_string.h.
* gdb_bfd.c: Use string.h, not gdb_string.h.
* gdbarch.c: Use string.h, not gdb_string.h.
* gdbtypes.c: Use string.h, not gdb_string.h.
* gnu-nat.c: Use string.h, not gdb_string.h.
* gnu-v2-abi.c: Use string.h, not gdb_string.h.
* gnu-v3-abi.c: Use string.h, not gdb_string.h.
* go-exp.y: Use string.h, not gdb_string.h.
* go-lang.c: Use string.h, not gdb_string.h.
* go32-nat.c: Use string.h, not gdb_string.h.
* hppa-hpux-tdep.c: Use string.h, not gdb_string.h.
* hppa-linux-nat.c: Use string.h, not gdb_string.h.
* hppanbsd-tdep.c: Use string.h, not gdb_string.h.
* hppaobsd-tdep.c: Use string.h, not gdb_string.h.
* i386-cygwin-tdep.c: Use string.h, not gdb_string.h.
* i386-dicos-tdep.c: Use string.h, not gdb_string.h.
* i386-linux-nat.c: Use string.h, not gdb_string.h.
* i386-linux-tdep.c: Use string.h, not gdb_string.h.
* i386-nto-tdep.c: Use string.h, not gdb_string.h.
* i386-sol2-tdep.c: Use string.h, not gdb_string.h.
* i386-tdep.c: Use string.h, not gdb_string.h.
* i386bsd-tdep.c: Use string.h, not gdb_string.h.
* i386gnu-nat.c: Use string.h, not gdb_string.h.
* i386nbsd-tdep.c: Use string.h, not gdb_string.h.
* i386obsd-tdep.c: Use string.h, not gdb_string.h.
* i387-tdep.c: Use string.h, not gdb_string.h.
* ia64-libunwind-tdep.c: Use string.h, not gdb_string.h.
* ia64-linux-nat.c: Use string.h, not gdb_string.h.
* inf-child.c: Use string.h, not gdb_string.h.
* inf-ptrace.c: Use string.h, not gdb_string.h.
* inf-ttrace.c: Use string.h, not gdb_string.h.
* infcall.c: Use string.h, not gdb_string.h.
* infcmd.c: Use string.h, not gdb_string.h.
* inflow.c: Use string.h, not gdb_string.h.
* infrun.c: Use string.h, not gdb_string.h.
* interps.c: Use string.h, not gdb_string.h.
* iq2000-tdep.c: Use string.h, not gdb_string.h.
* irix5-nat.c: Use string.h, not gdb_string.h.
* jv-exp.y: Use string.h, not gdb_string.h.
* jv-lang.c: Use string.h, not gdb_string.h.
* jv-typeprint.c: Use string.h, not gdb_string.h.
* jv-valprint.c: Use string.h, not gdb_string.h.
* language.c: Use string.h, not gdb_string.h.
* linux-fork.c: Use string.h, not gdb_string.h.
* linux-nat.c: Use string.h, not gdb_string.h.
* lm32-tdep.c: Use string.h, not gdb_string.h.
* m2-exp.y: Use string.h, not gdb_string.h.
* m2-typeprint.c: Use string.h, not gdb_string.h.
* m32c-tdep.c: Use string.h, not gdb_string.h.
* m32r-linux-nat.c: Use string.h, not gdb_string.h.
* m32r-linux-tdep.c: Use string.h, not gdb_string.h.
* m32r-rom.c: Use string.h, not gdb_string.h.
* m32r-tdep.c: Use string.h, not gdb_string.h.
* m68hc11-tdep.c: Use string.h, not gdb_string.h.
* m68k-tdep.c: Use string.h, not gdb_string.h.
* m68kbsd-tdep.c: Use string.h, not gdb_string.h.
* m68klinux-nat.c: Use string.h, not gdb_string.h.
* m68klinux-tdep.c: Use string.h, not gdb_string.h.
* m88k-tdep.c: Use string.h, not gdb_string.h.
* macrocmd.c: Use string.h, not gdb_string.h.
* main.c: Use string.h, not gdb_string.h.
* mdebugread.c: Use string.h, not gdb_string.h.
* mem-break.c: Use string.h, not gdb_string.h.
* memattr.c: Use string.h, not gdb_string.h.
* memory-map.c: Use string.h, not gdb_string.h.
* mep-tdep.c: Use string.h, not gdb_string.h.
* mi/mi-cmd-break.c: Use string.h, not gdb_string.h.
* mi/mi-cmd-disas.c: Use string.h, not gdb_string.h.
* mi/mi-cmd-env.c: Use string.h, not gdb_string.h.
* mi/mi-cmd-stack.c: Use string.h, not gdb_string.h.
* mi/mi-cmd-var.c: Use string.h, not gdb_string.h.
* mi/mi-cmds.c: Use string.h, not gdb_string.h.
* mi/mi-console.c: Use string.h, not gdb_string.h.
* mi/mi-getopt.c: Use string.h, not gdb_string.h.
* mi/mi-interp.c: Use string.h, not gdb_string.h.
* mi/mi-main.c: Use string.h, not gdb_string.h.
* mi/mi-parse.c: Use string.h, not gdb_string.h.
* microblaze-rom.c: Use string.h, not gdb_string.h.
* microblaze-tdep.c: Use string.h, not gdb_string.h.
* mingw-hdep.c: Use string.h, not gdb_string.h.
* minidebug.c: Use string.h, not gdb_string.h.
* minsyms.c: Use string.h, not gdb_string.h.
* mips-irix-tdep.c: Use string.h, not gdb_string.h.
* mips-linux-tdep.c: Use string.h, not gdb_string.h.
* mips-tdep.c: Use string.h, not gdb_string.h.
* mips64obsd-tdep.c: Use string.h, not gdb_string.h.
* mipsnbsd-tdep.c: Use string.h, not gdb_string.h.
* mipsread.c: Use string.h, not gdb_string.h.
* mn10300-linux-tdep.c: Use string.h, not gdb_string.h.
* mn10300-tdep.c: Use string.h, not gdb_string.h.
* monitor.c: Use string.h, not gdb_string.h.
* moxie-tdep.c: Use string.h, not gdb_string.h.
* mt-tdep.c: Use string.h, not gdb_string.h.
* nbsd-tdep.c: Use string.h, not gdb_string.h.
* nios2-linux-tdep.c: Use string.h, not gdb_string.h.
* nto-procfs.c: Use string.h, not gdb_string.h.
* nto-tdep.c: Use string.h, not gdb_string.h.
* objc-lang.c: Use string.h, not gdb_string.h.
* objfiles.c: Use string.h, not gdb_string.h.
* opencl-lang.c: Use string.h, not gdb_string.h.
* osabi.c: Use string.h, not gdb_string.h.
* osdata.c: Use string.h, not gdb_string.h.
* p-exp.y: Use string.h, not gdb_string.h.
* p-lang.c: Use string.h, not gdb_string.h.
* p-typeprint.c: Use string.h, not gdb_string.h.
* parse.c: Use string.h, not gdb_string.h.
* posix-hdep.c: Use string.h, not gdb_string.h.
* ppc-linux-nat.c: Use string.h, not gdb_string.h.
* ppc-sysv-tdep.c: Use string.h, not gdb_string.h.
* ppcfbsd-tdep.c: Use string.h, not gdb_string.h.
* ppcnbsd-tdep.c: Use string.h, not gdb_string.h.
* ppcobsd-tdep.c: Use string.h, not gdb_string.h.
* printcmd.c: Use string.h, not gdb_string.h.
* procfs.c: Use string.h, not gdb_string.h.
* prologue-value.c: Use string.h, not gdb_string.h.
* python/py-auto-load.c: Use string.h, not gdb_string.h.
* python/py-gdb-readline.c: Use string.h, not gdb_string.h.
* ravenscar-thread.c: Use string.h, not gdb_string.h.
* regcache.c: Use string.h, not gdb_string.h.
* registry.c: Use string.h, not gdb_string.h.
* remote-fileio.c: Use string.h, not gdb_string.h.
* remote-m32r-sdi.c: Use string.h, not gdb_string.h.
* remote-mips.c: Use string.h, not gdb_string.h.
* remote-sim.c: Use string.h, not gdb_string.h.
* remote.c: Use string.h, not gdb_string.h.
* reverse.c: Use string.h, not gdb_string.h.
* rs6000-aix-tdep.c: Use string.h, not gdb_string.h.
* ser-base.c: Use string.h, not gdb_string.h.
* ser-go32.c: Use string.h, not gdb_string.h.
* ser-mingw.c: Use string.h, not gdb_string.h.
* ser-pipe.c: Use string.h, not gdb_string.h.
* ser-tcp.c: Use string.h, not gdb_string.h.
* ser-unix.c: Use string.h, not gdb_string.h.
* serial.c: Use string.h, not gdb_string.h.
* sh-tdep.c: Use string.h, not gdb_string.h.
* sh64-tdep.c: Use string.h, not gdb_string.h.
* shnbsd-tdep.c: Use string.h, not gdb_string.h.
* skip.c: Use string.h, not gdb_string.h.
* sol-thread.c: Use string.h, not gdb_string.h.
* solib-dsbt.c: Use string.h, not gdb_string.h.
* solib-frv.c: Use string.h, not gdb_string.h.
* solib-osf.c: Use string.h, not gdb_string.h.
* solib-spu.c: Use string.h, not gdb_string.h.
* solib-target.c: Use string.h, not gdb_string.h.
* solib.c: Use string.h, not gdb_string.h.
* somread.c: Use string.h, not gdb_string.h.
* source.c: Use string.h, not gdb_string.h.
* sparc-nat.c: Use string.h, not gdb_string.h.
* sparc-sol2-tdep.c: Use string.h, not gdb_string.h.
* sparc-tdep.c: Use string.h, not gdb_string.h.
* sparc64-tdep.c: Use string.h, not gdb_string.h.
* sparc64fbsd-tdep.c: Use string.h, not gdb_string.h.
* sparc64nbsd-tdep.c: Use string.h, not gdb_string.h.
* sparcnbsd-tdep.c: Use string.h, not gdb_string.h.
* spu-linux-nat.c: Use string.h, not gdb_string.h.
* spu-multiarch.c: Use string.h, not gdb_string.h.
* spu-tdep.c: Use string.h, not gdb_string.h.
* stabsread.c: Use string.h, not gdb_string.h.
* stack.c: Use string.h, not gdb_string.h.
* std-regs.c: Use string.h, not gdb_string.h.
* symfile.c: Use string.h, not gdb_string.h.
* symmisc.c: Use string.h, not gdb_string.h.
* symtab.c: Use string.h, not gdb_string.h.
* target.c: Use string.h, not gdb_string.h.
* thread.c: Use string.h, not gdb_string.h.
* tilegx-linux-nat.c: Use string.h, not gdb_string.h.
* tilegx-tdep.c: Use string.h, not gdb_string.h.
* top.c: Use string.h, not gdb_string.h.
* tracepoint.c: Use string.h, not gdb_string.h.
* tui/tui-command.c: Use string.h, not gdb_string.h.
* tui/tui-data.c: Use string.h, not gdb_string.h.
* tui/tui-disasm.c: Use string.h, not gdb_string.h.
* tui/tui-file.c: Use string.h, not gdb_string.h.
* tui/tui-layout.c: Use string.h, not gdb_string.h.
* tui/tui-out.c: Use string.h, not gdb_string.h.
* tui/tui-regs.c: Use string.h, not gdb_string.h.
* tui/tui-source.c: Use string.h, not gdb_string.h.
* tui/tui-stack.c: Use string.h, not gdb_string.h.
* tui/tui-win.c: Use string.h, not gdb_string.h.
* tui/tui-windata.c: Use string.h, not gdb_string.h.
* tui/tui-winsource.c: Use string.h, not gdb_string.h.
* typeprint.c: Use string.h, not gdb_string.h.
* ui-file.c: Use string.h, not gdb_string.h.
* ui-out.c: Use string.h, not gdb_string.h.
* user-regs.c: Use string.h, not gdb_string.h.
* utils.c: Use string.h, not gdb_string.h.
* v850-tdep.c: Use string.h, not gdb_string.h.
* valarith.c: Use string.h, not gdb_string.h.
* valops.c: Use string.h, not gdb_string.h.
* valprint.c: Use string.h, not gdb_string.h.
* value.c: Use string.h, not gdb_string.h.
* varobj.c: Use string.h, not gdb_string.h.
* vax-tdep.c: Use string.h, not gdb_string.h.
* vaxnbsd-tdep.c: Use string.h, not gdb_string.h.
* vaxobsd-tdep.c: Use string.h, not gdb_string.h.
* windows-nat.c: Use string.h, not gdb_string.h.
* xcoffread.c: Use string.h, not gdb_string.h.
* xml-support.c: Use string.h, not gdb_string.h.
* xstormy16-tdep.c: Use string.h, not gdb_string.h.
* xtensa-linux-nat.c: Use string.h, not gdb_string.h.
This moves the demangled_names_hash from the objfile into the per-BFD
object. This is part of the objfile splitting project.
The demangled names hash is independent of the program space. And, it
is needed by the symbol tables. Both of these things indicate that it
must be pushed into the per-BFD object, which this patch does.
Built and regtested on x86-64 Fedora 18.
* objfiles.c (free_objfile_per_bfd_storage): Delete the
demangled_names_hash.
(free_objfile): Don't delete the demangled_names_hash.
* objfiles.h (struct objfile_per_bfd_storage)
<demangled_names_hash>: New field.
(struct objfile) <demangled_names_hash>: Move to
objfile_per_bfd_storage.
* symfile.c (reread_symbols): Don't delete the
demangled_names_hash.
* symtab.c (create_demangled_names_hash): Update.
(symbol_set_names): Update.
This avoids duplicating the logic comparing two symbol_search
objects (in search_symbols_equal and compare_search_syms).
gdb/ChangeLog:
* symtab.c (search_symbols_equal): Delete.
(sort_search_symbols_remove_dups): Replace call to
search_symbols_equal by call to compare_search_syms,
adjusting as necessary.
With "dwz -m", "main" appears in both the PU and the importing CU when
running anon-struct.exp. However, the PU does not have a file name.
So, find_main_filename returns the empty string, making
deduce_language_from_filename return language_unknown.
This patch fixes this problem by changing gdb to use the ordinary
symbol-lookup functions to find "main"'s symbol. Then, it examines the
symbol's language.
I think this is cleaner than the current approach. For one thing it
avoids trying to guess the language based on the source file name,
instead deferring to the presumably more reliable debuginfo.
Another possible fix would have been to change how the file name is
found via the "qf" methods. However, I think the approach given is
preferable for the reason outlined above.
This required a minor test suite change, as now a symtab is expanded
during the search for "main".
Built and regtested (both ways) on x86-64 Fedora 18.
* symfile.c (set_initial_language): Look up "main" symbol
and use its language.
* symtab.c (find_main_filename): Remove.
* symtab.h (find_main_filename): Remove.
* gdb.base/maint.exp: Allow zero symtabs to be expanded.
This is another patch in my ongoing series to "split" objfile to share
more read-only data across inferiors. See
http://sourceware.org/gdb/wiki/ObjfileSplitting
When symbols are finally shared, there will be no back-link from the
symbol to its containing objfile, because there may be more than one
such objfile. So, all such back-links must be removed.
One hidden back-link is the msymbol_objfile function. Since
(eventually) a symbol may appear in more than one objfile, trying to
look up the objfile given just a symbol cannot work.
This patch removes msymbol_objfile in favor of using a bound minimal
symbol. It introduces a new function to make this conversion simpler
in some spots.
The bonus of this patch is that using msymbol_objfile is slower than
simply looking up the owning objfile in the first place.
Built and regtested on x86-64 Fedora 18.
* ada-exp.y (write_var_or_type): Use bound_minimal_symbol.
* ada-lang.c (ada_lookup_simple_minsym): Return
bound_minimal_symbol.
* ada-lang.h (ada_lookup_simple_minsym): Update.
* c-exp.y (variable): Use lookup_bound_minimal_symbol.
* f-exp.y (variable): Use lookup_bound_minimal_symbol.
* go-exp.y (variable): Use lookup_bound_minimal_symbol.
* jv-exp.y (push_expression_name): Use lookup_bound_minimal_symbol.
* m2-exp.y (variable): Use lookup_bound_minimal_symbol.
* minsyms.c (msymbol_objfile): Remove.
(lookup_minimal_symbol_internal): New function, from
lookup_minimal_symbol.
(lookup_minimal_symbol): Rewrite using
lookup_minimal_symbol_internal.
(lookup_bound_minimal_symbol): New function.
* minsyms.h (msymbol_objfile): Remove.
(lookup_bound_minimal_symbol): Declare.
* p-exp.y (variable): Use lookup_bound_minimal_symbol.
* parse.c (write_exp_msymbol): Change parameter to a
bound_minimal_symbol.
(write_dollar_variable): Use lookup_bound_minimal_symbol.
* parser-defs.h (write_exp_msymbol): Update.
* printcmd.c (address_info): Use lookup_bound_minimal_symbol.
* symfile.c (simple_read_overlay_table): Use
lookup_bound_minimal_symbol.
* symtab.c (skip_prologue_sal): Don't use msymbol_objfile.
(search_symbols): Likewise.
(print_msymbol_info): Take a bound_minimal_symbol argument.
(symtab_symbol_info, rbreak_command): Update.
* symtab.h (struct symbol_search) <msymbol>: Change type
to bound_minimal_symbol.
* valops.c (find_function_in_inferior): Use
lookup_bound_minimal_symbol.
* value.c (value_fn_field): Use lookup_bound_minimal_symbol.
effectively, struct symbol_search **.
(make_cleanup_free_search_symbols): Change arg to struct
symbol_search **. All callers updated.
(compare_search_syms): Compare symtab file name and block as well.
(search_symbols_equal): New function.
(sort_search_symbols_remove_dups): Renamed from sort_search_symbols.
New args new_head, new_tail. Result is now void. Remove dups after
sorting the symbols.
(search_symbols): Sort all found symbols once, after all have been
found, and remove duplicates. Simplify cleanup tracking of result.
* symtab.h (make_cleanup_free_search_symbols): Update prototype.
search_symbols had some bad code resulting in a cleanup being both
discarded and run.
* symtab.c (search_symbols): Introduce a null cleanup for
'retval_chain'.
* c-lang.c (cplus_language_defn): Use gdb_demangle.
* c-typeprint.c (c_type_print_base): Use gdb_demangle.
* cp-support.c (mangled_name_to_comp): Use gdb_demangle.
(gdb_demangle): New function.
* cp-support.h (gdb_demangle): Declare.
* dwarf2read.c (dwarf2_physname, fixup_partial_die)
(dwarf2_name): Use gdb_demangle.
* gdbtypes.c (check_stub_method): Use gdb_demangle.
* gnu-v3-abi.c (gnuv3_rtti_type): Strip @plt and version
suffixes from name.
(gnuv3_print_method_ptr): Use gdb_demangle.
* jv-lang.c (java_demangle): Use gdb_demangle.
* jv-typeprint.c (java_type_print_base): Use gdb_demangle.
* language.c (unk_lang_demangle): Use gdb_demangle.
* symtab.c (symbol_find_demangled_name)
(demangle_for_lookup): Use gdb_demangle.
* dwarf2read.c (dw2_map_symtabs_matching_filename): Put continue after
any successful compare_filenames_for_search or FILENAME_CMP.
* psymtab.c (partial_map_symtabs_matching_filename): Likewise.
* symtab.c (iterate_over_some_symtabs): Likewise.
This is sort of a continuation of Keith's parse_exp_1 constification
patch. It started out by undoing these bits:
@@ -754,9 +754,12 @@ validate_actionline (char **line, struct
tmp_p = p;
for (loc = t->base.loc; loc; loc = loc->next)
{
- p = tmp_p;
- exp = parse_exp_1 (&p, loc->address,
+ const char *q;
+
+ q = tmp_p;
+ exp = parse_exp_1 (&q, loc->address,
block_for_pc (loc->address), 1);
+ p = (char *) q;
and progressively making more things const upwards, fixing fallout,
rinse repeat, until GDB built again (--enable-targets=all).
That ended up constifying lookup_cmd/add_cmd and (lots of) friends,
and the completers.
I didn't try to constify the command hooks themselves, because I know
upfront there are commands that write to the command string argument,
and I think I managed to stop at a nice non-hacky split point already.
I think the only non-really-super-obvious changes are
tracepoint.c:validate_actionline, and tracepoint.c:trace_dump_actions.
The rest is just mostly about 'char *' => 'const char *', 'char **'=>
'const char **', and the occasional (e.g., deprecated_cmd_warning)
case of 'char **'=> 'const char *', where/when I noticed that nothing
actually cares about the pointer to pointer output.
Tested on x86_64 Fedora 17, native and gdbserver.
gdb/
2013-03-13 Pedro Alves <palves@redhat.com>
* ada-lang.c (struct add_partial_datum) <text, text0, word>: Make
fields const.
(ada_make_symbol_completion_list): Make "text0" parameter const.
* ax-gdb.c (agent_eval_command_one): Make "exp" parameter const.
* breakpoint.c (condition_completer): Make "text" and "word"
parameters const. Adjust.
(check_tracepoint_command): Adjust to validate_actionline
prototype change.
(catch_syscall_completer): Make "text" and "word" parameters
const.
* cli/cli-cmds.c (show_user): Make "comname" local const.
(valid_command_p): Make "command" parameter const.
(alias_command): Make "alias_prefix" and "command_prefix" locals
const.
* cli/cli-decode.c (add_cmd): Make "name" parameter const.
(add_alias_cmd): Make "name" and "oldname" parameters const.
Adjust. No longer make copy of OLDNAME.
(add_prefix_cmd, add_abbrev_prefix_cmd, add_set_or_show_cmd)
(add_setshow_cmd_full, add_setshow_enum_cmd)
(add_setshow_auto_boolean_cmd, add_setshow_boolean_cmd)
(add_setshow_filename_cmd, add_setshow_string_cmd)
(add_setshow_string_noescape_cmd)
(add_setshow_optional_filename_cmd, add_setshow_integer_cmd)
(add_setshow_uinteger_cmd, add_setshow_zinteger_cmd)
(add_setshow_zuinteger_unlimited_cmd, add_setshow_zuinteger_cmd)
(delete_cmd, add_info, add_info_alias, add_com, add_com_alias):
Make "name" parameter const.
(help_cmd): Rename "command" parameter to "arg". New const local
"command".
(find_cmd): Make "command" parameter const.
(lookup_cmd_1): Make "text" parameter pointer to const. Adjust to
deprecated_cmd_warning prototype change.
(undef_cmd_error): Make "cmdtype" parameter const.
(lookup_cmd): Make "line" parameter const.
(deprecated_cmd_warning): Change type of "text" parameter to
pointer to const char, from pointer to pointer to char. Adjust.
(lookup_cmd_composition): Make "text" parameter const.
(complete_on_cmdlist, complete_on_enum): Make "text" and "word"
parameters const.
* cli/cli-decode.h (struct cmd_list_element) <name>: Make field
const.
* cli/cli-script.c (validate_comname): Make "tem" local const.
(define_command): New const local "tem_c". Use it in calls to
lookup_cmd.
(document_command): Make "tem" and "comfull" locals const.
(show_user_1): Make "prefix" and "name" parameters const.
* cli-script.h (show_user_1): Make "prefix" and "name" parameters
const.
* command.h (add_cmd, add_alias_cmd, add_prefix_cmd)
(add_abbrev_prefix_cmd, completer_ftype, lookup_cmd, lookup_cmd_1)
(deprecated_cmd_warning, lookup_cmd_composition, add_com)
(add_com_alias, add_info, add_info_alias, complete_on_cmdlist)
(complete_on_enum, add_setshow_enum_cmd)
(add_setshow_auto_boolean_cmd, add_setshow_boolean_cmd)
(add_setshow_filename_cmd, add_setshow_string_cmd)
(add_setshow_string_noescape_cmd)
(add_setshow_optional_filename_cmd, add_setshow_integer_cmd)
(add_setshow_uinteger_cmd, add_setshow_zinteger_cmd)
(add_setshow_zuinteger_cmd, add_setshow_zuinteger_unlimited_cmd):
Change prototypes, constifying strings.
* completer.c (noop_completer, filename_completer): Make "text"
and "prefix" parameters const.
(location_completer, expression_completer)
(complete_line_internal): Make "text" and "prefix" parameters
const and adjust.
(command_completer, signal_completer): Make "text" and "prefix"
parameters const.
* completer.h (noop_completer, filename_completer)
(expression_completer, location_completer, command_completer)
(signal_completer): Change prototypes.
* corefile.c (complete_set_gnutarget): Make "text" and "word"
parameters const.
* cp-abi.c (cp_abi_completer): Likewise.
* expression.h (parse_expression_for_completion): Change
prototype.
* f-lang.c (f_make_symbol_completion_list): Make "text" and "word"
parameters const.
* infcmd.c (_initialize_infcmd): Make "cmd_name" local const.
* infrun.c (handle_completer): Make "text" and "word" parameters
const.
* interps.c (interpreter_completer): Make "text" and "word"
parameters const.
* language.h (struct language_defn)
<la_make_symbol_completion_list>: Make "text" and "word"
parameters const.
* parse.c (parse_exp_1): Move const hack to parse_exp_in_context.
(parse_exp_in_context): Rename to ...
(parse_exp_in_context_1): ... this.
(parse_exp_in_context): Reimplement, with const hack from
parse_exp_1.
(parse_expression_for_completion): Make "string" parameter const.
* printcmd.c (decode_format): Make "string_ptr" parameter pointer
to pointer to const char. Adjust.
(print_command_1): Make "exp" parameter const.
(output_command): Rename to ...
(output_command_const): ... this. Make "exp" parameter const.
(output_command): Reimplement.
(x_command): Adjust.
(display_command): Rename "exp" parameter to "arg". New "exp"
local, const version of "arg".
* python/py-auto-load.c (gdbpy_initialize_auto_load): Make
"cmd_name" local const.
* python/py-cmd.c (cmdpy_destroyer): Cast const away in xfree
call.
(cmdpy_completer): Make "text" and "word" parameters const.
(gdbpy_parse_command_name): Make "prefix_text2" local const.
* python/py-param.c (add_setshow_generic): Make "tmp_name" local
const.
* remote.c (_initialize_remote): Make "cmd_name" local const.
* symtab.c (language_search_unquoted_string): Make "text" and "p"
parameters const. Adjust.
(completion_list_add_fields): Make "sym_text", "text" and "word"
parameters const.
(struct add_name_data) <sym_text, text, word>: Make fields const.
(default_make_symbol_completion_list_break_on): Make "text" and
"word" parameters const. Adjust locals.
(default_make_symbol_completion_list)
(make_symbol_completion_list, make_symbol_completion_type)
(make_symbol_completion_list_fn): Make "text" and "word"
parameters const.
(make_file_symbol_completion_list): Make "text", "word" and
"srcfile" parameters const. Adjust locals.
(add_filename_to_list): Make "text" and "word" parameters const.
(struct add_partial_filename_data) <text, word>: Make fields
const.
(make_source_files_completion_list): Make "text" and "word"
parameters const.
* symtab.h (default_make_symbol_completion_list_break_on)
(default_make_symbol_completion_list, make_symbol_completion_list)
(make_symbol_completion_type enum type_code)
(make_symbol_completion_list_fn make_file_symbol_completion_list)
(make_source_files_completion_list): Change prototype.
* top.c (execute_command): Adjust to pass pointer to pointer to
const char to lookup_cmd, and to deprecated_cmd_warning prototype
change.
(set_verbose): Make "cmdname" local const.
* tracepoint.c (decode_agent_options): Make "exp" parameter const,
and adjust.
(validate_actionline): Make "line" parameter a pointer to const
char, and adjust.
(encode_actions_1): Make "action_exp" local const, and adjust.
(encode_actions): Adjust.
(replace_comma): Delete.
(trace_dump_actions): Make "action_exp" and "next_comma" locals
const, and adjust. Don't frob the action string while splitting
it at commas. Instead, make a copy of each split substring in
turn.
(trace_dump_command): Adjust to validate_actionline prototype
change.
* tracepoint.h (decode_agent_options, decode_agent_options)
(encode_actions, validate_actionline): Change prototypes.
* valprint.h (output_command): Delete declaration.
(output_command_const): Declare.
* value.c (function_destroyer): Cast const away in xfree call.
(trace_pass_command): Likewise.
* cli/cli-cmds.c: Include cli/cli-utils.h.
(source_command): Use skip-spaces.
(disassemble_command): Likewise.
* findcmd.c: Include cli/cli-utils.h.
(parse_find_args): Use skip_spaces.
* go32-nat.c: Include cli/cli-utils.h.
(go32_sldt): Use skip_spaces.
(go32_sgdt): Likewise.
(go32_sidt): Likewise.
(go32_pde): Likewise.
(go32_pte): Likewise.
(go32_pte_for_address): Likewise.
* infcmd.c: Include cli/cli-utils.h.
(registers_info): Use skip_spaces.
* linux-tdep.c (read_mapping): Use skip_spaces_const.
(linux_info_proc): Likewise.
* linux-thread-db.c: Include cli/cli-utils.h.
(info_auto_load_libthread_db): Use skip_spaces_const.
* m32r-rom.c: Include cli/cli-utils.h.
(m32r_upload_command): Use skip_spaces.
* maint.c: Include cli/cli-utils.h.
(maintenance_translate_address): Use skip_spaces.
* mi/mi-parse.c: Include cli/cli-utils.h.
(mi_parse_argv): Use skip_spaces.
(mi_parse): Likewise.
* minsyms.c: Include cli/cli-utils.h.
(msymbol_hash_iw): Use skip_spaces_const.
* objc-lang.c: Include cli/cli-utils.h.
(parse_selector): Use skip_spaces.
(parse_method): Likewise.
* python/python.c: Include cli/cli-utils.h.
(python_interactive_command)[HAVE_PYTHON]: Use skip_spaces.
(python_command)[HAVE_PYTHON]: Likewise.
(python_interactive_command)[!HAVE_PYTHON]: Likewise.
* remote-m32r-sdi.c: Include cli/cli-utils.h.
(m32r_load): Use skip_spaces.
* serial.c: Include cli/cli-utils.h.
(serial_open): Use skip_spaces_const.
* stack.c: Include cli/cli-utils.h.
(parse_frame_specification_1): Use skip_spaces_const.
* symfile.c: Include cli/cli-utils.h.
(set_ext_lang_command): Use skip_spaces.
* symtab.c: Include cli/cli-utils.h.
(rbreak_command): Use skip_spaces.
* thread.c (thread_name_command): Use skip_spaces.
* tracepoint.c (validate_actionline): Use skip_spaces.
(encode_actions_1): Likewise.
(trace_find_range_command): Likewise.
(trace_find_outside_command): Likewise.
(trace_dump_actions): Likewise.
* dwarf2read.c (dw2_expand_symtabs_matching): Add basenames parameter
to the file_matcher parameter. Pass 0 to it.
(dwarf2_create_include_psymtab): Copy also DIRNAME.
* psymtab.c (partial_map_symtabs_matching_filename): Drop handling of
NULL psymtab_to_fullname result.
(psymtab_to_fullname): Remove variable r. Never return NULL, assemble
an expected filename instead.
(expand_symtabs_matching_via_partial): Add basenames parameter to the
file_matcher parameter. Call also psymtab_to_fullname, after newly
considering BASENAMES_MAY_DIFFER.
* source.c (rewrite_source_path): Remove static.
* source.h (rewrite_source_path): New declaration.
* symfile.h (struct quick_symbol_functions): Add basenames parameter to
the expand_symtabs_matching field. Comment it.
* symtab.c (file_matches): New function comment. Add parameter
basenames, implement it.
(search_symbols_file_matches): Add basenames parameter. Update the
file_matches caller.
(search_symbols): Match FILES also against symtab_to_fullname.
Optimize it for BASENAMES_MAY_DIFFER.
gdb/testsuite/
* gdb.base/fullpath-expand-func.c: New file.
* gdb.base/fullpath-expand.c: New file.
* gdb.base/fullpath-expand.exp: New file.
* gdb.base/realname-expand-real.c: New file.
* gdb.base/realname-expand.c: New file.
* gdb.base/realname-expand.exp: New file.
* ada-lang.c (user_select_syms): Replace symtab->filename refererences
by symtab_to_filename_for_display calls.
* breakpoint.c (print_breakpoint_location, resolve_sal_pc): Likewise.
(clear_command): New variable sal_fullname, initialize it. Replace
compare_filenames_for_search by filename_cmp with sal_fullname.
(say_where, update_static_tracepoint): Replace symtab->filename
refererences by symtab_to_filename_for_display calls.
* cli/cli-cmds.c (edit_command, list_command, ambiguous_line_spec):
Likewise.
* dwarf2read.c: Include source.h.
(fixup_go_packaging): Replace symtab->filename refererences by
symtab_to_filename_for_display calls.
* linespec.c (add_sal_to_sals): Rename variable filename to fullname.
Replace symtab->filename refererences by symtab_to_filename_for_display
calls.
(create_sals_line_offset, convert_linespec_to_sals): New variable
fullname, initialize it, replace symtab->filename reference by the
variable.
* linux-fork.c: Include source.h.
(info_checkpoints_command): Replace symtab->filename refererences by
symtab_to_filename_for_display calls.
* macroscope.c (sal_macro_scope): Replace symtab->filename refererences
by symtab_to_filename_for_display calls.
* mdebugread.c: Include source.h.
(psymtab_to_symtab_1): Replace symtab->filename refererences by
symtab_to_filename_for_display calls.
* mi/mi-cmd-file.c (mi_cmd_file_list_exec_source_file)
(mi_cmd_file_list_exec_source_files): Likewise.
* printcmd.c: Include source.h.
(build_address_symbolic): Replace symtab->filename refererences by
symtab_to_filename_for_display calls.
* psymtab.c (partial_map_symtabs_matching_filename)
(read_psymtabs_with_fullname): Call compare_filenames_for_search also
with psymtab_to_fullname.
* python/py-symtab.c (stpy_str): Replace symtab->filename refererences
by symtab_to_filename_for_display calls.
(stpy_get_filename): New variable filename, initialize it, use instead
of symtab->filename refererences.
(salpy_str): Make variable filename const char *. Replace
symtab->filename refererences by symtab_to_filename_for_display calls.
* skip.c: Include source.h and filenames.h.
(skip_file_command): Remove const from the symtab variable. Replace
symtab->filename refererences by symtab_to_fullname call.
(function_name_is_marked_for_skip): New variables searched_for_fullname
and fullname. Use them to search also with symtab's fullname.
* source.c (find_source_lines): Replace symtab->filename refererences
by symtab_to_filename_for_display calls.
(print_source_lines_base): New variable filename, use it instead of
symtab->filename. Replace symtab->filename refererences by
symtab_to_filename_for_display calls.
(line_info, forward_search_command): Replace symtab->filename
refererences by symtab_to_filename_for_display calls.
(reverse_search_command): Replace symtab->filename refererences by
symtab_to_filename_for_display calls. New variable filename for it.
* stack.c (frame_info): Likewise.
* symmisc.c: Include source.h.
(dump_objfile, dump_symtab_1, maintenance_print_symbols)
(maintenance_info_symtabs): Replace symtab->filename refererences by
symtab_to_filename_for_display calls.
* symtab.c (iterate_over_some_symtabs): Call
compare_filenames_for_search also with symtab_to_fullname.
(lookup_symbol_aux_quick, basic_lookup_transparent_type_quick): Replace
symtab->filename refererences by symtab_to_filename_for_display calls.
(find_line_symtab): Replace symtab->filename refererences by
symtab_to_filename_for_display calls.
(file_matches): Replace filename_cmp by compare_filenames_for_search.
(print_symbol_info): Make the last parameter const char *. New
variable s_filename. Use it in the function.
(symtab_symbol_info): Make the last_filename variable const char *.
Replace symtab->filename refererences by symtab_to_filename_for_display
calls.
(rbreak_command): New variable fullname. Use it. Replace
symtab->filename refererence by symtab_to_filename_for_display call.
* tracepoint.c (set_traceframe_context, trace_find_line_command)
(print_one_static_tracepoint_marker): Replace symtab->filename
refererences by symtab_to_filename_for_display calls.
* tui/tui-source.c (tui_set_source_content): New variables filename and
s_filename. Replace symtab->filename refererences by this variable.
Replace other symtab->filename refererences by
symtab_to_filename_for_display calls.
Code cleanup.
* dwarf2read.c (dw2_expand_symtabs_with_filename): Rename to ...
(dw2_expand_symtabs_with_fullname): ... here. Rename parameter
filename to fullname. Rename variable this_name to this_fullname.
Lowercase FILENAME_CMP call.
(dw2_find_symbol_file): New comment for the returned string.
(dwarf2_gdb_index_functions): Rename the function to
dw2_expand_symtabs_with_fullname.
* psymtab.c (read_psymtabs_with_filename): Rename to ...
(read_psymtabs_with_fullname): ... here. Rename parameter filename to
fullname.
(psym_functions): Rename the function to read_psymtabs_with_fullname.
* symfile.h (struct quick_symbol_functions): Rename field
expand_symtabs_with_filename to expand_symtabs_with_fullname and its
parameter filename to fullname. Document returned string meaning for
find_symbol_file.
* symtab.c (find_line_symtab): Rename the called function to
expand_symtabs_with_fullname.
Code cleanup.
* breakpoint.c (clear_command): Remove variable is_abs, unify the
call of filename_cmp with compare_filenames_for_search.
* dwarf2read.c (dw2_map_symtabs_matching_filename): Remove variable
is_abs, unify the call of FILENAME_CMP with
compare_filenames_for_search. New gdb_asserts for real_path and name.
Unify the call of compare_filenames_for_search with FILENAME_CMP.
* psymtab.c (partial_map_symtabs_matching_filename): Likewise.
* symfile.h (struct quick_symbol_functions): Extend the comment for
map_symtabs_matching_filename.
* symtab.c (compare_filenames_for_search): Remove the function comment
relative path requirement. Handle absolute filenames, with a comment.
(iterate_over_some_symtabs): Remove variable is_abs, unify the call of
FILENAME_CMP with compare_filenames_for_search. New gdb_asserts for
real_path and name. Unify the call of compare_filenames_for_search
with FILENAME_CMP.
(iterate_over_symtabs): New gdb_assert on REAL_PATH.
gdb/testsuite/
* gdb.mi/mi-fullname-deleted.exp: Use double last slash for $srcfileabs.
(compare_filenames_for_search does not match)
(compare_filenames_for_search does match): New tests.
Replace xfullpath calls by gdb_realpath calls.
* cli/cli-cmds.c (find_and_open_script): Remove xfullpath from the
function comment.
* dwarf2read.c (dw2_map_expand_apply): Remove parameter full_path.
Remove it from the iterate_over_some_symtabs call.
(dw2_map_symtabs_matching_filename): Remove parameter full_path.
Remove it from the dw2_map_expand_apply calls, remove a block handling
it.
* psymtab.c (partial_map_expand_apply): Remove parameter full_path.
Remove it from the iterate_over_some_symtabs call.
(partial_map_symtabs_matching_filename): Remove parameter full_path.
Remove it from the partial_map_expand_apply calls, remove a block
handling it. Drop gdb_realpath call and cleanups from the real_path
handling.
* source.c (openp): Drop the comment part about xfullpath. Replace
xfullpath calls by gdb_realpath calls.
(find_and_open_source): Replace xfullpath call by gdb_realpath call.
* symfile.h (struct quick_symbol_functions): Remove parameter full_path
from method map_symtabs_matching_filename and its comment.
* symmisc.c (maintenance_print_msymbols): Replace xfullpath call by
gdb_realpath call.
* symtab.c (iterate_over_some_symtabs): Remove parameter full_path,
remove it also from the function comment, remove a block handling it.
Drop gdb_realpath call and cleanups from the real_path handling.
(iterate_over_symtabs): Drop variable full_path and its use.
* symtab.h (iterate_over_some_symtabs): Remove parameter full_path.
* utils.c (xfullpath): Remove.
* utils.h (xfullpath): Remove.
gdb/testsuite/
* gdb.gdb/xfullpath.exp: Replace xfullpath calls by gdb_realpath calls.
* symtab.c (skip_prologue_using_sal): Consider a file
change the same as an increased line number
gdb/testsuite/
* gdb.base/prologue-include.c: New file.
* gdb.base/prologue-include.exp: New file.
* gdb.base/prologue-include.h: New file.
* symtab.c (compare_filenames_for_search): New comment for
HAS_DRIVE_SPEC.
gdb/testsuite/
* gdb.dwarf2/dw2-dos-drive.S: New file.
* gdb.dwarf2/dw2-dos-drive.exp: New file.
Two modifications:
1. The addition of 2013 to the copyright year range for every file;
2. The use of a single year range, instead of potentially multiple
year ranges, as approved by the FSF.
Code cleanup.
* breakpoint.c (clear_command): Remove variable sal_name_len and its
initialization, remove it from the compare_filenames_for_search call.
* dwarf2read.c (dw2_map_symtabs_matching_filename): Remove variable
name_len and its initialization, remove it from the
compare_filenames_for_search calls.
* psymtab.c (partial_map_symtabs_matching_filename): Likewise.
* symtab.c (compare_filenames_for_search): Remove the search_len
parameter, update the function comment, new variable search_len
initialized from SEARCH_NAME.
(iterate_over_some_symtabs): Remove variable name_len and its
initialization, remove it from the compare_filenames_for_search calls.
* symtab.h (compare_filenames_for_search): Remove the search_len
parameter,
* symtab.c (lookup_symbol_aux): If constructor is found, consider
returning the type instead.
* c-exp.y (classify_name): Check STRUCT_DOMAIN if a constructor is
found.
testsuite
* gdb.cp/member-name.exp: New file.
* gdb.cp/member-name.cc: New file.