aboutsummaryrefslogtreecommitdiff
path: root/gdb
AgeCommit message (Collapse)AuthorFilesLines
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-29GDB 7.5.1 released.gdbadmin1-0/+4
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-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-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-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-28*** empty log message ***gdbadmin1-1/+1
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-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-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-25*** empty log message ***gdbadmin1-1/+1
2012-11-24*** empty log message ***gdbadmin1-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-23*** empty log message ***gdbadmin1-1/+1
2012-11-22*** empty log message ***gdbadmin1-1/+1
2012-11-21 * gdbtypes.h (struct cplus_struct_type) <localtype_ptr>: RemoveTom Tromey3-19/+8
field. (TYPE_LOCALTYPE_PTR, TYPE_LOCALTYPE_FILE, TYPE_LOCALTYPE_LINE): Remove. * c-typeprint.c (c_type_print_base): Update.
2012-11-21Revert previous change to i386-tdep.c.Pedro Alves2-29/+1
2012-11-21Added forgotton ChangeLog for previous fix i.e. breakpoint not set properly ↵Karthik Bhat1-0/+6
in case of clang compiled binary commit
2012-11-21Fix for incorrect breakpoint set in case of clang compiled binaryKarthik Bhat1-1/+23
2012-11-21gdb/Yao Qi10-56/+28
2012-11-21 Yao Qi <yao@codesourcery.com> PR tdep/7438 * gdbarch.sh (smash_text_address): Remove. * gdbarch.c, gdbarch.h: Regenerate. * arm-tdep.c (arm_smash_text_address): Remove. (arm_gdbarch_init): Don't call set_gdbarch_smash_text_address. * hppa-tdep.c (hppa_smash_text_address): Remove. (hppa_addr_bits_remove): Rename from hppa_smash_text_address. (hppa_gdbarch_init): Don't call set_gdbarch_smash_text_address. Caller update. * coffread.c (coff_symtab_read): Caller update. * dbxread.c (process_one_symbol): Likewise. * elfread.c (record_minimal_symbol): Likewise. * somread.c (som_symtab_read): Likewise.
2012-11-21*** empty log message ***gdbadmin1-1/+1
2012-11-20 Add forgotten ChangeLog for previous ARI fixes commitPierre Muller1-0/+28
2012-11-20 ARI fixes: sprintf rule.Pierre Muller16-54/+68
Replace sprintf function calls for char arrays by calls to xsnprintf calls. * arm-tdep.c (arm_push_dummy_call): Replace sprintf by xsnprintf. (arm_dwarf_reg_to_regnum, arm_return_value): Ditto. (arm_neon_quad_read, arm_pseudo_read): Ditto. (arm_neon_quad_write, arm_pseudo_write): Ditto. * breakpoint.c (condition_completer): Ditto. (create_tracepoint_from_upload): Ditto. * dwarf2read.c (file_full_name): Ditto. * gcore.c (gcore_command): Ditto. * gnu-nat.c (proc_string, gnu_pid_to_str): Ditto. * go32-nat.c (go32_sysinfo): Ditto. * interps.c (interp_set): Ditto. * m32c-tdep.c (make_types): Ditto. * ppc-linux-nat.c (fetch_register, store_register): Ditto. * remote-m32r-sdi.c (m32r_open): Ditto. * sol-thread.c (td_err_string): Ditto. (td_state_string, solaris_pid_to_str): Ditto. * symtab.c (gdb_mangle_name): Ditto. * cli/cli-script.c (execute_control_command): Ditto. (define_command, document_command): Ditto. * tui/tui-io.c (tui_rl_display_match_list): Ditto. * tui/tui-stack.c (tui_make_status_line): Ditto. * tui/tui-win.c (tui_update_gdb_sizes): Ditto.
2012-11-20gdb: include help aliases in help command completionMike Frysinger6-8/+42
There are a bunch of aliases that get used with help, but the current command completion logic does not include those when doing completions. Since the framework is already mostly in place, extend complete_on_cmdlist slightly to pass down the ignore_help_classes flag like is done with the existing lookup command logic. Now you can do: (gdb) help use<tab> and get back: (gdb) help user-defined Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-11-20 * completer.c (count_struct_fields): Remove.Tom Tromey2-34/+5
(expression_completer): Don't call count_struct_fields.
2012-11-202012-11-20 Pedro Alves <palves@redhat.com>Pedro Alves4-11/+22
* annotate.c (breakpoints_changed): Rename to ... (annotate_breakpoints_changed): ... this. (annotate_stopped, breakpoint_changed): Adjust caller. * annotate.h (breakpoints_changed): Rename to ... (annotate_breakpoints_changed): ... this. * breakpoint.c (set_breakpoint_condition, breakpoint_set_commands) (do_map_commands_command, init_raw_breakpoint, clear_command) (set_ignore_count, enable_breakpoint_disp): Adjust callers.
2012-11-20Fix 'info os' crashes on sparc.David S. Miller2-24/+10
* common/linux-osdata.c (get_number_of_cpu_cores): Delete. (linux_xfer_osdata_processes): Fetch _SC_NPROCESSORS_ONLN via sysconf. (get_cores_used_by_process): Update comment.
2012-11-20gdb/Yao Qi2-1/+5
2012-11-20 Yao Qi <yao@codesourcery.com> * objfiles.c (init_entry_point_info): Remove trailing spaces.
2012-11-20gdb/Yao Qi2-1/+6
2012-11-20 Yao Qi <yao@codesourcery.com> * infrun.c (handle_inferior_event): Pass 'saved_singlestep_ptid' to deprecated_context_hook.
2012-11-20gdb/testsuite/Yao Qi2-7/+12
2012-11-20 Yao Qi <yao@codesourcery.com> * gdb.mi/mi-cmd-param-changed.exp (test_command_param_changed): Don't test 'maint set show-debug-regs'. Use command 'set remotecache' instead of 'set circular-trace-buffer'.
2012-11-20*** empty log message ***gdbadmin1-1/+1
2012-11-19gdb/Yao Qi2-1/+5
2012-11-19 Yao Qi <yao@codesourcery.com> * infrun.c (infwait_state): Add static.
2012-11-19*** empty log message ***gdbadmin1-1/+1