Commit Graph

31531 Commits

Author SHA1 Message Date
Joel Brobecker eff44fea8c aix-thread: Fix getthrds declaration and call.
gdb/ChangeLog:

        * aix-thread.c (getthrds): Fix type of 4th parameter.
        (get_signaled_thread): Change type of variable ktid to tid_t.
2012-12-06 04:57:09 +00:00
Hui Zhu c90a077350 * dwarf2loc.c (dwarf_expr_frame_base): Add check for the return value of get_frame_block. 2012-12-06 01:11:32 +00:00
gdbadmin 5339c9d674 *** empty log message *** 2012-12-06 00:00:34 +00:00
Pierre Muller 5bc81a00b6 Avoid memory leaks on struct cmd_list_element.doc field.
* cli/cli-decode.c (add_alias_cmd): Make a copy of doc field
	if flags contains DOC_ALLOCATED.
	(add_setshow_cmd_full): Add DOC_ALLOCATED to set and show
	flags.
	(delete_cmd): Handle DOC_ALLOCATED flag.
	* cli/cli-decode.h (DOC_ALLOCATED): New macro for use
	in flags filed of struct cmd_list_element.
	(struct cmd_list_element): Document new flag item.
2012-12-05 23:23:22 +00:00
Ulrich Weigand e58fcc1591 * gdb.base/gnu-debugdata.exp: Also include "D" symbols in
${binfile}.funcsyms list.
2012-12-05 17:07:56 +00:00
Tom Tromey e90e9ad971 PR gdb/14917:
* server.h (current_insn_ptr, emit_error): Declare 'extern'.
2012-12-05 14:56:18 +00:00
gdbadmin 6418c17342 *** empty log message *** 2012-12-05 00:00:03 +00:00
Doug Evans b5ebcee64f * symmisc.c: Whitespace fixes. 2012-12-04 23:12:07 +00:00
Karthik Bhat 56bf074305 Fix for incorrect breakpoint set in case of clang compiled binary 2012-12-04 07:43:19 +00:00
Yao Qi e9eb0d14a7 gdb/testsuite
2012-12-04  Yao Qi  <yao@codesourcery.com>

	PR gdb/13443
	* gdb.trace/actions.exp: Make test messages unique.
2012-12-04 03:55:51 +00:00
gdbadmin 3d491ba741 *** empty log message *** 2012-12-04 00:00:04 +00:00
Doug Evans 56e6461019 * dwarf2read.c (struct dwarf2_per_objfile): Clarify comment.
(dw2_find_symbol_file): Delete unused local file_data.
2012-12-03 22:31:03 +00:00
Tom Tromey 270140bd25 * ada-exp.y (write_object_renaming, write_var_or_type)
(write_ambiguous_var, write_var_from_sym): Make blocks const.
	* ada-lang.c (replace_operator_with_call)
	(find_old_style_renaming_symbol): Make blocks const.
	* ada-lang.h (ada_find_renaming_symbol): Update.
	(struct ada_symbol_info) <block>: Now const.
	* breakpoint.c (watch_command_1): Update.
	* breakpoint.h (struct watchpoint) <exp_valid_block,
	cond_exp_valid_block>: Now const.
	* c-exp.y (classify_inner_name, classify_name): Make block
	argument const.
	* expprint.c (print_subexp_standard) <OP_VAR_VALUE>: Make 'b'
	const.
	* expression.h (innermost_block, parse_exp_1): Update.
	(union exp_element) <block>: Now const.
	* gdbtypes.c (lookup_template_type, lookup_enum, lookup_union)
	(lookup_struct): Make block argument const.
	* gdbtypes.h (lookup_template_type): Update.
	* go-exp.y (classify_name, classify_packaged_name)
	(package_name_p): Make block argument const.
	* objc-lang.c (lookup_struct_typedef): Make block argument const.
	* objc-lang.h (lookup_struct_typedef): Update.
	* parse.c (parse_exp_in_context, parse_exp_1)
	(write_exp_elt_block): Make block arguments const.
	(expression_context_block, innermost_block): Now const.
	* parser-defs.h (write_exp_elt_block): Update.
	(expression_context_block, innermost_block, block_found): Now
	const.
	* printcmd.c (struct display) <block>: Now const.
	* symtab.h (lookup_struct, lookup_union, lookup_enum): Update.
	* valops.c (address_of_variable): Make block argument const.
	* value.h (value_of_variable): Update.
	* varobj.c (struct varobj_root) <valid_block>: Now const.
2012-12-03 19:59:14 +00:00
gdbadmin 0f6752b51f *** empty log message *** 2012-12-03 00:00:33 +00:00
gdbadmin 368bc5b0a3 *** empty log message *** 2012-12-02 00:00:03 +00:00
Yao Qi 31f56a275d gdb/
2012-11-30  Yao Qi  <yao@codesourcery.com>

	* breakpoint.c (print_one_breakpoint_location): Indent code.
2012-12-01 02:16:28 +00:00
gdbadmin 33185a2c38 *** empty log message *** 2012-12-01 00:00:03 +00:00
Yao Qi 556ec64d8c gdb/
2012-11-30  Yao Qi  <yao@codesourcery.com>

	* breakpoint.c (print_one_breakpoint_location): Combine two
	blocks handling 'hit count' together.
