Commit Graph

27256 Commits

Author SHA1 Message Date
Jan Kratochvil d8b34041e0 gdb/testsuite/
* gdb.base/break-interp.exp: Use ldlags for linking flags.
	* gdb.base/prelink.exp: Likewise.
	* gdb.base/solib-nodir.exp: Likewise.
	* lib/gdb.exp (gdb_compile) <*-*-openbsd*>
	(gdb_compile) <shlib_load>: Use ldlags for linking flags.
	* lib/prelink-support.exp (build_executable_own_libs): Likewise.
2010-10-12 18:12:49 +00:00
Ulrich Weigand e0cc584ecf * break-interp.exp (test_ld): Use two separate gdb_expect statements
for the "info files" test to avoid timeouts on slow machines.
2010-10-12 17:17:36 +00:00
Pierre Muller c1b5be3809 * ser-go32.c (struct dos_ops): Add missing fdopen field. 2010-10-12 15:40:03 +00:00
Matthew Gretton-Dann 6877026586 * gdb/arm-tdep.c (arm_mode_strings): Add NULL entry at end of array. 2010-10-12 08:46:15 +00:00
gdbadmin 60536292df *** empty log message *** 2010-10-12 00:00:02 +00:00
Jan Kratochvil cfc353b10d gdb/testsuite/
* gdb.cp/infcall-dlopen.cc (openlib): Support NULL FILENAME.
	(main): Make openlib dummy call.
2010-10-11 21:36:26 +00:00
Doug Evans 64b0002014 * c-typeprint.c (c_type_print_modifier): Add note that this prints
the address space id too.
2010-10-11 19:24:52 +00:00
Doug Evans 44592cc4ef * gdb.texinfo (Values From Inferior): Add reference to "Types in
Python" from gdb.Value.type description.
2010-10-11 15:46:09 +00:00
Jan Kratochvil 43b8e24199 gdb/
Fix attaching to re-prelinked executables on ppc64.
	* solib-svr4.c (svr4_exec_displacement): New variable plt2_asect,
	initialize it, try to adjust FILESZ field by it.
2010-10-11 08:50:33 +00:00
Jan Kratochvil d3d7896de3 gdb/testsuite/
Fix missing _start PIE relocation on ppc64 due to stop on dl_main.
	* break-interp.exp (reach): Move the core body ...
	(reach_1): ... here.  Use stop-on-solib-events for _dl_debug_state.
	(test_ld): Provide always real argument, even to the linker.  Replace
	dl_main by _dl_debug_state.
2010-10-11 08:47:47 +00:00
Jan Kratochvil 5e533c94a6 gdb/testsuite/
Fix results of prelinked PIEs on ppc*.
	* gdb.base/break-interp.exp (reach, test_core, test_attach_gdb):
	Accept also DISPLACEMENT "PRESENT".
	(main): Replace "ZERO" displacements by "PRESENT".
2010-10-11 08:45:12 +00:00
gdbadmin b44435fc67 *** empty log message *** 2010-10-11 00:00:33 +00:00
gdbadmin 8c2c26d54a *** empty log message *** 2010-10-10 00:00:33 +00:00
gdbadmin a76f98451d *** empty log message *** 2010-10-09 00:00:32 +00:00
Daniel Jacobowitz 417b511093 * tracepoint.c (merge_uploaded_trace_state_variables): Only print
messages if info_verbose.
2010-10-08 20:45:21 +00:00
Sami Wagiaalla 3354061073 Test case for unimplemented overload cases.
2010-10-08  Sami Wagiaalla  <swagiaal@redhat.com>

	* gdb.cp/oranking.exp: New test.
	* gdb.cp/oranking.cc: New test program.
2010-10-08 18:28:46 +00:00
Ken Werner 3bdf2bbd3e gdb:
* valops.c (value_cast): Handle vector types.
	* valarith.c (value_binop): Widen scalar to vector if appropriate.
gdb/testsuite:
	* gdb.base/gnu_vector.c (ia, ib, fa, fb): New variables.
	* gdb.base/gnu_vector.exp: Add tests for scalar to vector widening.
