* configure.ac (CC_HAS_LONG_LONG): Replace by AC_MSG_ERROR.
* defs.h (LONGEST, ULONGEST): Remove conditionalization for
CC_HAS_LONG_LONG.
* dwarf2-frame.c (DW64_CIE_ID): Likewise.
* dwarf2read.c (extract_cu_value): Remove the function.
(create_cus_from_index_list): Make the return type void, inline the
extract_cu_value caller, include new gdb_static_assert.
(create_cus_from_index): Make the return type void, update the function
comment, update the create_cus_from_index_list caller.
(create_signatured_type_table_from_index): Make the return type void,
inline the extract_cu_value caller, include new gdb_static_assert.
(dwarf2_read_index): Update the create_cus_from_index and
create_signatured_type_table_from_index caller.
* printcmd.c (ui_printf): Remove conditionalizations for
CC_HAS_LONG_LONG.
* config.in: Regenerate.
* configure: Regenerate.
gdb/doc/
* gdbint.texinfo (Host Definition): Remove CC_HAS_LONG_LONG.
* dwarf2read.c (struct dwarf2_cu): New field producer_is_gcc_lt_4_3.
Update the comment for checked_producer.
(check_producer): New forward declaration.
(producer_is_gcc_lt_4_3): New function.
(find_file_and_directory): Simulate *COMP_DIR only for gcc < 4.3.
(check_producer): Initialize also PRODUCER_IS_GCC_LT_4_3.
gdb/testsuite/
* gdb.dwarf2/dw2-compdir-oldgcc.S: New file.
* gdb.dwarf2/dw2-compdir-oldgcc.exp: New file.
There was a duplicate ("sim/common/cgen-fpu.h"), and one entry where
we do have an FSF copyright header ("sim/common/sim-fpu.c").
gdb/ChangeLog:
* copyright.py (NOT_FSF_LIST): Remove duplicate entry
"sim/common/cgen-fpu.h". Remove invalid entries
"sim/common/sim-fpu.c" and "sim/mn10300/sim-main.h",
which actually have an FSF copyright header.
PR mi/14741:
* mi/mi-cmd-var.c (varobj_update_one): Take value of
attribute "dynamic" and "displayhint" from printed child,
not the root variable.
* gdb.python/py-mi.exp: Correct expected results for attribute
"dynamic" returned by -var-update.
Add test case for correct handling of "diplayhint" for children
of dynamic varobjs.
* gdb.python/py-prettyprint.c (set_itme): New function.
(bug_14741) New function.
(main) Add call to bug_14741().
* gdb.python/py-prettyprint.py (class ArrayPrinter): New class.
* 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-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.
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.
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.
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 Yao Qi <yao@codesourcery.com>
Tom Tromey <tromey@redhat.com>
* eval.c (evaluate_subexp_standard): Get the correct pointer
type for TYPE_CODE_MEMBERPTR.
* 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.
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 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.
% 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 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.