2012-11-30 14:46:39 +00:00
Yao Qi 3d3fef6beb gdb/
2012-11-30  Yao Qi  <yao@codesourcery.com>

	* infrun.c (error_is_running, ensure_not_running): Move them
	to ...
	* infcmd.c (error_is_running, ensure_not_running): ... here.
	Make them 'static'.
	* inferior.h: Remove declarations of error_is_running and
	ensure_not_running.
2012-11-30 14:35:50 +00:00
Yao Qi 7cd12a76b7 gdb/
2012-11-30  Yao Qi  <yao@codesourcery.com>

	* tic6x-linux-tdep.c (tic6x_register_sigcontext_offset): Don't
	check REGNUM >= 0.
2012-11-30 07:42:57 +00:00
Yao Qi 7a76f5b828 gdb/
2012-11-30  Yao Qi  <yao@codesourcery.com>

	* infrun.c: Make the declaration of 'init_infwait_state'
	static.
	(init_infwait_state): Make it 'static'.
2012-11-30 07:24:48 +00:00
gdbadmin 69e601f38c *** empty log message *** 2012-11-30 00:00:33 +00:00
Tom Tromey 4983028c3a * gdb.base/gnu-debugdata.exp (run, pipeline): Don't use lassign. 2012-11-29 20:53:24 +00:00
Ulrich Weigand b1209b035b * python/python.c (finalize_python): Cast unused PyGILState_Ensure
return value to void to avoid compiler warning.
2012-11-29 19:11:48 +00:00
Ulrich Weigand ea5e6b0efe ChangeLog:
* opencl-lang.c (opencl_print_type): New function.
	(opencl_language_arch_info): Install it.

testsuite/ChangeLog:

	* gdb.opencl/convs_casts.exp: Always expect standard vector type names.
	* gdb.opencl/datatypes.exp: Likewise.
	* gdb.opencl/operators.exp: Likewise.
	* gdb.opencl/vec_comps.exp: Likewise.
2012-11-29 18:56:23 +00:00
Tom Tromey 0c631110f4 * gdb.texinfo (SVR4 Process Information): Document missing
"info proc" subcommands.
2012-11-29 17:49:20 +00:00
Tom Tromey a93478eab4 * contrib/ari/gdb_ari.sh: Remove rules for xasprintf and
xvasprintf.
	* common/common-utils.c (xasprintf, xvasprintf): Remove.
	* common/common-utils.h (xasprintf, xvasprintf): Remove.
2012-11-29 17:23:18 +00:00
Jerome Guitton cdde3dfbda New testcase for interface type printing.
gdb/testsuite/ChangeLog:

        * gdb.ada/iwide: New testcase.
2012-11-29 16:30:45 +00:00
Jerome Guitton ac4a2da45d Strip interface tags from visible fields
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-29 16:29:54 +00:00
Jerome Guitton b50d69b5aa Full view of interface-wide types
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-29 16:28:10 +00:00
Jerome Guitton c2d3fccf65 Update gdb.ada/variant_record_packed_array
gdb/testsuite/ChangeLog:

	* gdb.ada/variant_record_packed_array.exp: Test expressions of the
	form {VARIANT_TYPE}ADDRESS.
2012-11-29 16:27:13 +00:00
Jerome Guitton ca1f964d4b Handle other cases than EVAL_NORMAL in the default case
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-29 16:26:12 +00:00
gdbadmin 38d03cf1fd GDB 7.5.1 released. 2012-11-29 13:12:22 +00:00
Yao Qi f56825018b gdb/
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-29 07:55:10 +00:00
Yao Qi 891df0eae7 gdb/doc/
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 06:24:24 +00:00
gdbadmin 5982457a1a *** empty log message *** 2012-11-29 00:00:33 +00:00
Edjunior Barbosa Machado f359d716ea 2012-11-28 Edjunior Machado <emachado@linux.vnet.ibm.com>
* 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 20:07:19 +00:00
Tom Tromey 0cd61f4402 PR gdb/14290:
* 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 18:48:38 +00:00
Markus Metzger 945bf71318 2012-11-28 Markus Metzger <markus.t.metzger@intel.com>
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 16:21:58 +00:00
Yao Qi 7e20dfcd94 gdb/
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 11:56:15 +00:00
gdbadmin 2bb4ab0567 *** empty log message *** 2012-11-28 00:00:02 +00:00
Joel Brobecker b8293cc8fb Fix sparc-solaris build failure (sparc-sol2-nat.c)
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-27 14:09:13 +00:00
Yao Qi 8c2b9656fa gdb/
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-27 08:11:59 +00:00
Yao Qi 5edf51feea gdb/
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-27 07:59:12 +00:00
Yao Qi ca242aadec gdb/
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 07:41:43 +00:00
gdbadmin d8dd7f930d *** empty log message *** 2012-11-27 00:00:33 +00:00
Tom Tromey b181bbd0d6 2012-11-26 Alexander Larsson <alexl@redhat.com>
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-26 22:31:29 +00:00
Tom Tromey 608e2dbbfe 2012-11-26 Alexander Larsson <alexl@redhat.com>
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-26 19:23:56 +00:00
Jan Kratochvil 4648e5880e gdb/testsuite/
* gdb.base/enumval.exp (print e, print f, print K): XFAIL on GCC <= 4.6.
2012-11-26 18:13:24 +00:00
Joel Brobecker 17d6efc44b Do not crash when calling GDB with empty executable name.
% 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 17:41:44 +00:00