2010-10-08 16:50:55 +00:00
Ulrich Weigand ec3d575a7a * arm-tdep.c (thumb_expand_immediate): New function.
(thumb_instruction_changes_pc): Likewise.
	(thumb2_instruction_changes_pc): Likewise.
	(thumb_analyze_prologue): Handle 32-bit Thumb instructions during
	prologue parsing.  Improved support for optimized code.
	(thumb_scan_prologue): Do not reply on line-number information,
	use same heuristics as arm_scan_prologue insead.
	(skip_prologue_function): Accept functions
	"__tls_get_addr" and "__aeabi_read_tp".
2010-10-08 13:31:07 +00:00
Ulrich Weigand 4024ca9964 2010-10-08 Ulrich Weigand <uweigand@de.ibm.com>
Daniel Jacobowitz  <dan@codesourcery.com>

	* arm-tdep.c (thumb_in_function_epilogue_p)
	(arm_in_function_epilogue_p): New.
	(arm_gdbarch_init): Install arm_in_function_epilogue_p as
	gdbarch_in_function_epilogue_p callback.
2010-10-08 13:24:55 +00:00
gdbadmin 682ffa1ca8 *** empty log message *** 2010-10-08 00:00:32 +00:00
Doug Evans 00e14314cf * cc-with-index.sh (output_file): Default to a.out. 2010-10-07 19:34:52 +00:00
Doug Evans 3876f04ec9 * dwarf2read.c (mapped_index): Rename member index_table to
symbol_table and index_table_slots to symbol_table_slots.
	All uses updated.
	(create_symbol_hash_table): Renamed from create_index_table.
	All callers updated.
	(add_indices_to_cpool): Rename arg index_table to symbol_hash_table.
	(write_hash_table): Rename local index_table to symbol_hash_table.
2010-10-07 17:23:30 +00:00
Doug Evans 855c153ff2 * addrmap.h (addrmap_foreach_fn): New typedef.
(addrmap_foreach): Declare.
	* addrmap.c (struct addrmap_funcs): New member foreach.
	(addrmap_foreach): New function.
	(addrmap_fixed_foreach): New function.
	(addrmap_fixed_funcs): Update.
	(struct mutable_foreach_data): New struct.
	(addrmap_mutable_foreach_worker): New function.
	(addrmap_mutable_foreach): New function.
	(addrmap_mutable_funcs): Update.
2010-10-07 17:02:14 +00:00
Paul N. Hilfinger 1d2a4540a5 Correct dict_hash to our most recent version.
Several changes to dict_hash from Adacore's local version were inadvertantly
left out of the last change to that function.  These changes conservatively
cause dict_hash to revert to msymbol_hash_iw in more cases where the symbol
being hashed is known not to be Ada-encoded.  This avoids a few cases where
the function hashes large groups of names with similar prefixes to the same
value.

Changelog:

	gdb/
	* dictionary.c (dict_hash): Revert to msymbol_hash_iw in
	more cases.
2010-10-07 08:32:41 +00:00
Paul N. Hilfinger 40658b9446 Rework symbol searches to move Ada-specific stuff to ada-lang.c.
This is a clean-up of some of our symbol-lookup machinery to pull some
kludgy Ada-specific definitions out of psymtab.c.  In place of
map_ada_symtabs and ada_lookup_partial_symbol, we have a method
map_matching_symbols, which searches through all symbol tables and
partial symbol tables looking for a symbol that matches according to
a matching function that is passed as a parameter. This requires some
care, because partial symbol tables speed up searches by binary search,
while full symbol tables use hashing. To call map_matching_symbols, therefore,
you may need to supply both a matching function that is compatible with the
dictionary hash function and an ordering relation that is compatible with
strcmp_iw, which is used to order partial symbol tables.

Having added this general routine to psymtab.c, we use it in ada-lang.c
to rework add_non_local_symbols (now renamed add_nonlocal_symbols).

