aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2012-11-29 * contrib/ari/gdb_ari.sh: Remove rules for xasprintf andTom Tromey4-43/+7
xvasprintf. * common/common-utils.c (xasprintf, xvasprintf): Remove. * common/common-utils.h (xasprintf, xvasprintf): Remove.
2012-11-29New testcase for interface type printing.Jerome Guitton5-0/+153
gdb/testsuite/ChangeLog: * gdb.ada/iwide: New testcase.
2012-11-29Strip interface tags from visible fieldsJerome Guitton2-2/+23
The following Ada type: type Circle is new Shape and Drawable with record Center : Point; Radius : Natural; end record; ...is displayed as follow in GDB: (gdb) ptype circle type = new classes.shape with record V51s: ada.tags.interface_tag; center: classes.point; radius: natural; end record V51s is an internal field that is of no interest for the user. It should not be displayed. gdb/ChangeLog: * ada-lang.c (ada_is_interface_tag): New function. (ada_is_ignored_field): Add interface tags to the list of ignored fields.
2012-11-29Full view of interface-wide typesJerome Guitton6-22/+165
For displaying the full view of a class-wide object, GDB relies on the assumption that this view will have the same address as the address of the object. In the case of simple inheritance, this assumption is correct; the proper type is deduced by decoding the tag of the object and converting the result to this full-view type. Consider for example an abstract class Shape, a child Circle which implements an interface Drawable, and the corresponding following objects: My_Circle : Circle := ((1, 2), 3); My_Shape : Shape'Class := Shape'Class (My_Circle); My_Drawable : Drawable'Class := Drawable'Class (My_Circle); To display My_Shape, the debugger first extracts the tag (an internal field, usually the first one of the record): (gdb) p my_shape'address $2 = (system.address) 0x8063e28 (gdb) x/x my_shape'address 0x8063e28 <classes__my_shape>: 0x08059ec4 Then the type specific data and the expanded name of the tag is read from there: (gdb) p my_shape'tag $3 = (access ada.tags.dispatch_table) 0x8059ec4 (classes.circle) To get the full view, the debugger converts to the corresponding type: (gdb) p {classes.circle}0x8063e28 $4 = (center => (x => 1, y => 2), radius => 3) Now, in the case of multiple inheritance, the assumption does not hold anymore. The address that we have usually points to some place lower. The offset to the original address is saved in the field Offset_To_Top of the metadata that are above the tag, at address obj'tag - 8. In the case of my_shape, this offset is 0: (gdb) x/x my_shape'tag - 8 0x8059ebc <classes__circleT+12>: 0x00000000 ...but in the case of an interface-wide object, it is not null: (gdb) x/x my_drawable'tag - 8 0x8063b28 <classes__classes__circle_classes__drawable1T56s+12>: 0x00000004 (gdb) p {classes.circle}(my_drawable'address - 4) $7 = (center => (x => 1, y => 2), radius => 3) The following change handles this relocation in the most common cases. Remaining cases that are still to be investigated are signaled by comments. gdb/ChangeLog: * ada-lang.h (ada_tag_value_at_base_address): New function declaration. * ada-lang.c (is_ada95_tag, ada_tag_value_at_base_address): New functions. (ada_to_fixed_type_1, ada_evaluate_subexp): Let ada_tag_base_address relocate the class-wide value if need be. (ada_value_struct_elt, ada_value_ind, ada_coerce_ref): Let ada_tag_value_at_base_address relocate the class-wide access/ref before dereferencing it. * ada-valprint.c (ada_val_print_1): Relocate to base address before displaying the content of an interface-wide ref. gdb/testsuite/ChangeLog: * gdb.ada/ptype_tagged_param.exp: Adjust expected output in ptype test.
2012-11-29Update gdb.ada/variant_record_packed_arrayJerome Guitton2-0/+12
gdb/testsuite/ChangeLog: * gdb.ada/variant_record_packed_array.exp: Test expressions of the form {VARIANT_TYPE}ADDRESS.
2012-11-29Handle other cases than EVAL_NORMAL in the default caseJerome Guitton2-1/+7
In the evaluation of an expression in Ada mode, the default case unwraps the argument unconditionally. For an object of a variant record type, this unwrapping builds a fixed type from the specification of the variant type and the actual values of the object's discriminants. It means that unwrapping needs the "proper" value for the object, not just a zero value with the proper type. When not in EVAL_NORMAL, we cannot assume that the evaluation returns such a proper value; it may well return a zero value of the appropriate type e.g in EVAL_AVOID_SIDE_EFFECTS. It is wrong to try to unwrap in that case. In particular, a problem shows up when using expression of the form {VARIANT_TYPE}OBJ. GDB first evaluates this expression in EVAL_AVOID_SIDE_EFFECTS to compute the type, the evaluation of OBJ in most cases returns a zero value of its type, and as UNOP_MEMVAL is mapped to the default case its evaluation ends up trying to read memory around address 0. gdb/ChangeLog: * ada-lang.c (ada_evaluate_subexp): Unwrap only in EVAL_NORMAL.
2012-11-29Fix attribution for old patch:Hans-Peter Nilsson1-1/+2
2009-10-19 Edgar E. Iglesias <edgar@axis.com> Hans-Peter Nilsson <hp@axis.com> * elf32-cris.c (cris_elf_relocate_section) <case R_CRIS_32_DTPREL>: Don't subtract the size of the TLS block for non-shared objects from the relocation.
2012-11-29GDB 7.5.1 released.gdbadmin1-0/+4
2012-11-29 * Makefile.in: Regenerate.Maciej W. Rozycki2-0/+6
2012-11-29gdb/Yao Qi2-1/+9
2012-11-29 Yao Qi <yao@codesourcery.com> Tom Tromey <tromey@redhat.com> * eval.c (evaluate_subexp_standard): Get the correct pointer type for TYPE_CODE_MEMBERPTR.
2012-11-29gdb/doc/Yao Qi2-1/+7
2012-11-29 Yao Qi <yao@codesourcery.com> PR gdb/1477. * gdb.texinfo (Print Settings): Correct the default 'demangle-style' to 'auto' instead of 'gnu'.
2012-11-29*** empty log message ***gdbadmin1-1/+1
2012-11-28daily updateAlan Modra1-1/+1
2012-11-282012-11-28 Edjunior Machado <emachado@linux.vnet.ibm.com>Edjunior Barbosa Machado2-15/+5
* rs6000-tdep.c (gdb_print_insn_powerpc): Remove info->mach checking, since now it is being done by binutils' powerpc_init_dialect().
2012-11-28 PR gdb/14290:Tom Tromey4-17/+68
* solib-darwin.c (gdb_bfd_mach_o_fat_extract): New function. (darwin_solib_get_all_image_info_addr_at_init, darwin_bfd_open): Use it. * gdb_bfd.h (gdb_bfd_mark_parent): Declare. * gdb_bfd.c (gdb_bfd_mark_parent): New function. (gdb_bfd_openr_next_archived_file): Use it.
2012-11-28 gas/Julian Brown5-7/+79
* config/tc-arm.c (md_apply_fix): Fix conversion of BL to BLX for local targets in Thumb mode. gas/testsuite/ * gas/arm/bl-local-2.s: New test. * gas/arm/bl-local-2.d: New.
2012-11-282012-11-28 Markus Metzger <markus.t.metzger@intel.com>Markus Metzger8-4/+23
gdb/ * configure.ac: Check for linux/perf_event.h. * config.in: Regenerated. * configure: Regenerated. gdb/gdbserver/ * configure.ac: Check for linux/perf_event.h. * config.in: Regenerated. * configure: Regenerated.
2012-11-28 * resbin.c (bin_to_res_version): Correct offsetKai Tietz2-9/+11
and length calculation of resource. (get_version_header): Apply alignement of 4 to len.
2012-11-28gdb/Yao Qi4-0/+12
2012-11-28 Yao Qi <yao@codesourcery.com> * breakpoint.c (_initialize_breakpoint): Call add_alias_cmd to abbreviate 'delete tracepoints' to 'delete tr'. * corefile.c (_initialize_core): Call add_alias_cmd to abbreviate 'set gnutarget' to 'set g'. * value.c (_initialize_values): Call add_alias_cmd to abbreviate 'show convenience' to 'show conv'.
2012-11-28Disable libsanitizer for non-C++ builds.Jan-Benedict Glaw3-4/+9
* configure.ac (noconfigdirs): Merge from GCC. * configure: Regenerate.
2012-11-28*** empty log message ***gdbadmin1-1/+1
2012-11-27daily updateAlan Modra1-1/+1
2012-11-27binutils/testsuite/Roland McGrath11-38/+114
* lib/binutils-common.exp (is_zlib_supported): New function. * lib/utils-lib.exp (run_dump_test): If as options include --compress-debug-sections and zlib is not available, report the test as unsupported. * binutils-all/compress.exp: Bail out if zlib is not available. * binutils-all/objdump.exp (objdump compressed debug): Mark unsupported if zlib is not available. * binutils-all/readelf.exp (readelf_compressed_wa_test): Likewise. gas/testsuite/ * lib/gas-defs.exp (run_dump_test): If as options include --compress-debug-sections and zlib is not available, report the test as unsupported. ld/testsuite/ * ld-elf/compress.exp: Bail out if zlib is not supported. * lib/ld-lib.exp (run_dump_test): If as options include --compress-debug-sections and zlib is not available, report the test as unsupported.
2012-11-27ld/testsuite/Roland McGrath3-5/+11
* ld-elf/flags1.d: Add *-*-nacl* to xfail list. * ld-elf/orphan-region.d: Likewise.
2012-11-27 PR ld/14776Nick Clifton2-14/+19
* ld.texinfo: Fix spelling mistakes.
2012-11-27Fix sparc-solaris build failure (sparc-sol2-nat.c)Joel Brobecker2-2/+9
Hello, The recent patch for %fsr handling had a couple of tiny mistakes that cause the build to fail on sparc-solaris. Fixed thusly. gdb/ChangeLog: * sparc-sol2-nat.c (supply_gregset): Fix first parameter in call to sparc_supply_fpregset. (fill_fpregset): Fix first parameter in call to sparc_collect_fpregset. Tested on sparc-solaris by rebuilding GDB. Will check it in. Thanks, -- Joel
2012-11-27gdb/Yao Qi4-17/+36
2012-11-27 Daniel Jacobowitz <dan@codesourcery.com> Kazu Hirata <kazu@codesourcery.com> Yao Qi <yao@codesourcery.com> * objfiles.c (init_entry_point_info): Call gdbarch_convert_from_func_ptr_addr and gdbarch_addr_bits_remove here ... (entry_point_address_query): ... instead of here. * solib-svr4.c (exec_entry_point): Call gdbarch_addr_bits_remove. * symfile.c (generic_load): Call gdbarch_addr_bits_remove on the entry address.
2012-11-27gdb/Yao Qi5-13/+85
2012-11-27 Daniel Jacobowitz <dan@codesourcery.com> Yao Qi <yao@codesourcery.com> * eval.c (evaluate_subexp_standard): Add handling of TYPE_CODE_MEMBERPTR when calling functions. Correct the result of ptype for calling a TYPE_CODE_METHODPTR. gdb/testsuite/ 2012-11-27 Daniel Jacobowitz <dan@codesourcery.com> * gdb.cp/member-ptr.cc (class Diamond): Add func_ptr. (func): New function. (main): Initialize diamond.func_ptr and add diamond_pfunc_ptr. * gdb.cp/member-ptr.exp: Add new tests for ptype and for pointers to members with pointer-to-function type.
2012-11-27gdb/Yao Qi2-5/+12
2012-11-27 Yao Qi <yao@codesourcery.com> * symtab.c (symtab_symbol_info): Fix a -Wformat-extra-args warning. Add i18n markup.
2012-11-27*** empty log message ***gdbadmin1-1/+1
2012-11-26ld/Roland McGrath5-14/+26
* emultempl/aarch64elf.em (gld${EMULATION_NAME}_before_parse): Copy last elf32.em here too. * emultempl/armelf.em (gld${EMULATION_NAME}_before_parse): Likewise. * emultempl/mmixelf.em (gld${EMULATION_NAME}_before_parse): Likewise. * emultempl/scoreelf.em (gld${EMULATION_NAME}_before_parse): Likewise.
2012-11-26daily updateAlan Modra1-1/+1
2012-11-262012-11-26 Alexander Larsson <alexl@redhat.com>Tom Tromey1-0/+288
Jan Kratochvil <jan.kratochvil@redhat.com> Tom Tromey <tromey@redhat.com> * NEWS: Mention mini debuginfo feature. * minidebug.c: New file. * configure.ac: Check for lzma. * configure, config.in: Rebuild. * Makefile.in (LIBLZMA): New variable. (CLIBS): Include LIBLZMA. (SFILES): Mention minidebug.c. (COMMON_OBS): Mention minidebug.o. * symfile.c (read_symbols): New function. (syms_from_objfile, reread_symbols): Call it. * symfile.h (find_separate_debug_file_in_section): Declare. doc * gdb.texinfo (MiniDebugInfo): New node. (GDB Files): Update. testsuite * gdb.base/gnu-debugdata.exp: New file. * gdb.base/gnu-debugdata.c: New file. * lib/gdb.exp (gdb_file_cmd): Handle LZMA warning. (gdb_unload): Return 0 on success.
2012-11-262012-11-26 Alexander Larsson <alexl@redhat.com>Tom Tromey14-14/+835
Jan Kratochvil <jan.kratochvil@redhat.com> Tom Tromey <tromey@redhat.com> * NEWS: Mention mini debuginfo feature. * minidebug.c: New file. * configure.ac: Check for lzma. * configure, config.in: Rebuild. * Makefile.in (LIBLZMA): New variable. (CLIBS): Include LIBLZMA. (SFILES): Mention minidebug.c. (COMMON_OBS): Mention minidebug.o. * symfile.c (read_symbols): New function. (syms_from_objfile, reread_symbols): Call it. * symfile.h (find_separate_debug_file_in_section): Declare. doc * gdb.texinfo (MiniDebugInfo): New node. (GDB Files): Update. testsuite * gdb.base/gnu-debugdata.exp: New file. * gdb.base/gnu-debugdata.c: New file. * lib/gdb.exp (gdb_file_cmd): Handle LZMA warning. (gdb_unload): Return 0 on success.
2012-11-26gdb/testsuite/Jan Kratochvil2-3/+49
* gdb.base/enumval.exp (print e, print f, print K): XFAIL on GCC <= 4.6.
2012-11-26bfd/Roland McGrath2-3/+6
* elf-nacl.c (nacl_modify_segment_map): Don't crash when INFO is null.
2012-11-26Do not crash when calling GDB with empty executable name.Joel Brobecker4-2/+37
% gdb -q '' ... or ... % gdb -q (gdb) file '' ... both cause GDB to crash with an invalid free. This is because exec_file_attach is attempting to free a string that has not been allocated. The string is only allocated if openp is successful. But in the case of this obviously invalid filename, openp fails, and leaves scratch_pathname uninitialized, thus causing the xfree to fail. The fix is to enable the associated cleanup after we have verified that openp was successful. gdb/ChangeLog (By Keith Seitz <keiths@redhat.com>): * exec.c (exec_file_attach): Move cleanup after verifying that memory has in fact been allocated. gdb/testsuite/ChangeLog: * gdb.base/empty_exe.exp: New testcase.
2012-11-26 * ada-lang.c (user_select_syms): Use SYMBOL_SYMTAB.Tom Tromey4-5/+13
* dwarf2read.c (dw2_find_symbol_file, fixup_go_packaging): Use SYMBOL_SYMTAB. * skip.c (skip_info): Use SYMBOL_SYMTAB.
2012-11-26gdb/Pedro Alves8-6/+22
2012-11-26 Maxime Villard <rustyBSD@gmx.fr> Pedro Alves <palves@redhat.com> * common/linux-osdata.c (linux_xfer_osdata_fds): Decrease buffer size parameter passed to readlink by one byte. * fbsd-nat.c (fbsd_pid_to_exec_file): Ditto. * linux-nat.c (linux_child_pid_to_exec_file): Ditto. * nbsd-nat.c (nbsd_pid_to_exec_file): Ditto. * inf-child.c (inf_child_fileio_readlink): Decrease local buffer's size by one byte. gdb/gdbserver/ 2012-11-26 Maxime Villard <rustyBSD@gmx.fr> * hostio.c (handle_readlink): Decrease buffer size parameter passed to readlink by one byte.
2012-11-26gdb/gdbserver/Yao Qi4-3/+12
2012-11-26 Yao Qi <yao@codesourcery.com> * configure.ac (build_warnings): Append '-Wempty-body'. * configure: Regenerated. * linux-low.c (linux_create_inferior): Use braces for empty 'if' body.
2012-11-26gdb/Yao Qi2-1/+6
2012-11-26 Yao Qi <yao@codesourcery.com> * f-valprint.c (f77_create_arrayprint_offset_tbl): Remove extraneous parentheses.
2012-11-26gdb/Yao Qi2-1/+5
2012-11-26 Yao Qi <yao@codesourcery.com> * remote.c (remote_start_remote): Typo fix.
2012-11-26*** empty log message ***gdbadmin1-1/+1
2012-11-25daily updateAlan Modra1-1/+1
2012-11-25*** empty log message ***gdbadmin1-1/+1
2012-11-24daily updateAlan Modra1-1/+1
2012-11-24*** empty log message ***gdbadmin1-1/+1
2012-11-23daily updateAlan Modra1-1/+1
2012-11-23Fix Sparc %fsr regset offset for BSD and Linux.David S. Miller20-47/+183
gdb/ * sparc-tdep.h (struct sparc_fpregset): New data structure. (sparc32_sunos4_fpregset, sparc32_bsd_fpregset, sparc32_sol2_fpregset): Declare new globals. (sparc32_supply_fpregset, sparc32_collect_fpregset): Add new 'fpregset' argument. * sparc64-tdep.h (sparc64_supply_fpregset, sparc64_collect_fpregset): Likewise. (sparc64_sol2_fpregset, sparc64_bsd_fpregset): Declare new globals. * sparc-nat.h (struct sparc_fpregset): Add forward declaration. (sparc_fpregset): Declare new global. (sparc_supply_fpregset, sparc_collect_fpregset): Add new 'fpregset' argument. * sparc-linux-nat.c (supply_fpregset): Pass sparc_fpregset down into handler. (fill_fpregset): Likewise. (_initialize_sparc_linux_nat): Set sparc_fpregset to sparc32_bsd_fpregset. * sparc-linux-tdep.c (sparc32_linux_supply_core_fpregset): Pass sparc32_bsd_fpregset down into handler. (sparc32_linux_collect_core_fpregset): Likewise. * sparc-nat.c (sparc_fpregset): Define. (sparc_supply_fpregset): Add 'fpregset' argument. (sparc_collect_fpregset): Likewise. (sparc_fetch_inferior_registers): Pass sparc_fpregset down into fpregset handler. (sparc_store_inferior_registers): Likewise. (_initialize_sparc_nat): Set sparc_fpregset to sparc32_sunos4_fpregset if NULL. * sparc-sol2-nat.c (supply_gregset): Pass sparc_sol2_fpregset down into handler. (fill_fpregset): Likewise. * sparc-sol2-tdep.c (sparc32_sol2_fpregset): Define. * sparc-tdep.c (sparc32_supply_fpregset): Add fpregset arg and use it to compute offsets. (sparc32_collect_fpregset): Likewise. (sparc32_sunos4_fpregset, sparc32_bsd_fpregset): Define. * sparc64-linux-nat.c (supply_fpregset): Pass sparc64_bsd_fpregset down into handler. (fill_fpregset): Likewise. * sparc64-linux-tdep.c (sparc64_linux_supply_core_fpregset): Likewise. (sparc64_linux_collect_core_fpregset): Likewise. * sparc64-sol2-tdep.c (sparc64_sol2_fpregset): Define. * sparc64-tdep.c (sparc64_supply_fpregset): Add fpregset arg and use it to compute offsets. (sparc64_collect_fpregset): Likewise. (sparc64_bsd_fpregset): Define. * sparc64fbsd-tdep.c (sparc64fbsd_supply_fpregset): Padd sparc64_bsd_fpregset down into handler. (sparc64fbsd_collect_fpregset): Likewise. * sparc64nbsd-nat.c (sparc64nbsd_supply_fpregset): Add fpregset arg and pass sparc{32,64}_bsd_fpregset down into handler. (sparc64nbsd_collect_fpregset): Likewise. * sparc64nbsd-tdep.c (sparc64nbsd_supply_fpregset): Pass sparc64_bsd_fpregset down into handler. * sparc64obsd-tdep.c (sparc64obsd_supply_gregset): Likewise. * sparcnbsd-nat.c (_initialize_sparcnbsd_nat): Set sparc_fpregset to sparc32_bsd_fpregset. * sparcnbsd-tdep.c (sparc32nbsd_supply_gregset): Pass sparc32_bsd_fpregset down into sparc32_supply_fpregset. (sparc32nbsd_supply_fpregset): Likewise.
2012-11-23include/opcode/Alan Modra20-41/+121
* ppc.h (ppc_parse_cpu): Update prototype. opcodes/ * ppc-dis.c (ppc_parse_cpu): Add "sticky" param. Track bits set from ppc_opts.sticky in it. Delete "retain_mask". (powerpc_init_dialect): Choose default dialect from info->mach before parsing -M options. Handle more bfd_mach_ppc variants. Update common default to power7. gas/ * config/tc-ppc.c (sticky): New var. (md_parse_option, ppc_machine): Update ppc_parse_cpu calls. gas/testsuite/ * gas/ppc/astest2.d: Pass -Mppc to objdump. ld/testsuite/ * ld-powerpc/plt1.d: Update for default "at" branch hints. * ld-powerpc/tlsexe.d: Likewise. * ld-powerpc/tlsexetoc.d: Likewise. * ld-powerpc/tlsopt1.d: Likewise. * ld-powerpc/tlsopt1_32.d: Likewise. * ld-powerpc/tlsopt2.d: Likewise. * ld-powerpc/tlsopt2_32.d: Likewise. * ld-powerpc/tlsopt4.d: Likewise. * ld-powerpc/tlsopt4_32.d: Likewise. * ld-powerpc/tlsso.d: Likewise. * ld-powerpc/tlstocso.d: Likewise.