Changelog:

    gdb/

    * ada-lang.c (full_match): Declare.
    (ada_match_name): Rename to match_name (we should avoid prefixing static
    symbols with "ada_").
    (match_name): New name for ada_match_name.
    (struct ada_psym_data): Remove and replace with...
    (struct match_data): User data for map_matching_symbols.
    (ada_add_psyms): Remove.
    (aux_add_nonlocal_symbols): New function, used as callback for
    map_matching_symbols.
    (compare_names): Ordering function adopted from strcmp_iw for Ada-encoded
    symbols.
    (ada_add_non_local_symbols): Rename to add_nonlocal_symbols.
    (add_nonlocal_symbols): Renamed from ada_add_non_local_symbols.
    Rework to use map_matching_symbols instead of map_ada_symtabs.
    (ada_lookup_symbol_list): Use add_nonlocal_symbols.
    * psymtab.c: Include dependency on dictionary.h.
    (match_partial_symbol): New function.
    (ada_lookup_partial_symbol): Remove.
    (map_block): New function, auxiliary to map_matching_symbols_psymtab.
    (map_matching_symbols_psymtab): New function.
    (psym_functions): Replace map_ada_symtabs with map_matching_symbols_psymtab.
    * symfile.h: Replace map_ada_symtabs definition with map_matching_symbols.
2010-10-07 07:13:51 +00:00
Paul N. Hilfinger c4d840bdd6 Extend hashed symbol dictionaries to work with Ada
This patch allows Ada to speed up symbol lookup by using the facilities
in dictionary.[ch] for hashed lookups.  First, we generalize dictionary
search to allow clients to specify any matching function compatible with
the hashing function. Next, we modify the hashing algorithm so that symbols
that wild-match a name hash to the same value.  Finally, we modify Ada
symbol lookup to use these facilities.

Because this patch touches on a hashing algorithm used by other
languages, I took the precaution of doing a speed test on a list of
about 12000 identifiers (repeatedly inserting all of them into a table
and then doing a lookup on a million names at random, thus testing the
speed of the hashing algorithm and how well it distributed names).
There was actually a slight speedup, probably as a result of open-
coding some of the tests in msymbol_hash_iw.  By design, the revised
hashing algorithm produces the same results as the original on most
"normal" C identifiers.

We considered augmenting the dictionary interface still further by allowing
different hashing algorithms for different dictionaries, based on the
(supposed) language of the symbols in that dictionary.  While this produced
better isolation of the changes to Ada programs, the additional flexibility
also complicated the dictionary interface.  I'd prefer to keep things
simple for now.

Tested w/o regressions on Linux i686.

ChangeLog:

	gdb/
	* ada-lang.c (ada_match_name): Use new API for wild_match.
	(wild_match): Change API to be consistent with that of strcmp_iw;
	return 0 for a match, and switch operand order.
	(full_match): New function.
	(ada_add_block_symbols): Use dict_iter_match_{first,next} for
	matching to allow use of hashing.
	* dictionary.c (struct dict_vector): Generalize iter_name_first,
	iter_name_next ot iter_match_first, iter_match_next.
	(iter_name_first_hashed): Replace with iter_match_first_hashed.
	(iter_name_next_hashed): Replace with iter_match_next_hashed.
	(iter_name_first_linear): Replace with iter_match_first_linear.
	(iter_name_next_linear): Replace with iter_match_next_linear.
	(dict_iter_name_first): Re-implement to use dict_iter_match_first.
	(dict_iter_name_next): Re-implement to use dict_iter_match_next.
	(dict_iter_match_first): New function.
	(dict_iter_match_next): New function.
	(dict_hash): New function.
	* dictionary.h (dict_iter_match_first, dict_iter_match_next): Declare.
	* psymtab.c (ada_lookup_partial_symbol): Use new wild_match API.
2010-10-07 06:53:44 +00:00
Doug Evans 543ecec77c * data-directory/Makefile.in: Remove @host_makefile_frag@, @frags@. 2010-10-07 00:18:22 +00:00
gdbadmin 717d4e8dba *** empty log message *** 2010-10-07 00:00:02 +00:00
Doug Evans 9c9606fba2 * Makefile.in (REQUIRED_SUBDIRS): New var.
(subdir_do): Verify required subdir Makefiles exist.
2010-10-06 16:46:12 +00:00
Ken Werner 2f608a3a97 gdb:
* dwarf2read.c (read_tag_const_type): Handle const arrays.
gdb/testsuite:
	* gdb.base/constvars.c (logical, lugged, luck, lunar, lumen, lurk,
	lush, lynx) New constant.
	* gdb.base/constvars.exp: Test const array types.
	* gdb.dwarf2/dw2-strp.exp: Add const qualifier for ptype tests.
2010-10-06 16:13:35 +00:00
Doug Evans aa2e2d8d77 Create subdir data-directory.
* Makefile.in (XML_SYSCALL_DIR, XML_SYSCALL_FILES): Moved to
	data-directory/Makefile.in.
	(SUBDIRS): Add data-directory.
	(all): Remove xml-syscall-copy dependency.
	(xml-syscall-copy): Moved to data-directory/Makefile.in as
	stamp-syscalls.
	(xml-syscall-install): Moved to data-directory/Makefile.in as
	install-syscalls.
	(install-only): Remove xml-syscall-install dependency.
	(all-data-directory): New rule.
	(data-directory/Makefile): New rule.
	* configure.ac (AC_OUTPUT): Add data-directory/Makefile.
	* configure: Regenerate.
	* data-directory/Makefile.in: New file.
	* python/lib/gdb/__init__.py: New file.

	testsuite/
	* gdb.base/catch-syscall.exp (do_syscall_tests): Update location
	of syscall staging area.
2010-10-06 16:02:45 +00:00
Joel Brobecker aa27d0b360 [Ada] Fix ARI warnings in advance_wild_match
gdb/ChangeLog:

        * ada-lang.c (advance_wild_match): Delete local variable t2.
        Adjust code accordingly.  Minor reformatting.
2010-10-06 15:24:38 +00:00
Ken Werner 2844d6b5a2 gdb:
* gdbtypes.h (struct main_type): Remove flag_nottext.
	(enum type_flag_value): Remove TYPE_FLAG_NOTTEXT.
	(enum type_instance_flag_value): Add TYPE_INSTANCE_FLAG_NOTTEXT.
	(TYPE_NOTTEXT): Use TYPE_INSTANCE_FLAG_NOTTEXT instead of flag_nottext.
	* gdbtypes.c (make_vector_type): Use TYPE_INSTANCE_FLAG_NOTTEXT instead
	of TYPE_FLAG_NOTTEXT.
	(init_type): Remove the initialization of the flag_nottext field.
	(gdbtypes_post_init): Use TYPE_INSTANCE_FLAG_NOTTEXT instead of
	TYPE_FLAG_NOTTEXT.
	* c-valprint.c (c_val_print): Remove TYPE_VECTOR check.
gdb/testsuite:
	* gdb.base/gnu_vector.c: Add variable c4.
	* gdb.base/gnu_vector.exp: Add tests for character vector printing.
	* gdb.arch/altivec-abi.exp: Fix expect pattern of character vectors.
2010-10-06 08:44:15 +00:00
gdbadmin 8d22faeb79 *** empty log message *** 2010-10-06 00:00:33 +00:00
Maciej W. Rozycki 7d8ac8bbbb * gdb.arch/altivec-abi.exp: Fix a typo. 2010-10-05 20:38:02 +00:00
Doug Evans ea65fe05d0 * cc-with-index.sh: New file. 2010-10-05 04:28:15 +00:00
Doug Evans b89be57b99 * dwarf2read.c (hash_strtab_entry): Insert blank line after
function comment.
	(eq_strtab_entry, create_strtab, add_string): Ditto.
	(hash_symtab_entry, eq_symtab_entry, delete_symtab_entry): Ditto.
	(create_index_table, create_mapped_symtab, find_slot): Ditto.
	(hash_expand, add_index_entry, add_indices_to_cpool): Ditto.
	(write_hash_table, add_address_entry, write_psymbols): Ditto.
	(write_obstack, unlink_if_set, write_one_signatured_type): Ditto.
	(write_psymtabs_to_index): Ditto.
2010-10-05 03:10:28 +00:00
Doug Evans 2fdf6df643 * dwarf2read.c (dw2_do_instantiate_symtab): Insert blank line after
function comment.
	(dw2_instantiate_symtab, dw2_get_cu, extract_cu_value): Ditto.
	(create_cus_from_index, create_addrmap_from_index): Ditto.
	(mapped_index_string_hash, find_slot_in_mapped_hash): Ditto.
	(dw2_setup, dw2_require_line_header, dw2_require_full_path): Ditto.
	(dw2_do_expand_symtabs_matching): Ditto.
2010-10-05 02:56:36 +00:00
gdbadmin e2be17a6d9 *** empty log message *** 2010-10-05 00:00:33 +00:00
Doug Evans f104871271 * Makefile.in (uninstall): Use $(DESTDIR). 2010-10-04 23:32:40 +00:00
Joel Brobecker 40bc484cc3 [Ada/funcalls] do not coerce fat pointers on the stack
When one of the parameter values in a subprogram calls is an array
whose value does not come from inferior memory, the debugger first
copies the array value in inferior memory.  Up to now, the memory
used to hold that copy was taken from the stack (just below the SP),
but this is causing problems on SPARC v9.

So the immediate fix is to follow what C does with arrays and strings,
which is allocate memory on the heap.

gdb/ChangeLog:

        * ada-lang.c: #include "value.h".
        (ensure_lval): Delete advance declaration.  Remove gdbarch and sp
        arguments.  Implement using value_allocate_space_in_inferior
        instead of allocating memory from the stack.
        (make_array_descriptor): Remove gdbarch and sp parameters.  Update
        calls to ensure_lval.
        (ada_convert_actual): Remove gdbarch and sp parameters.  Update
        calls to make_array_descriptor and ensure_lval.
        * ada-lang.h (ada_convert_actual): Update declaration.
        * infcall.c (value_arg_coerce): Update call to ada_convert_actual.
2010-10-04 22:32:31 +00:00
Doug Evans f17618eaf3 * python/python.c (_initialize_python): Define new function
GdbSetPythonDirectory in python.  Use it to update sys.path and
	gdb.__path__.
2010-10-04 15:30:25 +00:00
Paul N. Hilfinger 83e3a93c83 Have ptype handle types declared pragma Unchecked_Variants.
When a type is marked with pragma Unchecked_Variants, ptype did not print
variants having a single component, since the compiler produces incorrect
debugging output for such cases.  With this patch, we special-case these
components so that they print.

Changelog:

    * gdb/ada-typeprint.c (print_selected_record_field_types): New function,
    incorporating and generalizing print_record_field_types.
    (print_record_field_types): Change return value and update comment.
    Re-implement using print_selected_record_field_types.
    (print_choices): Print "=>" here.
    Handle case of unencoded variant branch.
    (print_variant_clauses): Reformat comment.
    Special-case unencoded variant branch.
2010-10-04 06:37:54 +00:00
Paul N. Hilfinger 7358912389 Replace wild_match with faster version and modify its interface.
This new version of wild_match is comparable in speed to strcmp_iw, and has
the same signature and same return value for equal names.

gdb/ChangeLog:
    * ada-lang.c (wild_match): Reimplement.
    Change API to eliminate unused length argument, reverse arguments and
    make 0 the 'true' return value.
    (advance_wild_match): New auxiliary function for wild_match to improve
    readability.
    (ada_match_name, ada_add_block_symbols): Use new API for wild_match.
    * psymtab.c (ada_lookup_partial_symbol, map_ada_symtabs): Use new
    API for wild_match.
    * symfile.h (map_ada_symtabs): Modify declaration to use new API for
    wild_match.
    * dwarf2read.c (dw2_map_ada_symtabs): Ditto.
2010-10-04 06:34:40 +00:00
gdbadmin 790c20f3f3 *** empty log message *** 2010-10-04 00:00:33 +00:00
gdbadmin dc14d28a1f *** empty log message *** 2010-10-03 00:00:02 +00:00
Maciej W. Rozycki 84a02e5838 * lib/mi-support.exp (thread_selected_re): Correct pattern used
to match a thread ID.
2010-10-02 17:48:23 +00:00
Jan Kratochvil b18e6318c5 gdb/testsuite/
Fix s390x testcase compatibility.
	* gdb.dwarf2/dw2-double-set-die-type.S: Use .2byte, not .value.
2010-10-02 13:31:47 +00:00
gdbadmin 3b6f63f94f *** empty log message *** 2010-10-02 00:00:33 +00:00
Doug Evans 11570e7189 * dwarf2read.c (_initialize_dwarf2_read): Add usage info to help text
for `save gdb-index' command.
2010-10-01 20:47:45 +00:00