Add valaddr support in dynamic property resolution.
This is the second part of enhancing the debugger to print the value
of arrays of records whose size is variable when only standard DWARF
info is available (no GNAT encoding). For instance:
subtype Small_Type is Integer range 0 .. 10;
type Record_Type (I : Small_Type := 0) is record
S : String (1 .. I);
end record;
type Array_Type is array (Integer range <>) of Record_Type;
A1 : Array_Type := (1 => (I => 0, S => <>),
2 => (I => 1, S => "A"),
3 => (I => 2, S => "AB"));
Currently, GDB prints the following output:
(gdb) p a1
$1 = (
The error happens while the ada-valprint module is trying to print
the value of an element of our array. Because of the fact that
the array's element (type Record_Type) has a variant size, the DWARF
info for our array provide the array's stride:
<1><749>: Abbrev Number: 10 (DW_TAG_array_type)
<74a> DW_AT_name : (indirect string, offset: 0xb6d): pck__T18s
<74e> DW_AT_byte_stride : 16
<74f> DW_AT_type : <0x6ea>
And because our array has a stride, ada-valprint treats it the same
way as packed arrays (see ada-valprint.c::ada_val_print_array):
if (TYPE_FIELD_BITSIZE (type, 0) > 0)
val_print_packed_array_elements (type, valaddr, offset_aligned,
0, stream, recurse,
original_value, options);
The first thing that we should notice in the call above is that
the "valaddr" buffer and the associated offset (OFFSET_ALIGNED)
is passed, but that the corresponding array's address is not.
This can be explained by looking inside val_print_packed_array_elements,
where we see that the function unpacks each element of our array from
the buffer alone (ada_value_primitive_packed_val), and then prints
the resulting artificial value instead:
v0 = ada_value_primitive_packed_val (NULL, valaddr + offset,
(i0 * bitsize) / HOST_CHAR_BIT,
(i0 * bitsize) % HOST_CHAR_BIT,
bitsize, elttype);
[...]
val_print (elttype, value_contents_for_printing (v0),
value_embedded_offset (v0), 0, stream,
recurse + 1, v0, &opts, current_language);
Of particular interest, here, is the fact that we call val_print
with a null address, which is OK, since we're providing a buffer
instead (value_contents_for_printing). Also, providing an address
might not always possible, since packing could place elements at
boundaries that are not byte-aligned.
Things go south when val_print tries to see if there is a pretty-printer
that could be applied. In particular, one of the first things that
the Python pretty-printer does is to create a value using our buffer,
and the given address, which in this case is null (see call to
value_from_contents_and_address in gdbpy_apply_val_pretty_printer).
value_from_contents_and_address, in turn immediately tries to resolve
the type, using the given address, which is null. But, because our
array element is a record containing an array whose bound is the value
of one of its elements (the "s" component), the debugging info for
the array's upper bound is a reference...
<3><71a>: Abbrev Number: 7 (DW_TAG_subrange_type)
<71b> DW_AT_type : <0x724>
<71f> DW_AT_upper_bound : <0x703>
... to component "i" of our record...
<2><703>: Abbrev Number: 5 (DW_TAG_member)
<704> DW_AT_name : i
<706> DW_AT_decl_file : 2
<707> DW_AT_decl_line : 6
<708> DW_AT_type : <0x6d1>
<70c> DW_AT_data_member_location: 0
... where that component is located at offset 0 of the start
of the record. dwarf2_evaluate_property correctly determines
the offset where to load the value of the bound from, but then
tries to read that value from inferior memory using the address
that was given, which is null. See case PROP_ADDR_OFFSET in
dwarf2_evaluate_property:
val = value_at (baton->offset_info.type,
pinfo->addr + baton->offset_info.offset);
This triggers a memory error, which then causes the printing to terminate.
Since there are going to be situations where providing an address
alone is not going to be sufficient (packed arrays where array elements
are not stored at byte boundaries), this patch fixes the issue by
enhancing the type resolution to take both address and data. This
follows the same principle as the val_print module, where both
address and buffer ("valaddr") can be passed as arguments. If the data
has already been fetched from inferior memory (or provided by the
debugging info in some form -- Eg a constant), then use that data
instead of reading it from inferior memory.
Note that this should also be a good step towards being able to handle
dynamic types whose value is stored outside of inferior memory
(Eg: in a register).
With this patch, GDB isn't able to print all of A1, but does perform
a little better:
(gdb) p a1
$1 = ((i => 0, s => , (i => 1, s => , (i => 2, s => )
There is another issue which is independent of this one, and will
therefore be patched separately.
gdb/ChangeLog:
* dwarf2loc.h (struct property_addr_info): Add "valaddr" field.
* dwarf2loc.c (dwarf2_evaluate_property): Add handling of
pinfo->valaddr.
* gdbtypes.h (resolve_dynamic_type): Add "valaddr" parameter.
* gdbtypes.c (resolve_dynamic_struct): Set pinfo.valaddr.
(resolve_dynamic_type_internal): Set pinfo.valaddr.
Add handling of addr_stack->valaddr.
(resolve_dynamic_type): Add "valaddr" parameter.
Set pinfo.valaddr field.
* ada-lang.c (ada_discrete_type_high_bound): Update call to
resolve_dynamic_type.
(ada_discrete_type_low_bound): Likewise.
* findvar.c (default_read_var_value): Likewise.
* value.c (value_from_contents_and_address): Likewise.
2015-04-01 17:00:13 +00:00
|
|
|
|
2015-05-05 Joel Brobecker <brobecker@adacore.com>
|
|
|
|
|
|
|
|
|
|
* dwarf2loc.h (struct property_addr_info): Add "valaddr" field.
|
|
|
|
|
* dwarf2loc.c (dwarf2_evaluate_property): Add handling of
|
|
|
|
|
pinfo->valaddr.
|
|
|
|
|
* gdbtypes.h (resolve_dynamic_type): Add "valaddr" parameter.
|
|
|
|
|
* gdbtypes.c (resolve_dynamic_struct): Set pinfo.valaddr.
|
|
|
|
|
(resolve_dynamic_type_internal): Set pinfo.valaddr.
|
|
|
|
|
Add handling of addr_stack->valaddr.
|
|
|
|
|
(resolve_dynamic_type): Add "valaddr" parameter.
|
|
|
|
|
Set pinfo.valaddr field.
|
|
|
|
|
* ada-lang.c (ada_discrete_type_high_bound): Update call to
|
|
|
|
|
resolve_dynamic_type.
|
|
|
|
|
(ada_discrete_type_low_bound): Likewise.
|
|
|
|
|
* findvar.c (default_read_var_value): Likewise.
|
|
|
|
|
* value.c (value_from_contents_and_address): Likewise.
|
|
|
|
|
|
preserve the bit stride when resolving an array type.
Consider the following (Ada) variable...
A1 : Array_Type := (1 => (I => 0, S => <>),
2 => (I => 1, S => "A"),
3 => (I => 2, S => "AB"));
... where Array_Type is an array of records whose size is variable:
subtype Small_Type is Integer range 0 .. 10;
type Record_Type (I : Small_Type := 0) is record
S : String (1 .. I);
end record;
type Array_Type is array (Integer range <>) of Record_Type;
Trying to print the value of this array currently results in the following
error:
(gdb) p a1
Cannot access memory at address 0x61c000
What happens in this case, is that the compiler describes our array
as an array with a specific stride (and bounds being static 1..3):
<1><749>: Abbrev Number: 10 (DW_TAG_array_type)
<74a> DW_AT_name : (indirect string, offset: 0xb6d): pck__T18s
<74e> DW_AT_byte_stride : 16
<74f> DW_AT_type : <0x6ea>
<2><757>: Abbrev Number: 11 (DW_TAG_subrange_type)
<758> DW_AT_type : <0x75e>
<75c> DW_AT_upper_bound : 3
This is because we cannot use, in this case, the size of the record
to determine that stride, since the size of the record depends on
its contents. So the compiler helps us by providing that stride.
The problems start when trying to resolve that type. Because the elements
contained in that array type are dynamic, the array itself is considered
dynamic, and thus we end up creating a resolved version of that array.
And during that resolution, we were not handling the case where the array
had a stride. See gdbtypes.c::resolve_dynamic_array...
return create_array_type (copy_type (type),
elt_type,
range_type);
As a result, we created an array whose stride was based on the size
of elt_type, which a record whose size isn't static and irrelevant
regardless.
This patch fixes is by calling create_array_type_with_stride instead.
As it happens, there is another issue for us to be able to print
the value of our array, but those are independent of this patch
and will be handled separately. For now, the patch allows us to
get rid of the first error, and the output is now:
(gdb) p a1
$1 = (
gdb/ChangeLog:
* gdbtypes.c (resolve_dynamic_array): Use
create_array_type_with_stride instead of create_array_type.
2015-03-31 14:59:35 +00:00
|
|
|
|
2015-05-05 Joel Brobecker <brobecker@adacore.com>
|
|
|
|
|
|
|
|
|
|
* gdbtypes.c (resolve_dynamic_array): Use
|
|
|
|
|
create_array_type_with_stride instead of create_array_type.
|
|
|
|
|
|
2015-04-30 19:25:49 +00:00
|
|
|
|
2015-04-30 DJ Delorie <dj@redhat.com>
|
|
|
|
|
|
|
|
|
|
* rl78-tdep.c (rl78_analyze_prologue): Pass RL78_ISA_DEFAULT to
|
|
|
|
|
rl78_decode_opcode
|
|
|
|
|
|
2015-04-29 20:24:21 +00:00
|
|
|
|
2015-04-29 Doug Evans <dje@google.com>
|
|
|
|
|
|
|
|
|
|
PR python/18285
|
|
|
|
|
* NEWS: Document new gdb.XMethodWorker.get_result_type method.
|
|
|
|
|
* eval.c (evaluate_subexp_standard) <OP_FUNCALL>: Handle
|
|
|
|
|
EVAL_AVOID_SIDE_EFFECTS for xmethods.
|
|
|
|
|
* extension-priv.h (struct extension_language_ops)
|
|
|
|
|
<get_xmethod_result_type>: New member.
|
|
|
|
|
* extension.c (get_xmethod_result_type): New function.
|
|
|
|
|
* extension.h (get_xmethod_result_type): Declare.
|
|
|
|
|
* python/py-xmethods.c (get_result_type_method_name): New static
|
|
|
|
|
global.
|
|
|
|
|
(py_get_result_type_method_name): Ditto.
|
|
|
|
|
(gdbpy_get_xmethod_result_type): New function.
|
|
|
|
|
(gdbpy_initialize_xmethods): Initialize py_get_result_type_method_name.
|
|
|
|
|
* python/python-internal.h (gdbpy_get_xmethod_result_type): Declare.
|
|
|
|
|
* python/python.c (python_extension_ops): Add
|
|
|
|
|
gdbpy_get_xmethod_result_type.
|
|
|
|
|
* python/lib/gdb/xmethod.py (XMethodWorker): Add get_result_type.
|
|
|
|
|
* valarith.c (value_x_binop): Handle EVAL_AVOID_SIDE_EFFECTS for
|
|
|
|
|
xmethods.
|
|
|
|
|
(value_x_unop): Ditto.
|
|
|
|
|
* value.c (result_type_of_xmethod): New function.
|
|
|
|
|
* value.h (result_type_of_xmethod): Declare.
|
|
|
|
|
|
2015-04-29 14:20:22 +00:00
|
|
|
|
2015-04-29 Gary Benson <gbenson@redhat.com>
|
|
|
|
|
|
|
|
|
|
* solib.c (solib_find_1): Allow fd argument to be NULL.
|
|
|
|
|
(exec_file_find): Update comment.
|
|
|
|
|
(solib_find): Likewise.
|
|
|
|
|
* exec.c (exec_file_locate_attach): Use NULL as fd
|
|
|
|
|
argument to exec_file_find to avoid having to close
|
|
|
|
|
the opened file.
|
|
|
|
|
* infrun.c (follow_exec): Likewise.
|
|
|
|
|
|
2015-04-29 05:14:23 +00:00
|
|
|
|
2015-04-28 Doug Evans <dje@google.com>
|
|
|
|
|
|
|
|
|
|
PR python/18299
|
|
|
|
|
* python/lib/gdb/printing.py (register_pretty_printer): Handle
|
|
|
|
|
name or __name__ attributes. Handle gdb module as first argument.
|
|
|
|
|
|
2015-04-29 04:53:54 +00:00
|
|
|
|
2015-04-28 Doug Evans <dje@google.com>
|
|
|
|
|
|
|
|
|
|
PR python/18089
|
|
|
|
|
* python/py-prettyprint.c (print_children): Verify result of children
|
|
|
|
|
iterator. Provide better error message.
|
|
|
|
|
* python/python-internal..h (gdbpy_print_python_errors_p): Declare.
|
|
|
|
|
* python/python.c (gdbpy_print_python_errors_p): New function.
|
|
|
|
|
|
2015-04-29 04:23:24 +00:00
|
|
|
|
2015-04-28 Doug Evans <dje@google.com>
|
|
|
|
|
|
|
|
|
|
* gdbtypes.h (struct cplus_struct_type) <n_baseclasses>: Fix comment.
|
|
|
|
|
|
2015-04-29 00:41:09 +00:00
|
|
|
|
2015-04-28 Sasha Smundak <asmundak@google.com>
|
|
|
|
|
|
|
|
|
|
* NEWS: Mention gdb.Type.optimized_out method.
|
|
|
|
|
* python/py-type.c (typy_optimized_out): New function.
|
|
|
|
|
|
2015-04-28 15:30:23 +00:00
|
|
|
|
2015-04-28 John Baldwin <jhb@FreeBSD.org>
|
|
|
|
|
|
|
|
|
|
* fbsd-nat.c: Include "gdb_wait.h" instead of <sys/wait.h>.
|
|
|
|
|
|
2015-04-23 23:28:32 +00:00
|
|
|
|
2015-04-28 Patrick Palka <patrick@parcs.ath.cx>
|
|
|
|
|
|
|
|
|
|
* utils.c (init_page_info): Set rl_catch_sigwinch to zero.
|
|
|
|
|
(initialize_utils): Move call of init_page_info() to ...
|
|
|
|
|
* top.c (gdb_init): ... here.
|
|
|
|
|
|
2015-04-23 22:36:58 +00:00
|
|
|
|
2015-04-28 Patrick Palka <patrick@parcs.ath.cx>
|
|
|
|
|
|
|
|
|
|
* tui/tui-win.c (tui_sigwinch_handler): Remove now-stale comment.
|
|
|
|
|
(tui_sigwinch_handler): Still update our idea of
|
|
|
|
|
the terminal's width and height even when TUI is not active.
|
|
|
|
|
|
2015-04-23 22:31:38 +00:00
|
|
|
|
2015-04-28 Patrick Palka <patrick@parcs.ath.cx>
|
|
|
|
|
|
|
|
|
|
* utils.h (set_screen_width_and_height): Declare.
|
|
|
|
|
* utils.c (set_screen_width_and_height): Define.
|
|
|
|
|
* tui/tui-win.c (tui_update_gdb_sizes): Use it.
|
|
|
|
|
|
2015-04-28 11:21:32 +00:00
|
|
|
|
2015-04-28 Gary Benson <gbenson@redhat.com>
|
|
|
|
|
|
|
|
|
|
* infrun.c (solist.h): New include.
|
|
|
|
|
(follow_exec): Use exec_file_find to prefix execd_pathname
|
|
|
|
|
with gdb_sysroot.
|
|
|
|
|
|
2015-04-25 14:29:29 +00:00
|
|
|
|
2015-04-28 Patrick Palka <patrick@parcs.ath.cx>
|
|
|
|
|
|
|
|
|
|
* tui/tui-source.c (tui_set_source_content): Avoid calling
|
|
|
|
|
strcpy() when offset is 0.
|
|
|
|
|
|
2015-04-26 01:59:02 +00:00
|
|
|
|
2015-04-28 Patrick Palka <patrick@parcs.ath.cx>
|
|
|
|
|
|
|
|
|
|
PR gdb/18155
|
|
|
|
|
* tui/tui-data.c (tui_free_window): Don't free the locator
|
|
|
|
|
window when passed an SRC_WIN or a DISASSEM_WIN.
|
|
|
|
|
|
2015-04-24 12:26:50 +00:00
|
|
|
|
2015-04-28 Patrick Palka <patrick@parcs.ath.cx>
|
|
|
|
|
|
|
|
|
|
* tui/tui-data.h (struct tui_win_element): Forward-declare.
|
|
|
|
|
(tui_win_content): Move declaration.
|
|
|
|
|
(struct tui_gen_win_info): Give 'content' field the
|
|
|
|
|
type tui_win_content.
|
|
|
|
|
* tui/tui-data.c (init_content_element): Remove redundant and
|
|
|
|
|
erroneous casts.
|
|
|
|
|
(tui_add_content_elements): Remove erroneous cast.
|
|
|
|
|
* tui/tui-disasm.c (tui_set_disassem_content): Remove redundant
|
|
|
|
|
casts.
|
|
|
|
|
(tui_get_begin_asm_address): Likewise.
|
|
|
|
|
* tui/tui-regs.c (tui_show_registers): Likewise.
|
|
|
|
|
(tui_show_register_group): Likewise.
|
|
|
|
|
(tui_display_registers_from): Likewise.
|
|
|
|
|
(tui_check_register_values): Likewise.
|
|
|
|
|
* tui/tui-source.c (tui_set_source_content): Likewise.
|
|
|
|
|
(tui_set_source_content_nil): Likewise.
|
|
|
|
|
(tui_source_is_displayed): Likewise.
|
|
|
|
|
* tui/tui-stack.c (tui_show_locator_content): Likewise.
|
|
|
|
|
(tui_set_locator_fullname): Likewise.
|
|
|
|
|
(tui_set_locator_info): Likewise.
|
|
|
|
|
(tui_show_frame_info): Likewise.
|
|
|
|
|
* tui/tui-winsource.c (tui_clear_source_content): Likewise.
|
|
|
|
|
(tui_show_source_line): Likewise.
|
|
|
|
|
(tui_horizontal_source_scroll): Likewise.
|
|
|
|
|
(tui_update_breakpoint_info): Likewise.
|
|
|
|
|
(tui_set_exec_info_content): Likewise.
|
|
|
|
|
(tui_show_exec_info_content): Likewise.
|
|
|
|
|
(tui_alloc_source_buffer): Likewise.
|
|
|
|
|
(tui_line_is_displayed): Likewise.
|
|
|
|
|
(tui_addr_is_displayed): Likewise.
|
|
|
|
|
|
2015-04-18 05:00:06 +00:00
|
|
|
|
2015-04-27 John Baldwin <jhb@FreeBSD.org>
|
|
|
|
|
|
|
|
|
|
* fbsd-nat.c: (fbsd_wait) [PL_FLAG_EXEC]: Report TARGET_WAITKIND_EXECD
|
|
|
|
|
event if PL_FLAG_EXEC is set.
|
|
|
|
|
[PL_FLAG_EXEC] (fbsd_insert_exec_catchpoint): New function.
|
|
|
|
|
[PL_FLAG_EXEC] (fbsd_remove_exec_catchpoint): New function.
|
|
|
|
|
(fbsd_nat_add_target) [PL_FLAG_EXEC]: Set
|
|
|
|
|
"to_insert_exec_catchpoint" to "fbsd_insert_exec_catchpoint".
|
|
|
|
|
Set "to_remove_exec_catchpoint" to "fbsd_remove_exec_catchpoint".
|
|
|
|
|
|
2015-04-17 20:20:47 +00:00
|
|
|
|
2015-04-27 John Baldwin <jhb@FreeBSD.org>
|
|
|
|
|
|
|
|
|
|
* fbsd-nat.c: [PT_LWPINFO] New variable super_wait.
|
|
|
|
|
[TDP_RFPPWAIT] New variable fbsd_pending_children.
|
|
|
|
|
[TDP_RFPPWAIT] (fbsd_remember_child): New function.
|
|
|
|
|
[TDP_RFPPWAIT] (fbsd_is_child_pending): New function.
|
|
|
|
|
[TDP_RFPPWAIT] (fbsd_fetch_kinfo_proc): New function.
|
|
|
|
|
[PT_LWPINFO] (fbsd_wait): New function.
|
|
|
|
|
[TDP_RFPPWAIT] (fbsd_follow_fork): New function.
|
|
|
|
|
[TDP_RFPPWAIT] (fbsd_insert_fork_catchpoint): New function.
|
|
|
|
|
[TDP_RFPPWAIT] (fbsd_remove_fork_catchpoint): New function.
|
|
|
|
|
[TDP_RFPPWAIT] (fbsd_insert_vfork_catchpoint): New function.
|
|
|
|
|
[TDP_RFPPWAIT] (fbsd_remove_vfork_catchpoint): New function.
|
|
|
|
|
[TDP_RFPPWAIT] (fbsd_enable_follow_fork): New function.
|
|
|
|
|
[TDP_RFPPWAIT] (fbsd_post_startup_inferior): New function.
|
|
|
|
|
[TDP_RFPPWAIT] (fbsd_post_attach): New function.
|
|
|
|
|
(fbsd_nat_add_target) [PT_LWPINFO] Set "to_wait" to
|
|
|
|
|
"fbsd_wait".
|
|
|
|
|
[TDP_RFPPWAIT] Set "to_follow_fork" to "fbsd_follow_fork".
|
|
|
|
|
Set "to_insert_fork_catchpoint" to "fbsd_insert_fork_catchpoint".
|
|
|
|
|
Set "to_remove_fork_catchpoint" to "fbsd_remove_fork_catchpoint".
|
|
|
|
|
Set "to_insert_vfork_catchpoint" to "fbsd_insert_vfork_catchpoint".
|
|
|
|
|
Set "to_remove_vfork_catchpoint" to "fbsd_remove_vfork_catchpoint".
|
|
|
|
|
Set "to_post_startup_inferior" to "fbsd_post_startup_inferior".
|
|
|
|
|
Set "to_post_attach" to "fbsd_post_attach".
|
|
|
|
|
|
2015-04-17 18:02:03 +00:00
|
|
|
|
2015-04-27 John Baldwin <jhb@FreeBSD.org>
|
|
|
|
|
|
|
|
|
|
* fbsd-nat.c (fbsd_pid_to_exec_file): Mark static.
|
|
|
|
|
(fbsd_find_memory_regions): Mark static.
|
|
|
|
|
(fbsd_nat_add_target): New function.
|
|
|
|
|
* fbsd-nat.h: Export fbsd_nat_add_target and remove prototypes for
|
|
|
|
|
fbsd_pid_to_exec_file and fbsd_find_memory_regions.
|
|
|
|
|
* amd64fbsd-nat.c (_initialize_amd64fbsd_nat): Use fbsd_nat_add_target.
|
|
|
|
|
* i386fbsd-nat.c (_initialize_i386fbsd_nat): Likewise.
|
|
|
|
|
* ppcfbsd-nat.c (_initialize_ppcfbsd_nat): Likewise.
|
|
|
|
|
* sparc64fbsd-nat.c (_initialize_sparc64fbsd_nat): Likewise.
|
|
|
|
|
|
2015-04-27 10:46:13 +00:00
|
|
|
|
2015-04-27 Gary Benson <gbenson@redhat.com>
|
|
|
|
|
|
|
|
|
|
* objfiles.c (allocate_objfile): Do not attempt to expand name
|
|
|
|
|
if name is a "target:" filename.
|
|
|
|
|
* auto-load.c (load_auto_scripts_for_objfile): Do not attempt
|
|
|
|
|
to load auto-load scripts for objfiles with "target:" filenames.
|
|
|
|
|
|
2015-04-27 09:38:47 +00:00
|
|
|
|
2015-04-27 Andreas Arnez <arnez@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
* s390-linux-tdep.c: Include "elf/s390.h" and "elf-bfd.h".
|
|
|
|
|
(enum s390_vector_abi_kind): New enum.
|
|
|
|
|
(struct gdbarch_tdep)<vector_abi>: New field.
|
|
|
|
|
(s390_effective_inner_type): Add parameter min_size. Stop
|
|
|
|
|
unwrapping if the inner type is smaller than min_size.
|
|
|
|
|
(s390_function_arg_float): Adjust call to
|
|
|
|
|
s390_effective_inner_type.
|
|
|
|
|
(s390_function_arg_vector): New function.
|
|
|
|
|
(s390_function_arg_integer): Adjust comment.
|
|
|
|
|
(struct s390_arg_state)<vr>: New field.
|
|
|
|
|
(s390_handle_arg): Add parameter 'is_unnamed'. Pass vector
|
|
|
|
|
arguments according to vector ABI when appropriate.
|
|
|
|
|
(s390_push_dummy_call): Initialize the argument state's field
|
|
|
|
|
'vr'. Adjust calls to s390_handle_arg.
|
|
|
|
|
(s390_register_return_value): Handle vector return values.
|
|
|
|
|
(s390_return_value): Apply the "register" return value convention
|
|
|
|
|
to a vector when appropriate.
|
|
|
|
|
(s390_gdbarch_init): Initialize tdep->vector_abi.
|
|
|
|
|
* NEWS: Announce S390 vector ABI support.
|
|
|
|
|
|
2015-04-27 09:38:47 +00:00
|
|
|
|
2015-04-27 Andreas Arnez <arnez@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
* s390-linux-tdep.c (s390_return_value_convention): Remove
|
|
|
|
|
function. Inline its logic...
|
|
|
|
|
(s390_return_value): ...here. Instead, move the handling of the
|
|
|
|
|
"register" return value convention...
|
|
|
|
|
(s390_register_return_value): ...here. New function.
|
|
|
|
|
|
2015-04-27 09:38:46 +00:00
|
|
|
|
2015-04-27 Andreas Arnez <arnez@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
* s390-linux-tdep.c
|
|
|
|
|
(is_float_singleton): Remove function. Move the "singleton" part
|
|
|
|
|
of the logic...
|
|
|
|
|
(s390_effective_inner_type): ...here. New function.
|
|
|
|
|
(is_float_like): Remove function. Inline its logic...
|
|
|
|
|
(s390_function_arg_float): ...here.
|
|
|
|
|
(is_pointer_like, is_integer_like, is_struct_like): Remove
|
|
|
|
|
functions. Inline their logic...
|
|
|
|
|
(s390_function_arg_integer): ...here.
|
|
|
|
|
(s390_function_arg_pass_by_reference): Remove function.
|
|
|
|
|
(extend_simple_arg): Remove function.
|
|
|
|
|
(alignment_of): Remove function.
|
|
|
|
|
(struct s390_arg_state): New structure.
|
|
|
|
|
(s390_handle_arg): New function.
|
|
|
|
|
(s390_push_dummy_call): Move parameter placement logic to the new
|
|
|
|
|
function s390_handle_arg. Call it for calculating the stack area
|
|
|
|
|
sizes first, and again for actually writing the parameters.
|
|
|
|
|
|
2015-04-27 09:38:46 +00:00
|
|
|
|
2015-04-27 Andreas Arnez <arnez@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
* s390-linux-tdep.c (is_power_of_two): Add comment. Return
|
|
|
|
|
false if the argument is zero.
|
|
|
|
|
|
2015-04-27 09:06:07 +00:00
|
|
|
|
2015-04-27 Pierre-Marie de Rodat <derodat@adacore.com>
|
|
|
|
|
|
|
|
|
|
* ada-lang.c (template_to_static_fixed_type): Return input type
|
|
|
|
|
when it is already fixed. Cache the input type itself when not
|
|
|
|
|
creating a static fixed copy. Make it explicit that we never
|
|
|
|
|
molestate the input type.
|
|
|
|
|
* gdbtypes.c (resolve_dynamic_struct): Reset the
|
|
|
|
|
TYPE_TARGET_TYPE field for resolved copies.
|
|
|
|
|
|
2015-04-27 09:04:47 +00:00
|
|
|
|
2015-04-27 Joel Brobecker <brobecker@adacore.com>
|
|
|
|
|
|
|
|
|
|
* ada-lang.c (ada_is_tagged_type): Add call to ada_check_typedef.
|
|
|
|
|
(ada_lookup_struct_elt_type): Remove calls to ada_check_typedef.
|
|
|
|
|
(template_to_static_fixed_type): Call ada_check_typedef only
|
|
|
|
|
when necessary.
|
|
|
|
|
|
2015-04-23 21:18:55 +00:00
|
|
|
|
2015-04-24 Andrew Burgess <andrew.burgess@embecosm.com>
|
|
|
|
|
|
|
|
|
|
* cli/cli-dump.c (srec_dump_command): Add internationalization
|
|
|
|
|
mark ups.
|
|
|
|
|
(ihex_dump_command): Likewise.
|
|
|
|
|
(tekhex_dump_command): Likewise.
|
|
|
|
|
(binary_dump_command): Likewise.
|
|
|
|
|
(binary_append_command): Likewise.
|
|
|
|
|
|
2015-04-22 21:52:36 +00:00
|
|
|
|
2015-04-24 Andrew Burgess <andrew.burgess@embecosm.com>
|
|
|
|
|
|
|
|
|
|
* cli/cli-dump.c (verilog_cmdlist): New variable.
|
|
|
|
|
(dump_verilog_memory): New function.
|
|
|
|
|
(dump_verilog_value): New function.
|
|
|
|
|
(verilog_dump_command): New function.
|
|
|
|
|
(_initialize_cli_dump): Add new commands to support verilog dump
|
|
|
|
|
format.
|
|
|
|
|
* NEWS: Add entry for "dump verilog".
|
|
|
|
|
|
2015-04-24 14:13:19 +00:00
|
|
|
|
2015-04-24 Pierre-Marie de Rodat <derodat@adacore.com>
|
|
|
|
|
|
|
|
|
|
* gdbtypes.c (print_gnat_stuff): Do not recurse on the
|
|
|
|
|
descriptive type when there is none.
|
|
|
|
|
|
Explicitly call rl_resize_terminal() in TUI's SIGWINCH handler
In readline 6.3, the semantics of SIGWINCH handling has changed.
When a SIGWINCH signal is raised, readline's rl_sigwinch_handler() now
does not immediately call rl_resize_terminal(). Instead it sets a flag
that is checked by RL_CHECK_SIGNALS() at a point where readline has
control, and calls rl_resize_terminal() if said flag is set.
This change is item (c) in https://cnswww.cns.cwru.edu/php/chet/readline/CHANGES
c. Fixed a bug that caused readline to try and run code to modify its idea
of the screen size in a signal handler context upon receiving a SIGWINCH.
This change in behavior is important to us because TUI's
tui_sigwinch_handler() relies on the assumption that by the time it's
called, readline will have updated its knowledge of the terminal
dimensions via rl_resize_terminal(). Since this assumption no longer
holds true, TUI's SIGWINCH handling does not work correctly with
readline 6.3.
To fix this issue this patch makes TUI explicitly call
rl_resize_terminal() in tui_async_resize_screen() at the point where
current terminal dimensions are needed. (We could call it in
tui_sigwinch_handler too, but since readline avoids doing it, we are
probably safer off avoiding to call it in signal handler context as
well.) After this change, SIGWINCH handling continues to work properly
with both readline 6.2 and 6.3.
Since we no longer need it, we could now explicitly disable readline's
SIGWINCH handler by setting rl_catch_sigwinch to zero early on in the
program startup but I can't seem to find a good spot to place this
assignment (the first call to rl_initialize() occurs in
tui_initialize_readline() so the assignment should occur before then),
and the handler is harmless anyway.
gdb/ChangeLog:
* tui/tui-win.c (tui_async_resize_screen): Call
rl_resize_terminal().
2015-04-22 23:25:55 +00:00
|
|
|
|
2015-04-23 Patrick Palka <patrick@parcs.ath.cx>
|
|
|
|
|
|
|
|
|
|
* tui/tui-win.c (tui_async_resize_screen): Call
|
|
|
|
|
rl_resize_terminal().
|
|
|
|
|
|
windows-nat: Don't change current_event.dwThreadId in handle_output_debug_string()
Using the 'catch-signal' test from the testsuite, on x86_64 Cygwin:
$ ./gdb testsuite/outputs/gdb.base/catch-signal/catch-signal.exe
[...]
(gdb) catch signal
Catchpoint 1 (standard signals)
(gdb) r
[...]
Catchpoint 1 (signal SIGHUP), main () at
../../../gdb/testsuite/gdb.base/catch-signal.c:40
40 raise (SIGHUP); /* second HUP */
(gdb) c
Continuing.
main () at ../../../gdb/testsuite/gdb.base/catch-signal.c:40
40 raise (SIGHUP); /* second HUP */
Failed to resume program execution (ContinueDebugEvent failed, error 87)
(gdb)
This error occurs because when handle_output_debug_string processes a Cygwin
signal message, it re-writes current_event.dwThreadId to reflect the thread that
the signal will be delivered to, which can be different to the thread reporting
the signal.
Altering current_event.dwThreadId() will cause ContinueDebugEvent() to be
applied to the wrong thread and fail.
So, rather than re-writing the thread id in current_event, use the thread
id by returning it.
With this patch applied this test now yields the expected result:
$ ./gdb testsuite/outputs/gdb.base/catch-signal/catch-signal.exe
[...]
(gdb) catch signal
Catchpoint 1 (standard signals)
(gdb) r
[...]
Catchpoint 1 (signal SIGHUP), main () at
../../../gdb/testsuite/gdb.base/catch-signal.c:40
40 raise (SIGHUP); /* second HUP */
(gdb) c
Continuing.
Catchpoint 1 (signal SIGHUP), main () at
../../../gdb/testsuite/gdb.base/catch-signal.c:42
42 raise (SIGHUP); /* third HUP */
(gdb)
gdb/ChangeLog:
2015-04-22 Jon Turney <jon.turney@dronecode.org.uk>
* windows-nat.c (handle_output_debug_string): Don't change
current_event.dwThreadId.
(get_windows_debug_event): Use thread_id, rather than relying on
current_event.dwThreadId being changed.
2015-04-15 20:41:25 +00:00
|
|
|
|
2015-04-22 Jon Turney <jon.turney@dronecode.org.uk>
|
|
|
|
|
|
|
|
|
|
* windows-nat.c (handle_output_debug_string): Don't change
|
|
|
|
|
current_event.dwThreadId.
|
|
|
|
|
(get_windows_debug_event): Use thread_id, rather than relying on
|
|
|
|
|
current_event.dwThreadId being changed.
|
|
|
|
|
|
windows-nat: Report an error if ContinueDebugEvent() fails
Using the 'catch-signal' test from the testsuite, on x86_64 Cygwin:
$ ./gdb testsuite/outputs/gdb.base/catch-signal/catch-signal.exe
[...]
(gdb) catch signal
Catchpoint 1 (standard signals)
(gdb) r
[...]
Catchpoint 1 (signal SIGHUP), main () at
../../../gdb/testsuite/gdb.base/catch-signal.c:40
40 raise (SIGHUP); /* second HUP */
(gdb) c
Continuing.
[hangs]
This is due to a defect in the way Cygwin signals are handled: When
handle_output_debug_string processes a Cygwin signal message, it re-writes
current_event.dwThreadId to reflect the thread that the signal will be delivered
to.
Subsequently, the call to ContinueDebugEvent will fail, because we're trying to
resume the wrong thread. GDB is then stuck waiting forever for another event
that will never come.
This patch doesn't fix the problem, it just adds appropriate error handling.
Using error() seems appropriate here, if ContinueDebugEvent() fails, the
inferior is in an unknown state and we will probably not be debugging it
anymore.
With this patch applied, resuming the execution of the program now yields:
$ ./gdb testsuite/outputs/gdb.base/catch-signal/catch-signal.exe
[...]
(gdb) catch signal
Catchpoint 1 (standard signals)
(gdb) r
[...]
Catchpoint 1 (signal SIGHUP), main () at
../../../gdb/testsuite/gdb.base/catch-signal.c:40
40 raise (SIGHUP); /* second HUP */
(gdb) c
Continuing.
main () at ../../../gdb/testsuite/gdb.base/catch-signal.c:40
40 raise (SIGHUP); /* second HUP */
Failed to resume program execution (ContinueDebugEvent failed, error 87)
(gdb)
gdb/ChangeLog:
2015-04-22 Jon Turney <jon.turney@dronecode.org.uk>
* windows-nat.c (windows_continue): Report an error if
ContinueDebugEvent() fails.
2015-04-15 20:37:11 +00:00
|
|
|
|
2015-04-22 Jon Turney <jon.turney@dronecode.org.uk>
|
|
|
|
|
|
|
|
|
|
* windows-nat.c (windows_continue): Report an error if
|
|
|
|
|
ContinueDebugEvent() fails.
|
|
|
|
|
|
2015-04-14 20:05:21 +00:00
|
|
|
|
2015-04-16 Jon Turney <jon.turney@dronecode.org.uk>
|
|
|
|
|
|
|
|
|
|
* windows-nat.c (windows_resume): Fix misspelling in debug output.
|
|
|
|
|
|
2015-04-14 18:28:44 +00:00
|
|
|
|
2015-04-16 Jon Turney <jon.turney@dronecode.org.uk>
|
|
|
|
|
|
|
|
|
|
* windows-nat.c (get_windows_debug_event): Replace retval with
|
|
|
|
|
thread_id throughout. Update stale comment.
|
|
|
|
|
|
2015-04-14 18:42:07 +00:00
|
|
|
|
2015-04-16 Jon Turney <jon.turney@dronecode.org.uk>
|
|
|
|
|
|
|
|
|
|
* windows-nat.c (get_windows_debug_event): Don't use ternary
|
|
|
|
|
conditional operator.
|
|
|
|
|
|
2015-04-21 20:10:08 +00:00
|
|
|
|
2015-04-21 Pierre Muller <muller@sourceware.org>
|
|
|
|
|
|
|
|
|
|
PR pascal/17815
|
|
|
|
|
p-exp.y (yylex): Reorganize code to return the matched pattern
|
|
|
|
|
for a field of this.
|
|
|
|
|
|
2015-04-21 11:07:54 +00:00
|
|
|
|
2015-04-21 Gary Benson <gbenson@redhat.com>
|
|
|
|
|
|
|
|
|
|
* common/fileio.h (fileio_to_host_openflags): New declaration.
|
|
|
|
|
* common/fileio.c (fcntl.h): New include.
|
|
|
|
|
(fileio_to_host_openflags): New function, factored out from...
|
|
|
|
|
* inf-child.c (inf_child_fileio_open_flags_to_host): ...here.
|
|
|
|
|
Single use updated.
|
|
|
|
|
|
2015-04-21 06:37:44 +00:00
|
|
|
|
2015-04-21 Kevin Buettner <kevinb@redhat.com>
|
|
|
|
|
|
|
|
|
|
* rl78-tdep.c (RL78_SP_ADDR): Define.
|
|
|
|
|
(opc_reg_to_gdb_regnum): New static function.
|
|
|
|
|
(rl78_analyze_prologue): Recognize instructions forming slightly
|
|
|
|
|
more interesting prologues.
|
|
|
|
|
|
2015-04-20 14:06:50 +00:00
|
|
|
|
2015-04-20 Pierre-Marie de Rodat <derodat@adacore.com>
|
|
|
|
|
|
|
|
|
|
Revert:
|
|
|
|
|
2015-04-03 Pierre-Marie de Rodat <derodat@adacore.com>
|
|
|
|
|
* gdbtypes.c (is_dynamic_type_internal): Remove special handling of
|
|
|
|
|
TYPE_CODE_REF types so that they are not considered as dynamic
|
|
|
|
|
depending on the referenced type.
|
|
|
|
|
(resolve_dynamic_type_internal): Likewise.
|
|
|
|
|
|
2015-04-20 14:04:28 +00:00
|
|
|
|
2015-04-20 Pierre-Marie de Rodat <derodat@adacore.com>
|
|
|
|
|
|
|
|
|
|
Revert:
|
|
|
|
|
2015-04-03 Pierre-Marie de Rodat <derodat@adacore.com>
|
|
|
|
|
* gdbtypes.c (is_dynamic_type_internal): Remove the unused
|
|
|
|
|
"top_level" parameter.
|
|
|
|
|
(resolve_dynamic_type_internal): Remove the unused "top_level"
|
|
|
|
|
parameter. Update call to is_dynamic_type_internal.
|
|
|
|
|
(is_dynamic_type): Update call to is_dynamic_type_internal.
|
|
|
|
|
(resolve_dynamic_range): Update call to
|
|
|
|
|
resolve_dynamic_type_internal.
|
|
|
|
|
(resolve_dynamic_union): Likewise.
|
|
|
|
|
(resolve_dynamic_struct): Likewise.
|
|
|
|
|
(resolve_dynamic_type): Likewise.
|
|
|
|
|
|
2015-04-19 22:34:08 +00:00
|
|
|
|
2015-04-19 Gabriel Krisman Bertazi <gabriel@krisman.be>
|
|
|
|
|
|
|
|
|
|
* breakpoint.c (update_dprintf_command_list): Remove duplicated
|
|
|
|
|
xmalloc.
|
|
|
|
|
|
2015-04-19 22:22:32 +00:00
|
|
|
|
2015-04-20 Thomas Schwinge <thomas@codesourcery.com>
|
|
|
|
|
|
2015-04-19 22:31:54 +00:00
|
|
|
|
* reply_mig_hack.awk: Robustify parsing.
|
|
|
|
|
|
2015-04-19 22:22:32 +00:00
|
|
|
|
* reply_mig_hack.awk: Don't bother to declare an intermediate
|
|
|
|
|
function pointer variable.
|
|
|
|
|
|
2015-04-17 17:57:45 +00:00
|
|
|
|
2015-04-17 Doug Evans <dje@google.com>
|
|
|
|
|
|
|
|
|
|
* solib-svr4.c (svr4_exec_displacement): Rename outer "displacement"
|
|
|
|
|
to "exec_displacement" to avoid confusion with inner use of the name.
|
|
|
|
|
|
2015-04-17 12:52:44 +00:00
|
|
|
|
2015-04-17 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* arm-linux-nat.c (arm_linux_can_use_hw_breakpoint): Return zero
|
|
|
|
|
if HW point of TYPE isn't supported.
|
|
|
|
|
|
2015-04-17 12:45:53 +00:00
|
|
|
|
2015-04-17 Yao Qi <yao.qi@linaro.org>
|
|
|
|
|
Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* target.h (target_can_use_hardware_watchpoint): Update comments.
|
|
|
|
|
Remove trailing ";".
|
|
|
|
|
|
2015-04-17 08:47:30 +00:00
|
|
|
|
2015-04-17 Gary Benson <gbenson@redhat.com>
|
|
|
|
|
|
|
|
|
|
* remote.c (remote_add_inferior): New argument try_open_exec.
|
|
|
|
|
If nonzero, attempt to open the inferior's executable file as
|
|
|
|
|
the main executable if no main executable is open already.
|
|
|
|
|
All callers updated.
|
|
|
|
|
* NEWS: Mention that GDB now supports automatic location and
|
|
|
|
|
retrieval of executable + files from remote targets.
|
|
|
|
|
|
2015-04-17 08:47:30 +00:00
|
|
|
|
2015-04-17 Gary Benson <gbenson@redhat.com>
|
|
|
|
|
|
|
|
|
|
* target.h (TARGET_OBJECT_EXEC_FILE): New enum value.
|
|
|
|
|
* remote.c (PACKET_qXfer_exec_file): Likewise.
|
|
|
|
|
(remote_protocol_features): Register the
|
|
|
|
|
"qXfer:exec-file:read" feature.
|
|
|
|
|
(remote_xfer_partial): Handle TARGET_OBJECT_EXEC_FILE.
|
|
|
|
|
(remote_pid_to_exec_file): New function.
|
|
|
|
|
(init_remote_ops): Initialize to_pid_to_exec_file.
|
|
|
|
|
(_initialize_remote): Register new "set/show remote
|
|
|
|
|
pid-to-exec-file-packet" command.
|
|
|
|
|
* NEWS: Announce new qXfer:exec-file:read packet.
|
|
|
|
|
|
2015-04-17 08:47:30 +00:00
|
|
|
|
2015-04-17 Gary Benson <gbenson@redhat.com>
|
|
|
|
|
|
|
|
|
|
* nat/linux-procfs.h (linux_proc_pid_to_exec_file):
|
|
|
|
|
New declaration.
|
|
|
|
|
* nat/linux-procfs.c (linux_proc_pid_to_exec_file):
|
|
|
|
|
New function, factored out from...
|
|
|
|
|
* linux-nat.c (linux_child_pid_to_exec_file): ...here.
|
|
|
|
|
|
2015-04-17 08:47:30 +00:00
|
|
|
|
2015-04-17 Gary Benson <gbenson@redhat.com>
|
|
|
|
|
|
|
|
|
|
* exec.c (solist.h): New include.
|
|
|
|
|
(exec_file_locate_attach): Prefix absolute executable
|
|
|
|
|
paths with gdb_sysroot if set.
|
|
|
|
|
* NEWS: Mention that executable paths may be prepended
|
|
|
|
|
with sysroot.
|
|
|
|
|
|
2015-04-17 08:47:30 +00:00
|
|
|
|
2015-04-17 Gary Benson <gbenson@redhat.com>
|
|
|
|
|
|
|
|
|
|
* solist.h (exec_file_find): New declaration.
|
|
|
|
|
* solib.c (solib_find_1): New function, factored out from...
|
|
|
|
|
(solib_find): ...here.
|
|
|
|
|
(exec_file_find): New function.
|
|
|
|
|
|
2015-04-17 08:47:30 +00:00
|
|
|
|
2015-04-17 Gary Benson <gbenson@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdbcore.h (exec_file_locate_attach): New declaration.
|
|
|
|
|
* exec.c (exec_file_locate_attach): New function, factored
|
|
|
|
|
out from...
|
|
|
|
|
* infcmd.c (attach_command_post_wait): ...here.
|
|
|
|
|
|
2015-04-02 04:51:25 +00:00
|
|
|
|
2015-04-17 Mike Frysinger <vapier@gentoo.org>
|
|
|
|
|
|
|
|
|
|
* MAINTAINERS: Add myself for Blackfin/write-after-approval.
|
|
|
|
|
|
Honour software single step in fallback of displaced stepping
Hi,
When I run gdb.threads/non-stop-fair-events.exp on arm-linux target,
I see the following message in the debugging log,
displaced: breakpoint is gone: Thread 22518, step(1)^M
Sending packet: $vCont;s:p57f3.57f6#9d...
^^^^^^^^^
GDB sends vCont;s by mistake, and GDBserver fails on assert. GDB
doesn't consider software single step in infrun.c:displaced_step_fixup,
/* Go back to what we were trying to do. */
step = currently_stepping (tp);
if (debug_displaced)
fprintf_unfiltered (gdb_stdlog,
"displaced: breakpoint is gone: %s, step(%d)\n",
target_pid_to_str (tp->ptid), step);
target_resume (ptid, step, GDB_SIGNAL_0);
The patch is to let GDB consider software single step here. It fixes
fails in gdb.threads/non-stop-fair-events.exp on arm.
gdb:
2015-04-16 Yao Qi <yao.qi@linaro.org>
* infrun.c (maybe_software_singlestep): Declare.
(displaced_step_fixup): Call maybe_software_singlestep.
2015-04-16 12:48:10 +00:00
|
|
|
|
2015-04-16 Yao Qi <yao.qi@linaro.org>
|
|
|
|
|
|
|
|
|
|
* infrun.c (maybe_software_singlestep): Declare.
|
|
|
|
|
(displaced_step_fixup): Call maybe_software_singlestep.
|
|
|
|
|
|
2015-04-15 21:04:35 +00:00
|
|
|
|
2015-04-15 Doug Evans <dje@google.com>
|
|
|
|
|
|
|
|
|
|
* psymtab.c (psym_expand_symtabs_matching): Add QUIT call.
|
|
|
|
|
|
2015-04-15 20:25:42 +00:00
|
|
|
|
2015-04-15 Doug Evans <dje@google.com>
|
|
|
|
|
|
|
|
|
|
* dwarf2read.c (dw2_expand_symtabs_matching): Add some QUIT calls.
|
|
|
|
|
|
2015-04-15 15:54:33 +00:00
|
|
|
|
2015-04-15 Simon Marchi <simon.marchi@ericsson.com>
|
|
|
|
|
|
|
|
|
|
* python/lib/gdb/command/unwinders.py: Add parentheses.
|
|
|
|
|
|
2015-04-15 14:09:53 +00:00
|
|
|
|
2015-04-15 Yao Qi <yao.qi@linaro.org>
|
|
|
|
|
|
|
|
|
|
* arm-linux-tdep.c (arm_linux_copy_svc): Update debug message.
|
|
|
|
|
|
2015-04-15 13:55:04 +00:00
|
|
|
|
2015-04-15 Yao Qi <yao.qi@linaro.org>
|
|
|
|
|
|
|
|
|
|
* arm-linux-tdep.c (arm_linux_copy_svc): Fix indentation.
|
|
|
|
|
|
2015-04-15 13:34:03 +00:00
|
|
|
|
2015-04-15 Yao Qi <yao.qi@linaro.org>
|
|
|
|
|
|
|
|
|
|
* arm-linux-tdep.c (arm_linux_cleanup_svc): Use
|
|
|
|
|
dsc->insn_size instead of 4.
|
|
|
|
|
|
2015-04-14 11:35:30 +00:00
|
|
|
|
2015-04-14 Gary Benson <gbenson@redhat.com>
|
|
|
|
|
|
|
|
|
|
* jit.c (mem_bfd_iovec_stat): Zero supplied buffer.
|
|
|
|
|
* minidebug.c (lzma_stat): Likewise.
|
|
|
|
|
* solib-spu.c (spu_bfd_iovec_stat): Likewise.
|
|
|
|
|
* spu-linux-nat.c (spu_bfd_iovec_stat): Likewise.
|
|
|
|
|
|
2015-04-10 18:06:52 +00:00
|
|
|
|
2015-04-13 Stan Shebs <stanshebs@google.com>
|
|
|
|
|
|
|
|
|
|
* MAINTAINERS: Update my email address.
|
|
|
|
|
|
2015-02-21 21:43:30 +00:00
|
|
|
|
2015-04-13 John Baldwin <jhb@FreeBSD.org>
|
|
|
|
|
|
|
|
|
|
* amd64-tdep.c (amd64_target_description): New function.
|
|
|
|
|
* amd64-tdep.h: Export amd64_target_description and tdesc_amd64.
|
|
|
|
|
* amd64bsd-nat.c [PT_GETXSTATE_INFO]: New variable amd64bsd_xsave_len.
|
|
|
|
|
(amd64bsd_fetch_inferior_registers) [PT_GETXSTATE_INFO]: Handle
|
|
|
|
|
x86 extended save area.
|
|
|
|
|
(amd64bsd_store_inferior_registers) [PT_GETXSTATE_INFO]: Likewise.
|
|
|
|
|
* amd64bsd-nat.h: Export amd64bsd_xsave_len.
|
|
|
|
|
* amd64fbsd-nat.c (amd64fbsd_read_description): New function.
|
|
|
|
|
(_initialize_amd64fbsd_nat): Set "to_read_description" to
|
|
|
|
|
"amd64fbsd_read_description".
|
|
|
|
|
* amd64fbsd-tdep.c (amd64fbsd_core_read_description): New function.
|
|
|
|
|
(amd64fbsd_supply_xstateregset): New function.
|
|
|
|
|
(amd64fbsd_collect_xstateregset): New function.
|
|
|
|
|
Add "amd64fbsd_xstateregset".
|
|
|
|
|
(amd64fbsd_iterate_over_regset_sections): New function.
|
|
|
|
|
(amd64fbsd_init_abi): Set "xsave_xcr0_offset" to
|
|
|
|
|
"I386_FBSD_XSAVE_XCR0_OFFSET".
|
|
|
|
|
Add "iterate_over_regset_sections" gdbarch method.
|
|
|
|
|
Add "core_read_description" gdbarch method.
|
|
|
|
|
* i386-tdep.c (i386_target_description): New function.
|
|
|
|
|
* i386-tdep.h: Export i386_target_description and tdesc_i386.
|
|
|
|
|
* i386bsd-nat.c [PT_GETXSTATE_INFO]: New variable i386bsd_xsave_len.
|
|
|
|
|
(i386bsd_fetch_inferior_registers) [PT_GETXSTATE_INFO]: Handle
|
|
|
|
|
x86 extended save area.
|
|
|
|
|
(i386bsd_store_inferior_registers) [PT_GETXSTATE_INFO]: Likewise.
|
|
|
|
|
* i386bsd-nat.h: Export i386bsd_xsave_len.
|
|
|
|
|
* i386fbsd-nat.c (i386fbsd_read_description): New function.
|
|
|
|
|
(_initialize_i386fbsd_nat): Set "to_read_description" to
|
|
|
|
|
"i386fbsd_read_description".
|
|
|
|
|
* i386fbsd-tdep.c (i386fbsd_core_read_xcr0): New function.
|
|
|
|
|
(i386fbsd_core_read_description): New function.
|
|
|
|
|
(i386fbsd_supply_xstateregset): New function.
|
|
|
|
|
(i386fbsd_collect_xstateregset): New function.
|
|
|
|
|
Add "i386fbsd_xstateregset".
|
|
|
|
|
(i386fbsd_iterate_over_regset_sections): New function.
|
|
|
|
|
(i386fbsd4_init_abi): Set "xsave_xcr0_offset" to
|
|
|
|
|
"I386_FBSD_XSAVE_XCR0_OFFSET".
|
|
|
|
|
Add "iterate_over_regset_sections" gdbarch method.
|
|
|
|
|
Add "core_read_description" gdbarch method.
|
|
|
|
|
* i386fbsd-tdep.h: New file.
|
|
|
|
|
|
Remove --xdb
Pedro Alves:
The commands that enables aren't even documented in the manual.
Judging from that, I assume that only wdb users would ever really
be using the --xdb switch.
I think it's time to drop "support" for the --xdb switch too. I
looked through the commands that that exposes, the only that looked
potentially interesting was "go", but then it's just an alias
for "tbreak+jump", which can easily be done with "define go...end".
I'd rather free up the "go" name for something potentially
more interesting (either run control, or maybe even unrelated,
e.g., for golang).
gdb/ChangeLog
2015-04-11 Jan Kratochvil <jan.kratochvil@redhat.com>
* NEWS (Changes since GDB 7.9): Add removed -xdb.
* breakpoint.c (command_line_is_silent): Remove xdb_commands
conditional.
(_initialize_breakpoint): Remove xdb_commands for bc, ab, sb, db, ba
and lb.
* cli/cli-cmds.c (_initialize_cli_cmds): Remove xdb_commands for v and
va.
* cli/cli-decode.c (find_command_name_length): Remove xdb_commands
conditional.
* defs.h (xdb_commands): Remove declaration.
* f-valprint.c (_initialize_f_valprint): Remove xdb_commands for lc.
* guile/scm-cmd.c (command_classes): Remove xdb from comment.
* infcmd.c (run_no_args_command, go_command): Remove.
(_initialize_infcmd): Remove xdb_commands for S, go, g, R and lr.
* infrun.c (xdb_handle_command): Remove.
(_initialize_infrun): Remove xdb_commands for lz and z.
* main.c (xdb_commands): Remove variable.
(captured_main): Remove "xdb" from long_options.
(print_gdb_help): Remove --xdb from help.
* python/py-cmd.c (gdbpy_initialize_commands): Remove xdb from comment.
* source.c (_initialize_source): Remove xdb_commands for D, ld, / and ?.
* stack.c (backtrace_full_command, args_plus_locals_info)
(current_frame_command): Remove.
(_initialize_stack): Remove xdb_commands for t, T and l.
* symtab.c (_initialize_symtab): Remove xdb_commands for lf and lg.
* thread.c (_initialize_thread): Remove xdb_commands condition.
* tui/tui-layout.c (tui_toggle_layout_command)
(tui_toggle_split_layout_command, tui_handle_xdb_layout): Remove.
(_initialize_tui_layout): Remove xdb_commands for td and ts.
* tui/tui-regs.c (tui_scroll_regs_forward_command)
(tui_scroll_regs_backward_command): Remove.
(_initialize_tui_regs): Remove xdb_commands for fr, gr, sr, +r and -r.
* tui/tui-win.c (tui_xdb_set_win_height_command): Remove.
(_initialize_tui_win): Remove xdb_commands for U and w.
* utils.c (pagination_on_command, pagination_off_command): Remove.
(initialize_utils): Remove xdb_commands for am and sm.
gdb/doc/ChangeLog
2015-04-11 Jan Kratochvil <jan.kratochvil@redhat.com>
* gdb.texinfo (Mode Options): Remove -xdb.
2015-04-11 17:49:03 +00:00
|
|
|
|
2015-04-11 Jan Kratochvil <jan.kratochvil@redhat.com>
|
|
|
|
|
|
|
|
|
|
* NEWS (Changes since GDB 7.9): Add removed -xdb.
|
|
|
|
|
* breakpoint.c (command_line_is_silent): Remove xdb_commands
|
|
|
|
|
conditional.
|
|
|
|
|
(_initialize_breakpoint): Remove xdb_commands for bc, ab, sb, db, ba
|
|
|
|
|
and lb.
|
|
|
|
|
* cli/cli-cmds.c (_initialize_cli_cmds): Remove xdb_commands for v and
|
|
|
|
|
va.
|
|
|
|
|
* cli/cli-decode.c (find_command_name_length): Remove xdb_commands
|
|
|
|
|
conditional.
|
|
|
|
|
* defs.h (xdb_commands): Remove declaration.
|
|
|
|
|
* f-valprint.c (_initialize_f_valprint): Remove xdb_commands for lc.
|
|
|
|
|
* guile/scm-cmd.c (command_classes): Remove xdb from comment.
|
|
|
|
|
* infcmd.c (run_no_args_command, go_command): Remove.
|
|
|
|
|
(_initialize_infcmd): Remove xdb_commands for S, go, g, R and lr.
|
|
|
|
|
* infrun.c (xdb_handle_command): Remove.
|
|
|
|
|
(_initialize_infrun): Remove xdb_commands for lz and z.
|
|
|
|
|
* main.c (xdb_commands): Remove variable.
|
|
|
|
|
(captured_main): Remove "xdb" from long_options.
|
|
|
|
|
(print_gdb_help): Remove --xdb from help.
|
|
|
|
|
* python/py-cmd.c (gdbpy_initialize_commands): Remove xdb from comment.
|
|
|
|
|
* source.c (_initialize_source): Remove xdb_commands for D, ld, / and ?.
|
|
|
|
|
* stack.c (backtrace_full_command, args_plus_locals_info)
|
|
|
|
|
(current_frame_command): Remove.
|
|
|
|
|
(_initialize_stack): Remove xdb_commands for t, T and l.
|
|
|
|
|
* symtab.c (_initialize_symtab): Remove xdb_commands for lf and lg.
|
|
|
|
|
* thread.c (_initialize_thread): Remove xdb_commands condition.
|
|
|
|
|
* tui/tui-layout.c (tui_toggle_layout_command)
|
|
|
|
|
(tui_toggle_split_layout_command, tui_handle_xdb_layout): Remove.
|
|
|
|
|
(_initialize_tui_layout): Remove xdb_commands for td and ts.
|
|
|
|
|
* tui/tui-regs.c (tui_scroll_regs_forward_command)
|
|
|
|
|
(tui_scroll_regs_backward_command): Remove.
|
|
|
|
|
(_initialize_tui_regs): Remove xdb_commands for fr, gr, sr, +r and -r.
|
|
|
|
|
* tui/tui-win.c (tui_xdb_set_win_height_command): Remove.
|
|
|
|
|
(_initialize_tui_win): Remove xdb_commands for U and w.
|
|
|
|
|
* utils.c (pagination_on_command, pagination_off_command): Remove.
|
|
|
|
|
(initialize_utils): Remove xdb_commands for am and sm.
|
|
|
|
|
|
PPC64: Fix step-over-trips-on-watchpoint.exp with displaced stepping on
PPC64 currently fails this test like:
FAIL: gdb.threads/step-over-trips-on-watchpoint.exp: displaced=on: no thread-specific bp: step: step
FAIL: gdb.threads/step-over-trips-on-watchpoint.exp: displaced=on: no thread-specific bp: next: next
FAIL: gdb.threads/step-over-trips-on-watchpoint.exp: displaced=on: no thread-specific bp: continue: continue (the program exited)
FAIL: gdb.threads/step-over-trips-on-watchpoint.exp: displaced=on: with thread-specific bp: step: step
FAIL: gdb.threads/step-over-trips-on-watchpoint.exp: displaced=on: with thread-specific bp: next: next
FAIL: gdb.threads/step-over-trips-on-watchpoint.exp: displaced=on: with thread-specific bp: continue: continue (the program exited)
The problem is that PPC is a non-continuable watchpoints architecture
and the displaced stepping code isn't coping with that correctly. On
such targets/architectures, a watchpoint traps _before_ the
instruction executes/completes. On a watchpoint trap, the PC points
at the instruction that triggers the watchpoint (side effects haven't
happened yet). In order to move past the watchpoint, GDB needs to
remove the watchpoint, single-step, and reinsert the watchpoint, just
like when stepping past a breakpoint.
The trouble is that if GDB is stepping over a breakpoint with
displaced stepping, and the instruction under the breakpoint triggers
a watchpoint, we get the watchpoint SIGTRAP, expecting a finished
(hard or software) step trap. Even though the thread's PC hasn't
advanced yet (must remove watchpoint for that), since we get a
SIGTRAP, displaced_step_fixup thinks the single-step finished
successfuly anyway, and calls gdbarch_displaced_step_fixup, which then
adjusts the thread's registers incorrectly.
The fix is to cancel the displaced step if we trip on a watchpoint.
handle_inferior_event then processes the watchpoint event, and starts
a new step-over, here:
...
/* At this point, we are stopped at an instruction which has
attempted to write to a piece of memory under control of
a watchpoint. The instruction hasn't actually executed
yet. If we were to evaluate the watchpoint expression
now, we would get the old value, and therefore no change
would seem to have occurred.
...
ecs->event_thread->stepping_over_watchpoint = 1;
keep_going (ecs);
return;
...
but this time, since we have a watchpoint to step over, watchpoints
are removed from the target, so the step-over succeeds.
The keep_going/resume changes are necessary because if we're stepping
over a watchpoint, we need to remove it from the target - displaced
stepping doesn't help, the copy of the instruction in the scratch pad
reads/writes to the same addresses, thus triggers the watchpoint
too... So without those changes we keep triggering the watchpoint
forever, never making progress. With non-stop that means we'll need
to pause all threads momentarily, which we can't today. We could
avoid that by removing the watchpoint _only_ from the thread that is
moving past the watchpoint, but GDB is not prepared for that today
either. For remote targets, that would need new packets, so good to
be able to step over it in-line as fallback anyway.
gdb/ChangeLog:
2015-04-10 Pedro Alves <palves@redhat.com>
* infrun.c (displaced_step_fixup): Switch to the event ptid
earlier. If the thread stopped for a watchpoint and the
target/arch has non-continuable watchpoints, cancel the displaced
step.
(resume): Don't start a displaced step if in-line step-over info
is valid.
2015-04-10 12:08:32 +00:00
|
|
|
|
2015-04-10 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* infrun.c (displaced_step_fixup): Switch to the event ptid
|
|
|
|
|
earlier. If the thread stopped for a watchpoint and the
|
|
|
|
|
target/arch has non-continuable watchpoints, cancel the displaced
|
|
|
|
|
step.
|
|
|
|
|
(resume): Don't start a displaced step if in-line step-over info
|
|
|
|
|
is valid.
|
|
|
|
|
|
Fix gdb.base/sigstep.exp with displaced stepping on software single-step targets
TL;DR:
When stepping over a breakpoint with displaced stepping, the core must
be notified of all signals, otherwise the displaced step fixup code
confuses a breakpoint trap in the signal handler for the expected trap
indicating the displaced instruction was single-stepped
normally/successfully.
Detailed version:
Running sigstep.exp with displaced stepping on, against my x86
software single-step branch, I got:
FAIL: gdb.base/sigstep.exp: step on breakpoint, to handler: performing step
FAIL: gdb.base/sigstep.exp: next on breakpoint, to handler: performing next
FAIL: gdb.base/sigstep.exp: continue on breakpoint, to handler: performing continue
Turning on debug logs, we see:
(gdb) step
infrun: clear_proceed_status_thread (process 32147)
infrun: proceed (addr=0xffffffffffffffff, signal=GDB_SIGNAL_DEFAULT)
infrun: resume (step=1, signal=GDB_SIGNAL_0), trap_expected=1, current thread [process 32147] at 0x400842
displaced: stepping process 32147 now
displaced: saved 0x400622: 49 89 d1 5e 48 89 e2 48 83 e4 f0 50 54 49 c7 c0
displaced: %rip-relative addressing used.
displaced: using temp reg 2, old value 0x3615eafd37, new value 0x40084c
displaced: copy 0x400842->0x400622: c7 81 1c 08 20 00 00 00 00 00
displaced: displaced pc to 0x400622
displaced: run 0x400622: c7 81 1c 08
LLR: Preparing to resume process 32147, 0, inferior_ptid process 32147
LLR: PTRACE_CONT process 32147, 0 (resume event thread)
linux_nat_wait: [process -1], [TARGET_WNOHANG]
LLW: enter
LNW: waitpid(-1, ...) returned 32147, No child processes
LLW: waitpid 32147 received Alarm clock (stopped)
LLW: PTRACE_CONT process 32147, Alarm clock (preempt 'handle')
LNW: waitpid(-1, ...) returned 0, No child processes
LLW: exit (ignore)
sigchld
infrun: target_wait (-1.0.0, status) =
infrun: -1.0.0 [process -1],
infrun: status->kind = ignore
infrun: TARGET_WAITKIND_IGNORE
infrun: prepare_to_wait
linux_nat_wait: [process -1], [TARGET_WNOHANG]
LLW: enter
LNW: waitpid(-1, ...) returned 32147, No child processes
LLW: waitpid 32147 received Trace/breakpoint trap (stopped)
CSBB: process 32147 stopped by software breakpoint
LNW: waitpid(-1, ...) returned 0, No child processes
LLW: trap ptid is process 32147.
LLW: exit
infrun: target_wait (-1.0.0, status) =
infrun: 32147.32147.0 [process 32147],
infrun: status->kind = stopped, signal = GDB_SIGNAL_TRAP
infrun: TARGET_WAITKIND_STOPPED
displaced: restored process 32147 0x400622
displaced: fixup (0x400842, 0x400622), insn = 0xc7 0x81 ...
displaced: restoring reg 2 to 0x3615eafd37
displaced: relocated %rip from 0x400717 to 0x400937
infrun: stop_pc = 0x400937
infrun: delayed software breakpoint trap, ignoring
infrun: no line number info
infrun: stop_waiting
0x0000000000400937 in __dso_handle ()
1: x/i $pc
=> 0x400937: and %ah,0xa0d64(%rip) # 0x4a16a1
(gdb) FAIL: gdb.base/sigstep.exp: displaced=on: step on breakpoint, to handler: performing step
What should have happened is that the breakpoint hit in the signal
handler should have been presented to the user. But note that
"preempt 'handle'" -- what happened instead is that
displaced_step_fixup confused the breakpoint in the signal handler for
the expected SIGTRAP indicating the displaced instruction was
single-stepped normally/successfully.
This should be affecting all software single-step targets in the same
way.
The fix is to make sure the core sees all signals when displaced
stepping, just like we already must see all signals when doing an
stepping over a breakpoint in-line. We now get:
infrun: target_wait (-1.0.0, status) =
infrun: 570.570.0 [process 570],
infrun: status->kind = stopped, signal = GDB_SIGNAL_ALRM
infrun: TARGET_WAITKIND_STOPPED
displaced: restored process 570 0x400622
infrun: stop_pc = 0x400842
infrun: random signal (GDB_SIGNAL_ALRM)
infrun: signal arrived while stepping over breakpoint
infrun: inserting step-resume breakpoint at 0x400842
infrun: resume (step=0, signal=GDB_SIGNAL_ALRM), trap_expected=0, current thread [process 570] at 0x400842
LLR: Preparing to resume process 570, Alarm clock, inferior_ptid process 570
LLR: PTRACE_CONT process 570, Alarm clock (resume event thread)
infrun: prepare_to_wait
linux_nat_wait: [process -1], [TARGET_WNOHANG]
LLW: enter
LNW: waitpid(-1, ...) returned 0, No child processes
LLW: exit (ignore)
infrun: target_wait (-1.0.0, status) =
infrun: -1.0.0 [process -1],
infrun: status->kind = ignore
sigchld
infrun: TARGET_WAITKIND_IGNORE
infrun: prepare_to_wait
linux_nat_wait: [process -1], [TARGET_WNOHANG]
LLW: enter
LNW: waitpid(-1, ...) returned 570, No child processes
LLW: waitpid 570 received Trace/breakpoint trap (stopped)
CSBB: process 570 stopped by software breakpoint
LNW: waitpid(-1, ...) returned 0, No child processes
LLW: trap ptid is process 570.
LLW: exit
infrun: target_wait (-1.0.0, status) =
infrun: 570.570.0 [process 570],
infrun: status->kind = stopped, signal = GDB_SIGNAL_TRAP
infrun: TARGET_WAITKIND_STOPPED
infrun: stop_pc = 0x400717
infrun: BPSTAT_WHAT_STOP_NOISY
infrun: stop_waiting
Breakpoint 3, handler (sig=14) at /home/pedro/gdb/mygit/src/gdb/testsuite/gdb.base/sigstep.c:35
35 done = 1;
Hardware single-step targets already behave this way, because the
Linux backends (both native and gdbserver) always report signals to
the core if the thread was single-stepping.
As mentioned in the new comment in do_target_resume, we can't fix this
by instead making the displaced_step_fixup phase skip fixing up the PC
if the single step stopped somewhere we didn't expect. Here's what
the backtrace would look like if we did that:
Breakpoint 3, handler (sig=14) at /home/pedro/gdb/mygit/src/gdb/testsuite/gdb.base/sigstep.c:35
35 done = 1;
1: x/i $pc
=> 0x400717 <handler+7>: movl $0x1,0x200943(%rip) # 0x601064 <done>
(gdb) bt
#0 handler (sig=14) at /home/pedro/gdb/mygit/src/gdb/testsuite/gdb.base/sigstep.c:35
#1 <signal handler called>
#2 0x0000000000400622 in _start ()
(gdb) FAIL: gdb.base/sigstep.exp: displaced=on: step on breakpoint, to handler: backtrace
gdb/ChangeLog:
2015-04-10 Pedro Alves <palves@redhat.com>
* infrun.c (displaced_step_in_progress): New function.
(do_target_resume): Advise target to report all signals if
displaced stepping.
gdb/testsuite/ChangeLog:
2015-04-10 Pedro Alves <palves@redhat.com>
* gdb.base/sigstep.exp (breakpoint_to_handler)
(breakpoint_to_handler_entry): New parameter 'displaced'. Use it.
Test "backtrace" in handler.
(breakpoint_over_handler): New parameter 'displaced'. Use it.
(top level): Add new "displaced" test axis to
breakpoint_to_handler, breakpoint_to_handler_entry and
breakpoint_over_handler.
2015-04-10 09:55:09 +00:00
|
|
|
|
2015-04-10 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* infrun.c (displaced_step_in_progress): New function.
|
|
|
|
|
(do_target_resume): Advise target to report all signals if
|
|
|
|
|
displaced stepping.
|
|
|
|
|
|
2015-04-10 09:36:23 +00:00
|
|
|
|
2015-04-10 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
PR gdb/18216
|
|
|
|
|
* infrun.c (process_event_stop_test): Don't assume a step-resume
|
|
|
|
|
is set if tp->stepped_breakpoint is true.
|
|
|
|
|
|
2015-04-10 09:33:01 +00:00
|
|
|
|
2015-04-10 Yao Qi <yao.qi@linaro.org>
|
|
|
|
|
|
|
|
|
|
* arm-tdep.c (install_alu_reg): Update comment.
|
|
|
|
|
(thumb_copy_alu_reg): Remove local variable rn. Update
|
|
|
|
|
debugging message. Use r2 instead of r1 in the modified
|
|
|
|
|
instruction.
|
|
|
|
|
|
PR13858 - Can't do displaced stepping with no symbols
Running break-interp.exp with the target always in non-stop mode trips
on PR13858, as enabling non-stop also enables displaced stepping.
The problem is that when GDB doesn't know where the entry point is, it
doesn't know where to put the displaced stepping scratch pad. The
test added by this commit exercises this. Without the fix, we get:
(gdb) PASS: gdb.base/step-over-no-symbols.exp: displaced=on: break *$pc
set displaced-stepping on
(gdb) PASS: gdb.base/step-over-no-symbols.exp: displaced=on: set displaced-stepping on
stepi
0x00000000004005be in ?? ()
Entry point address is not known.
(gdb) PASS: gdb.base/step-over-no-symbols.exp: displaced=on: stepi
p /x $pc
$2 = 0x4005be
(gdb) PASS: gdb.base/step-over-no-symbols.exp: displaced=on: get after PC
FAIL: gdb.base/step-over-no-symbols.exp: displaced=on: advanced
The fix switches all GNU/Linux ports to get the entry point from
AT_ENTRY in the target auxiliary vector instead of from symbols. This
is currently only done by PPC when Cell debugging is enabled, but I
think all archs should be able to do the same. Note that
ppc_linux_displaced_step_location cached the result, I'm guessing to
avoid constantly re-fetching the auxv out of remote targets, but
that's no longer necessary nowadays, as the auxv blob is itself cached
in the inferior object. The ppc_linux_entry_point_addr global is
obviously bad for multi-process too nowadays.
Tested on x86-64 (-m64/-m32), PPC64 (-m64/-m32) and S/390 GNU/Linux.
Yao tested the new test on ARM as well.
gdb/ChangeLog:
2015-04-10 Pedro Alves <palves@redhat.com>
PR gdb/13858
* amd64-linux-tdep.c (amd64_linux_init_abi_common): Install
linux_displaced_step_location as gdbarch_displaced_step_location
hook.
* arm-linux-tdep.c (arm_linux_init_abi): Likewise.
* i386-linux-tdep.c (i386_linux_init_abi): Likewise.
* linux-tdep.c (linux_displaced_step_location): New function,
based on ppc_linux_displaced_step_location.
* linux-tdep.h (linux_displaced_step_location): New declaration.
* ppc-linux-tdep.c (ppc_linux_entry_point_addr): Delete.
(ppc_linux_inferior_created, ppc_linux_displaced_step_location):
Delete.
(ppc_linux_init_abi): Install linux_displaced_step_location as
gdbarch_displaced_step_location hook, even without Cell/B.E..
(_initialize_ppc_linux_tdep): Don't install
ppc_linux_inferior_created as inferior_created observer.
* s390-linux-tdep.c (s390_gdbarch_init): Install
linux_displaced_step_location as gdbarch_displaced_step_location
hook.
gdb/testsuite/
2015-04-10 Pedro Alves <palves@redhat.com>
PR gdb/13858
* gdb.base/step-over-no-symbols.exp: New file.
2015-04-10 09:07:02 +00:00
|
|
|
|
2015-04-10 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
PR gdb/13858
|
|
|
|
|
* amd64-linux-tdep.c (amd64_linux_init_abi_common): Install
|
|
|
|
|
linux_displaced_step_location as gdbarch_displaced_step_location
|
|
|
|
|
hook.
|
|
|
|
|
* arm-linux-tdep.c (arm_linux_init_abi): Likewise.
|
|
|
|
|
* i386-linux-tdep.c (i386_linux_init_abi): Likewise.
|
|
|
|
|
* linux-tdep.c (linux_displaced_step_location): New function,
|
|
|
|
|
based on ppc_linux_displaced_step_location.
|
|
|
|
|
* linux-tdep.h (linux_displaced_step_location): New declaration.
|
|
|
|
|
* ppc-linux-tdep.c (ppc_linux_entry_point_addr): Delete.
|
|
|
|
|
(ppc_linux_inferior_created, ppc_linux_displaced_step_location):
|
|
|
|
|
Delete.
|
|
|
|
|
(ppc_linux_init_abi): Install linux_displaced_step_location as
|
|
|
|
|
gdbarch_displaced_step_location hook, even without Cell/B.E..
|
|
|
|
|
(_initialize_ppc_linux_tdep): Don't install
|
|
|
|
|
ppc_linux_inferior_created as inferior_created observer.
|
|
|
|
|
* s390-linux-tdep.c (s390_gdbarch_init): Install
|
|
|
|
|
linux_displaced_step_location as gdbarch_displaced_step_location
|
|
|
|
|
hook.
|
|
|
|
|
|
2015-04-09 13:22:56 +00:00
|
|
|
|
2015-04-09 Gary Benson <gbenson@redhat.com>
|
|
|
|
|
|
|
|
|
|
* common/common-remote-fileio.h: Rename to...
|
|
|
|
|
* common/fileio.h: ...this. Update all references.
|
|
|
|
|
(remote_fileio_to_fio_error): Rename to...
|
|
|
|
|
(host_to_fileio_error): ...this.
|
|
|
|
|
(remote_fileio_to_be): Rename to...
|
|
|
|
|
(host_to_bigendian): ...this. Update all callers.
|
|
|
|
|
(remote_fileio_to_fio_uint): Rename to...
|
|
|
|
|
(host_to_fileio_uint): ...this. Update all callers.
|
|
|
|
|
(remote_fileio_to_fio_time): Rename to...
|
|
|
|
|
(host_to_fileio_time): ...this. Update all callers.
|
|
|
|
|
(remote_fileio_to_fio_stat): Rename to...
|
|
|
|
|
(host_to_fileio_stat): ...this.
|
|
|
|
|
Update all references.
|
|
|
|
|
* common/common-remote-fileio.c: Rename to...
|
|
|
|
|
* common/fileio.c: ...this. Update all references.
|
|
|
|
|
(remote_fileio_to_fio_error): Rename to...
|
|
|
|
|
(host_to_fileio_error): ...this. Update all callers.
|
|
|
|
|
(remote_fileio_mode_to_target): Rename to...
|
|
|
|
|
(fileio_mode_pack): ...this. Update all callers.
|
|
|
|
|
(remote_fileio_to_fio_mode): Rename to...
|
|
|
|
|
(host_to_fileio_mode): ...this. Update all callers.
|
|
|
|
|
(remote_fileio_to_fio_ulong): Rename to...
|
|
|
|
|
(host_to_fileio_ulong): ...this. Update all callers.
|
|
|
|
|
(remote_fileio_to_fio_stat): Rename to...
|
|
|
|
|
(host_to_fileio_stat): ...this. Update all callers.
|
|
|
|
|
|
2015-04-09 12:06:41 +00:00
|
|
|
|
2015-04-09 Andy Wingo <wingo@igalia.com>
|
|
|
|
|
|
|
|
|
|
* guile/scm-frame.c (gdbscm_frame_read_register): New function.
|
|
|
|
|
(frame_functions): Bind gdbscm_frame_read_register to
|
|
|
|
|
frame-read-register.
|
|
|
|
|
* guile/lib/gdb.scm (frame-read-register): Export.
|
|
|
|
|
|
2015-04-09 09:28:05 +00:00
|
|
|
|
2015-04-09 Gary Benson <gbenson@redhat.com>
|
|
|
|
|
|
|
|
|
|
* common/common-remote-fileio.h (remote_fileio_to_fio_error):
|
|
|
|
|
New declaration.
|
|
|
|
|
* common/common-remote-fileio.c (remote_fileio_to_fio_error):
|
|
|
|
|
New function, factored out the named functions below.
|
|
|
|
|
* inf-child.c (gdb/fileio.h): Remove include.
|
|
|
|
|
(common-remote-fileio.h): New include.
|
|
|
|
|
(inf_child_errno_to_fileio_error): Remove function. Update
|
|
|
|
|
all callers to use remote_fileio_to_fio_error.
|
|
|
|
|
* remote-fileio.c (remote_fileio_errno_to_target): Likewise.
|
|
|
|
|
|
2015-04-09 09:33:22 +00:00
|
|
|
|
2015-04-09 Andy Wingo <wingo@igalia.com>
|
|
|
|
|
|
|
|
|
|
* MAINTAINERS (Write After Approval): Add Andy Wingo.
|
|
|
|
|
|
2015-04-09 11:43:57 +00:00
|
|
|
|
2015-04-09 H.J. Lu <hongjiu.lu@intel.com>
|
|
|
|
|
|
|
|
|
|
* acinclude.m4: (GDB_AC_CHECK_BFD): Set ZLIBDIR with $zlibdir.
|
|
|
|
|
Replace $zlibdir with $ZLIBDIR in LDFLAGS.
|
|
|
|
|
* configure: Regenerated.
|
|
|
|
|
|
2015-04-08 17:10:21 +00:00
|
|
|
|
2015-04-09 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gnulib/update-gnulib.sh (IMPORTED_GNULIB_MODULES): Add strtok_r.
|
|
|
|
|
* gnulib/Makefile.in (aclocal_m4_deps): Add import/m4/strtok_r.m4.
|
|
|
|
|
* gnulib/configure, gnulib/config.in, gnulib/aclocal.m4: Regenerate.
|
|
|
|
|
* gnulib/import/Makefile.am: Update.
|
|
|
|
|
* gnulib/import/Makefile.in: Update.
|
|
|
|
|
* gnulib/import/m4/gnulib-cache.m4: Update.
|
|
|
|
|
* gnulib/import/m4/gnulib-comp.m4: Update.
|
|
|
|
|
* gnulib/import/m4/strtok_r.m4: New file.
|
|
|
|
|
* gnulib/import/strtok_r.c: New file.
|
|
|
|
|
|
2015-04-09 09:35:29 +00:00
|
|
|
|
2015-04-09 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gnulib/update-gnulib.sh (aclocal version check): Filter out
|
|
|
|
|
"called too early to check prototype".
|
|
|
|
|
|
Fix Python completion when using the "complete" command
This patch is related to PR python/16699, and is an improvement over the
patch posted here:
<https://sourceware.org/ml/gdb-patches/2014-03/msg00301.html>
Keith noticed that, when using the "complete" command on GDB to complete
a Python command, some strange things could happen. In order to
understand what can go wrong, I need to explain how the Python
completion mechanism works.
When the user requests a completion of a Python command by using TAB,
GDB will first try to determine the right set of "brkchars" that will be
used when doing the completion. This is done by actually calling the
"complete" method of the Python class. Then, when we already know the
"brkchars" that will be used, we call the "complete" method again, for
the same values.
If you read the thread mentioned above, you will see that one of the
design decisions was to make the "cmdpy_completer_helper" (which is the
function the does the actual calling of the "complete" method) cache the
first result of the completion, since this result will be used in the
second call, to do the actual completion.
The problem is that the "complete" command does not process the
brkchars, and the current Python completion mechanism (improved by the
patch mentioned above) relies on GDB trying to determine the brkchars,
and then doing the completion itself. Therefore, when we use the
"complete" command instead of doing a TAB-completion on GDB, there is a
scenario where we can use the invalid cache of a previous Python command
that was completed before. For example:
(gdb) A <TAB>
(gdb) complete B
B value1
B value10
B value2
B value3
B value4
B value5
B value6
B value7
B value8
B value9
(gdb) B <TAB>
comp1 comp2 comp4 comp6 comp8
comp10 comp3 comp5 comp7 comp9
Here, we see that "complete B " gave a different result than "B <TAB>".
The reason for that is because "A <TAB>" was called before, and its
completion results were "value*", so when GDB tried to "complete B " it
wrongly answered with the results for A. The problem here is using a
wrong cache (A's cache) for completing B.
We tried to come up with a solution that would preserve the caching
mechanism, but it wasn't really possible. So I decided to completely
remove the cache, and doing the method calling twice for every
completion. This is not optimal, but I do not think it will impact
users noticeably.
It is worth mentioning another small issue that I found. The code was
doing:
wordobj = PyUnicode_Decode (word, sizeof (word), host_charset (), NULL);
which is totally wrong, because using "sizeof" here will lead to always
the same result. So I changed this to use "strlen". The testcase also
catches this problem.
Keith kindly expanded the existing testcase to cover the problem
described above, and everything is passing.
gdb/ChangeLog:
2015-04-08 Sergio Durigan Junior <sergiodj@redhat.com>
PR python/16699
* python/py-cmd.c (cmdpy_completer_helper): Adjust function to not
use a caching mechanism. Adjust comments and code to reflect
that. Replace 'sizeof' by 'strlen' when fetching 'wordobj'.
(cmdpy_completer_handle_brkchars): Adjust call to
cmdpy_completer_helper. Call Py_XDECREF for 'resultobj'.
(cmdpy_completer): Likewise.
gdb/testsuite/ChangeLog:
2015-04-08 Keith Seitz <keiths@redhat.com>
PR python/16699
* gdb.python/py-completion.exp: New tests for completion.
* gdb.python/py-completion.py (CompleteLimit1): New class.
(CompleteLimit2): Likewise.
(CompleteLimit3): Likewise.
(CompleteLimit4): Likewise.
(CompleteLimit5): Likewise.
(CompleteLimit6): Likewise.
(CompleteLimit7): Likewise.
2015-04-08 22:27:10 +00:00
|
|
|
|
2015-04-08 Sergio Durigan Junior <sergiodj@redhat.com>
|
|
|
|
|
|
|
|
|
|
PR python/16699
|
|
|
|
|
* python/py-cmd.c (cmdpy_completer_helper): Adjust function to not
|
|
|
|
|
use a caching mechanism. Adjust comments and code to reflect
|
|
|
|
|
that. Replace 'sizeof' by 'strlen' when fetching 'wordobj'.
|
|
|
|
|
(cmdpy_completer_handle_brkchars): Adjust call to
|
|
|
|
|
cmdpy_completer_helper. Call Py_XDECREF for 'resultobj'.
|
|
|
|
|
(cmdpy_completer): Likewise.
|
|
|
|
|
|
2015-04-08 15:04:07 +00:00
|
|
|
|
2015-04-08 Yao Qi <yao.qi@linaro.org>
|
|
|
|
|
|
|
|
|
|
* spu-tdep.c (spu_gdbarch_init): Don't call
|
|
|
|
|
set_gdbarch_cannot_step_breakpoint.
|
|
|
|
|
|
2015-04-07 19:19:07 +00:00
|
|
|
|
2015-04-07 Sergio Durigan Junior <sergiodj@redhat.com>
|
|
|
|
|
|
|
|
|
|
* linux-tdep.c (decode_vmflags): Initialize 'saveptr'.
|
|
|
|
|
|
update thread list, delete exited threads
On GNU/Linux, if the running kernel supports clone events, then
linux-thread-db.c defers thread listing to the target beneath:
static void
thread_db_update_thread_list (struct target_ops *ops)
{
...
if (target_has_execution && !thread_db_use_events ())
ops->beneath->to_update_thread_list (ops->beneath);
else
thread_db_update_thread_list_td_ta_thr_iter (ops);
...
}
However, when live debugging, the target beneath, linux-nat.c, does
not implement the to_update_thread_list method. The result is that if
a thread is marked exited (because it can't be deleted right now,
e.g., it was the selected thread), then it won't ever be deleted,
until the process exits or is killed/detached.
A similar thing happens with the remote.c target. Because its
target_update_thread_list implementation skips exited threads when it
walks the current thread list looking for threads that no longer exits
on the target side, using ALL_NON_EXITED_THREADS_SAFE, stale exited
threads are never deleted.
This is not a big deal -- I can't think of any way this might be user
visible, other than gdb's memory growing a tiny bit whenever a thread
gets stuck in exited state. Still, might as well clean things up
properly.
All other targets use prune_threads, so are unaffected.
The fix adds a ALL_THREADS_SAFE macro, that like
ALL_NON_EXITED_THREADS_SAFE, walks the thread list and allows deleting
the iterated thread, and uses that in places that are walking the
thread list in order to delete threads. Actually, after converting
linux-nat.c and remote.c to use this, we find the only other user of
ALL_NON_EXITED_THREADS_SAFE is also walking the list to delete
threads. So we convert that too, and end up deleting
ALL_NON_EXITED_THREADS_SAFE.
Tested on x86_64 Fedora 20, native and gdbserver.
gdb/ChangeLog
2015-04-07 Pedro Alves <palves@redhat.com>
* gdbthread.h (ALL_NON_EXITED_THREADS_SAFE): Rename to ...
(ALL_THREADS_SAFE): ... this, and don't skip exited threads.
(delete_exited_threads): New declaration.
* infrun.c (follow_exec): Use ALL_THREADS_SAFE.
* linux-nat.c (linux_nat_update_thread_list): New function.
(linux_nat_add_target): Install it.
* remote.c (remote_update_thread_list): Use ALL_THREADS_SAFE.
* thread.c (prune_threads): Use ALL_THREADS_SAFE.
(delete_exited_threads): New function.
2015-04-07 14:47:22 +00:00
|
|
|
|
2015-04-07 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdbthread.h (ALL_NON_EXITED_THREADS_SAFE): Rename to ...
|
|
|
|
|
(ALL_THREADS_SAFE): ... this, and don't skip exited threads.
|
|
|
|
|
(delete_exited_threads): New declaration.
|
|
|
|
|
* infrun.c (follow_exec): Use ALL_THREADS_SAFE.
|
|
|
|
|
* linux-nat.c (linux_nat_update_thread_list): New function.
|
|
|
|
|
(linux_nat_add_target): Install it.
|
|
|
|
|
* remote.c (remote_update_thread_list): Use ALL_THREADS_SAFE.
|
|
|
|
|
* thread.c (prune_threads): Use ALL_THREADS_SAFE.
|
|
|
|
|
(delete_exited_threads): New function.
|
|
|
|
|
|
2015-04-07 10:42:09 +00:00
|
|
|
|
2015-04-07 Pedro Alves <pedro@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* infrun.c (resume) <displaced stepping debug output>: Get the
|
|
|
|
|
leader thread's regcache, not resume_ptid's.
|
|
|
|
|
|
2015-04-06 15:31:46 +00:00
|
|
|
|
2015-04-06 Doug Evans <xdje42@gmail.com>
|
|
|
|
|
|
|
|
|
|
* symtab.c (hash_symbol_entry): Hash STRUCT_DOMAIN symbols as
|
|
|
|
|
VAR_DOMAIN.
|
|
|
|
|
(symbol_cache_lookup): Clarify use of bsc_ptr, slot_ptr parameters.
|
|
|
|
|
Include symbol domain in debugging output.
|
|
|
|
|
|
Fallback to stub-termcap.c on all hosts
Currently building gdb is impossible without an installed termcap or
curses library. But, GDB already has a very minimal termcap in the
tree to handle this situation for Windows -- gdb/stub-termcap.c. This
patch makes that the fallback for all hosts.
Testing this on GNU/Linux (by simply hacking away the termcap/curses
detection in gdb/configure.ac), we trip on:
../readline/libreadline.a(terminal.o): In function `_rl_init_terminal_io':
/home/pedro/gdb/mygit/src/readline/terminal.c:527: undefined reference to `PC'
/home/pedro/gdb/mygit/src/readline/terminal.c:528: undefined reference to `BC'
/home/pedro/gdb/mygit/src/readline/terminal.c:529: undefined reference to `UP'
/home/pedro/gdb/mygit/src/readline/terminal.c:538: undefined reference to `PC'
/home/pedro/gdb/mygit/src/readline/terminal.c:539: undefined reference to `BC'
/home/pedro/gdb/mygit/src/readline/terminal.c:540: undefined reference to `UP'
These are globals that are normally defined by termcap (or ncurses'
termcap emulation).
Now, we could just define replacements in stub-termcap.c, but
readline/terminal.c (at least the copy in our tree) has this:
#if !defined (__linux__) && !defined (NCURSES_VERSION)
# if defined (__EMX__) || defined (NEED_EXTERN_PC)
extern
# endif /* __EMX__ || NEED_EXTERN_PC */
char PC, *BC, *UP;
#endif /* !__linux__ && !NCURSES_VERSION */
which can result in readline defining the globals too. That will
usually work out in C, given that "-fcommon" is usually the default
for C compilers, but that won't work for C++, or C with -fno-common
(link fails with "multiple definition" errors)...
Mirroring those #ifdef conditions in the stub termcap screams
"brittle" to me -- I can see them changing in latter readline
versions.
Work around that by simply using __attribute__((weak)).
Windows/PE/COFF's do support weak, but not on gcc 3.4 based toolchains
(4.8.x does work). Given the file never needed the variables while it
was Windows-only, just continue not defining them there. All other
supported hosts should support this.
gdb/ChangeLog:
2015-04-06 Pedro Alves <palves@redhat.com>
Bernd Edlinger <bernd.edlinger@hotmail.de>
* configure.ac: Remove the mingw32-specific stub-termcap.o
fallback, and instead fallback to the stub termcap on all hosts.
* configure: Regenerate.
* stub-termcap.c [!__MINGW32__] (PC, BC, UP): Define as weak
symbols.
2015-04-06 11:35:18 +00:00
|
|
|
|
2015-04-06 Pedro Alves <palves@redhat.com>
|
|
|
|
|
Bernd Edlinger <bernd.edlinger@hotmail.de>
|
|
|
|
|
|
|
|
|
|
* configure.ac: Remove the mingw32-specific stub-termcap.o
|
|
|
|
|
fallback, and instead fallback to the stub termcap on all hosts.
|
|
|
|
|
* configure: Regenerate.
|
|
|
|
|
* stub-termcap.c [!__MINGW32__] (PC, BC, UP): Define as weak
|
|
|
|
|
symbols.
|
|
|
|
|
|
2015-04-03 12:53:12 +00:00
|
|
|
|
2015-04-03 Pierre-Marie de Rodat <derodat@adacore.com>
|
|
|
|
|
|
|
|
|
|
* gdbtypes.c (is_dynamic_type_internal): Remove the unused
|
|
|
|
|
"top_level" parameter.
|
|
|
|
|
(resolve_dynamic_type_internal): Remove the unused "top_level"
|
|
|
|
|
parameter. Update call to is_dynamic_type_internal.
|
|
|
|
|
(is_dynamic_type): Update call to is_dynamic_type_internal.
|
|
|
|
|
(resolve_dynamic_range): Update call to
|
|
|
|
|
resolve_dynamic_type_internal.
|
|
|
|
|
(resolve_dynamic_union): Likewise.
|
|
|
|
|
(resolve_dynamic_struct): Likewise.
|
|
|
|
|
(resolve_dynamic_type): Likewise.
|
|
|
|
|
|
2015-04-03 08:40:52 +00:00
|
|
|
|
2015-04-03 Pierre-Marie de Rodat <derodat@adacore.com>
|
|
|
|
|
|
|
|
|
|
* gdbtypes.c (is_dynamic_type_internal): Remove special handling of
|
|
|
|
|
TYPE_CODE_REF types so that they are not considered as dynamic
|
|
|
|
|
depending on the referenced type.
|
|
|
|
|
(resolve_dynamic_type_internal): Likewise.
|
|
|
|
|
|
2015-04-02 12:41:50 +00:00
|
|
|
|
2015-04-02 H.J. Lu <hongjiu.lu@intel.com>
|
|
|
|
|
|
|
|
|
|
* Makefile.in (top_srcdir): New.
|
|
|
|
|
* configure: Regenerated.
|
|
|
|
|
|
2015-04-02 12:38:29 +00:00
|
|
|
|
2015-04-02 Gary Benson <gbenson@redhat.com>
|
|
|
|
|
|
|
|
|
|
* NEWS: Announce the new default sysroot of "target:".
|
|
|
|
|
|
2015-04-02 12:38:29 +00:00
|
|
|
|
2015-04-02 Gary Benson <gbenson@redhat.com>
|
|
|
|
|
|
|
|
|
|
* main.c (captured_main): Set gdb_sysroot to "target:"
|
|
|
|
|
if not otherwise set.
|
|
|
|
|
|
2015-04-02 12:38:29 +00:00
|
|
|
|
2015-04-02 Gary Benson <gbenson@redhat.com>
|
|
|
|
|
|
|
|
|
|
* exec.c (exec_file_attach): Support "target:" filenames.
|
|
|
|
|
|
2015-04-02 12:38:29 +00:00
|
|
|
|
2015-04-02 Gary Benson <gbenson@redhat.com>
|
|
|
|
|
|
|
|
|
|
* solib.c (solib_find): Strip "target:" prefix from sysroot
|
|
|
|
|
if accessing local files.
|
|
|
|
|
|
2015-04-02 12:38:29 +00:00
|
|
|
|
2015-04-02 Gary Benson <gbenson@redhat.com>
|
|
|
|
|
|
|
|
|
|
* symfile.c (symfile_bfd_open): Reorder to remove duplicated
|
|
|
|
|
checks and error messages.
|
|
|
|
|
|
2015-04-02 12:38:29 +00:00
|
|
|
|
2015-04-02 Gary Benson <gbenson@redhat.com>
|
|
|
|
|
|
|
|
|
|
* remote.h (REMOTE_SYSROOT_PREFIX): Remove definition.
|
|
|
|
|
(remote_filename_p): Remove declaration.
|
|
|
|
|
(remote_bfd_open): Likewise.
|
|
|
|
|
* remote.c (remote_bfd_iovec_open): Remove function.
|
|
|
|
|
(remote_bfd_iovec_close): Likewise.
|
|
|
|
|
(remote_bfd_iovec_pread): Likewise.
|
|
|
|
|
(remote_bfd_iovec_stat): Likewise.
|
|
|
|
|
(remote_filename_p): Likewise.
|
|
|
|
|
(remote_bfd_open): Likewise.
|
|
|
|
|
* symfile.h (gdb_bfd_open_maybe_remote): Remove declaration.
|
|
|
|
|
* symfile.c (separate_debug_file_exists): Use gdb_bfd_open.
|
|
|
|
|
(gdb_bfd_open_maybe_remote): Remove function.
|
|
|
|
|
(symfile_bfd_open): Replace remote filename check with
|
|
|
|
|
target filename check.
|
|
|
|
|
(reread_symbols): Use gdb_bfd_open.
|
|
|
|
|
* build-id.c (gdbcore.h): New include.
|
|
|
|
|
(build_id_to_debug_bfd): Use gdb_bfd_open.
|
|
|
|
|
* infcmd.c (attach_command_post_wait): Remove remote filename
|
|
|
|
|
check.
|
|
|
|
|
* solib.c (solib_find): Replace remote-specific handling with
|
|
|
|
|
target-specific handling. Update comments where necessary.
|
|
|
|
|
(solib_bfd_open): Replace remote-specific handling with
|
|
|
|
|
target-specific handling.
|
|
|
|
|
(gdb_sysroot_changed): New function.
|
|
|
|
|
(_initialize_solib): Call the above when gdb_sysroot changes.
|
|
|
|
|
* windows-tdep.c (gdbcore.h): New include.
|
|
|
|
|
(windows_xfer_shared_library): Use gdb_bfd_open.
|
|
|
|
|
|
2015-04-02 12:38:29 +00:00
|
|
|
|
2015-04-02 Gary Benson <gbenson@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb/gdb_bfd.h (TARGET_SYSROOT_PREFIX): New definition.
|
|
|
|
|
(is_target_filename): New declaration.
|
|
|
|
|
(gdb_bfd_has_target_filename): Likewise.
|
|
|
|
|
(gdb_bfd_open): Update documentation comment.
|
|
|
|
|
* gdb_bfd.c (target.h): New include.
|
|
|
|
|
(gdb/fileio.h): Likewise.
|
|
|
|
|
(is_target_filename): New function.
|
|
|
|
|
(gdb_bfd_has_target_filename): Likewise.
|
|
|
|
|
(fileio_errno_to_host): Likewise.
|
|
|
|
|
(gdb_bfd_iovec_fileio_open): Likewise.
|
|
|
|
|
(gdb_bfd_iovec_fileio_pread): Likewise.
|
|
|
|
|
(gdb_bfd_iovec_fileio_close): Likewise.
|
|
|
|
|
(gdb_bfd_iovec_fileio_fstat): Likewise.
|
|
|
|
|
(gdb_bfd_open): Use target fileio to access paths prefixed
|
|
|
|
|
with "target:" where necessary.
|
|
|
|
|
|
2015-04-02 12:38:28 +00:00
|
|
|
|
2015-04-02 Gary Benson <gbenson@redhat.com>
|
|
|
|
|
|
|
|
|
|
* target.h (struct target_ops) <to_filesystem_is_local>:
|
|
|
|
|
New field.
|
|
|
|
|
(target_filesystem_is_local): New macro.
|
|
|
|
|
* target-delegates.c: Regenerate.
|
|
|
|
|
* remote.c (remote_filesystem_is_local): New function.
|
|
|
|
|
(init_remote_ops): Initialize to_filesystem_is_local.
|
|
|
|
|
|
2015-04-02 12:38:28 +00:00
|
|
|
|
2015-04-02 Gary Benson <gbenson@redhat.com>
|
|
|
|
|
|
|
|
|
|
* target.h (struct target_ops) <to_fileio_fstat>: New field.
|
|
|
|
|
(target_fileio_fstat): New declaration.
|
|
|
|
|
* target.c (target_fileio_fstat): New function.
|
|
|
|
|
* inf-child.c (inf_child_fileio_fstat): Likewise.
|
|
|
|
|
(inf_child_target): Initialize to_fileio_fstat.
|
|
|
|
|
* remote.c (init_remote_ops): Likewise.
|
|
|
|
|
|
2015-04-01 18:49:12 +00:00
|
|
|
|
2015-04-01 Sasha Smundak <asmundak@google.com>
|
|
|
|
|
|
|
|
|
|
* Makefile.in (SUBDIR_PYTHON_OBJS): Add py-unwind.o.
|
|
|
|
|
(SUBDIR_PYTHON_SRCS): Add py-unwind.c.
|
|
|
|
|
(py-unwind.o): New recipe.
|
|
|
|
|
* NEWS: mention Python frame unwinding.
|
|
|
|
|
* data-directory/Makefile.in (PYTHON_FILE_LIST): Add
|
|
|
|
|
gdb/unwinder.py and gdb/command/unwinder.py
|
|
|
|
|
* python/lib/gdb/__init__.py (packages): Add frame_unwinders
|
|
|
|
|
list.
|
|
|
|
|
(execute_unwinders): New function.
|
|
|
|
|
* python/lib/gdb/command/unwinders.py: New file.
|
|
|
|
|
* python/lib/gdb/unwinder.py: New file.
|
|
|
|
|
* python/py-objfile.c (objfile_object): Add frame_unwinders field.
|
|
|
|
|
(objfpy_dealloc): Decrement frame_unwinders reference count.
|
|
|
|
|
(objfpy_initialize): Create frame_unwinders list.
|
|
|
|
|
(objfpy_get_frame_unwinders): New function.
|
|
|
|
|
(objfpy_set_frame_unwinders): Ditto.
|
|
|
|
|
(objfile_getset): Add frame_unwinders attribute to Objfile.
|
|
|
|
|
* python/py-progspace.c (pspace_object): Add frame_unwinders field.
|
|
|
|
|
(pspy_dealloc): Decrement frame_unwinders reference count.
|
|
|
|
|
(pspy_initialize): Create frame_unwinders list.
|
|
|
|
|
(pspy_get_frame_unwinders): New function.
|
|
|
|
|
(pspy_set_frame_unwinders): Ditto.
|
|
|
|
|
(pspy_getset): Add frame_unwinders attribute to gdb.Progspace.
|
|
|
|
|
* python/py-unwind.c: New file.
|
|
|
|
|
* python/python-internal.h (pspy_get_name_unwinders): New prototype.
|
|
|
|
|
(objpy_get_frame_unwinders): New prototype.
|
|
|
|
|
(gdbpy_initialize_unwind): New prototype.
|
|
|
|
|
* python/python.c (gdbpy_apply_type_printers): Call
|
|
|
|
|
gdbpy_initialize_unwind.
|
|
|
|
|
|
2015-03-30 15:39:56 +00:00
|
|
|
|
2015-04-01 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* infrun.c (resume): Check currently_stepping after clearing
|
|
|
|
|
stepped_breakpoint, not before.
|
|
|
|
|
|
2015-03-30 16:02:01 +00:00
|
|
|
|
2015-04-01 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* infrun.c (print_target_wait_results): Print all the ptid
|
|
|
|
|
elements.
|
|
|
|
|
|
2015-03-26 19:05:40 +00:00
|
|
|
|
2015-04-01 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* infrun.c (keep_going): Also discard cleanups if inserting
|
|
|
|
|
breakpoints fails.
|
|
|
|
|
|
2015-04-01 13:58:56 +00:00
|
|
|
|
2015-04-01 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* infrun.c (wait_for_inferior): Install the
|
|
|
|
|
finish_thread_state_cleanup cleanup across the whole function, not
|
|
|
|
|
just around handle_inferior_event.
|
|
|
|
|
|
2015-04-01 14:24:54 +00:00
|
|
|
|
2015-04-01 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* infrun.c (resume) <step past permanent breakpoint>: Use
|
|
|
|
|
do_target_resume.
|
|
|
|
|
|
2015-03-24 14:24:53 +00:00
|
|
|
|
2015-04-01 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* linux-nat.c (linux_handle_extended_wait): Always call set_running.
|
|
|
|
|
|
2015-04-01 12:53:42 +00:00
|
|
|
|
2015-04-01 Pierre-Marie de Rodat <derodat@adacore.com>
|
|
|
|
|
|
|
|
|
|
* MAINTAINERS (Write After Approval): Add "Pierre-Marie de Rodat".
|
|
|
|
|
|
Crash on thread id wrap around
On GNU/Linux, if the target reuses the TID of a thread that GDB still
has in its list marked as THREAD_EXITED, GDB crashes, like:
(gdb) continue
Continuing.
src/gdb/thread.c:789: internal-error: set_running: Assertion `tp->state != THREAD_EXITED' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n) FAIL: gdb.threads/tid-reuse.exp: continue to breakpoint: after_reuse_time (GDB internal error)
Here:
(top-gdb) bt
#0 internal_error (file=0x953dd8 "src/gdb/thread.c", line=789, fmt=0x953da0 "%s: Assertion `%s' failed.")
at src/gdb/common/errors.c:54
#1 0x0000000000638514 in set_running (ptid=..., running=1) at src/gdb/thread.c:789
#2 0x00000000004bda42 in linux_handle_extended_wait (lp=0x16f5760, status=0, stopping=0) at src/gdb/linux-nat.c:2114
#3 0x00000000004bfa24 in linux_nat_filter_event (lwpid=20570, status=198015) at src/gdb/linux-nat.c:3127
#4 0x00000000004c070e in linux_nat_wait_1 (ops=0xe193d0, ptid=..., ourstatus=0x7fffffffd2c0, target_options=1) at src/gdb/linux-nat.c:3478
#5 0x00000000004c1015 in linux_nat_wait (ops=0xe193d0, ptid=..., ourstatus=0x7fffffffd2c0, target_options=1) at src/gdb/linux-nat.c:3722
#6 0x00000000004c92d2 in thread_db_wait (ops=0xd80b60 <thread_db_ops>, ptid=..., ourstatus=0x7fffffffd2c0, options=1)
at src/gdb/linux-thread-db.c:1525
#7 0x000000000066db43 in delegate_wait (self=0xd80b60 <thread_db_ops>, arg1=..., arg2=0x7fffffffd2c0, arg3=1) at src/gdb/target-delegates.c:116
#8 0x000000000067e54b in target_wait (ptid=..., status=0x7fffffffd2c0, options=1) at src/gdb/target.c:2206
#9 0x0000000000625111 in fetch_inferior_event (client_data=0x0) at src/gdb/infrun.c:3275
#10 0x0000000000648a3b in inferior_event_handler (event_type=INF_REG_EVENT, client_data=0x0) at src/gdb/inf-loop.c:56
#11 0x00000000004c2ecb in handle_target_event (error=0, client_data=0x0) at src/gdb/linux-nat.c:4655
I managed to come up with a test that reliably reproduces this. It
spawns enough threads for the pid number space to wrap around, so
could potentially take a while. On my box that's 4 seconds; on
gcc110, a PPC box which has max_pid set to 65536, it's over 10
seconds. So I made the test compute how long that would take, and cap
the time waited if it would be unreasonably long.
Tested on x86_64 Fedora 20.
gdb/ChangeLog:
2015-04-01 Pedro Alves <palves@redhat.com>
* linux-thread-db.c (record_thread): Readd the thread to gdb's
list if it was marked exited.
gdb/testsuite/ChangeLog:
2015-04-01 Pedro Alves <palves@redhat.com>
* gdb.threads/tid-reuse.c: New file.
* gdb.threads/tid-reuse.exp: New file.
2015-04-01 12:38:06 +00:00
|
|
|
|
2015-04-01 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* linux-thread-db.c (record_thread): Readd the thread to gdb's
|
|
|
|
|
list if it was marked exited.
|
|
|
|
|
|
2015-04-01 11:55:48 +00:00
|
|
|
|
2015-04-01 H.J. Lu <hongjiu.lu@intel.com>
|
|
|
|
|
|
|
|
|
|
* configure: Regenerated.
|
|
|
|
|
|
Implement support for checking /proc/PID/coredump_filter
This patch, as the subject says, extends GDB so that it is able to use
the contents of the file /proc/PID/coredump_filter when generating a
corefile. This file contains a bit mask that is a representation of
the different types of memory mappings in the Linux kernel; the user
can choose to dump or not dump a certain type of memory mapping by
enabling/disabling the respective bit in the bit mask. Currently,
here is what is supported:
bit 0 Dump anonymous private mappings.
bit 1 Dump anonymous shared mappings.
bit 2 Dump file-backed private mappings.
bit 3 Dump file-backed shared mappings.
bit 4 (since Linux 2.6.24)
Dump ELF headers.
bit 5 (since Linux 2.6.28)
Dump private huge pages.
bit 6 (since Linux 2.6.28)
Dump shared huge pages.
(This table has been taken from core(5), but you can also read about it
on Documentation/filesystems/proc.txt inside the Linux kernel source
tree).
The default value for this file, used by the Linux kernel, is 0x33,
which means that bits 0, 1, 4 and 5 are enabled. This is also the
default for GDB implemented in this patch, FWIW.
Well, reading the file is obviously trivial. The hard part, mind you,
is how to determine the types of the memory mappings. For that, I
extended the code of gdb/linux-tdep.c:linux_find_memory_regions_full and
made it rely *much more* on the information gathered from
/proc/<PID>/smaps. This file contains a "verbose dump" of the
inferior's memory mappings, and we were not using as much information as
we could from it. If you want to read more about this file, take a look
at the proc(5) manpage (I will also write a blog post soon about
everything I had to learn to get this patch done, and when I it is ready
I will post it here).
With Oleg Nesterov's help, we could improve the current algorithm for
determining whether a memory mapping is anonymous/file-backed,
private/shared. GDB now also respects the MADV_DONTDUMP flag and does
not dump the memory mapping marked as so, and will always dump
"[vsyscall]" or "[vdso]" mappings (just like the Linux kernel).
In a nutshell, what the new code is doing is:
- If the mapping is associated to a file whose name ends with
" (deleted)", or if the file is "/dev/zero", or if it is "/SYSV%08x"
(shared memory), or if there is no file associated with it, or if
the AnonHugePages: or the Anonymous: fields in the /proc/PID/smaps
have contents, then GDB considers this mapping to be anonymous.
There is a special case in this, though: if the memory mapping is a
file-backed one, but *also* contains "Anonymous:" or
"AnonHugePages:" pages, then GDB considers this mapping to be *both*
anonymous and file-backed, just like the Linux kernel does. What
that means is simple: this mapping will be dumped if the user
requested anonymous mappings *or* if the user requested file-backed
mappings to be present in the corefile.
It is worth mentioning that, from all those checks described above,
the most fragile is the one to see if the file name ends with
" (deleted)". This does not necessarily mean that the mapping is
anonymous, because the deleted file associated with the mapping may
have been a hard link to another file, for example. The Linux
kernel checks to see if "i_nlink == 0", but GDB cannot easily do
this check (as it has been discussed, GDB would need to run as root,
and would need to check the contents of the /proc/PID/map_files/
directory in order to determine whether the deleted was a hardlink
or not). Therefore, we made a compromise here, and we assume that
if the file name ends with " (deleted)", then the mapping is indeed
anonymous. FWIW, this is something the Linux kernel could do
better: expose this information in a more direct way.
- If we see the flag "sh" in the VmFlags: field (in /proc/PID/smaps),
then certainly the memory mapping is shared (VM_SHARED). If we have
access to the VmFlags, and we don't see the "sh" there, then
certainly the mapping is private. However, older Linux kernels (see
the code for more details) do not have the VmFlags field; in that
case, we use another heuristic: if we see 'p' in the permission
flags, then we assume that the mapping is private, even though the
presence of the 's' flag there would mean VM_MAYSHARE, which means
the mapping could still be private. This should work OK enough,
however.
Finally, it is worth mentioning that I added a new command, 'set
use-coredump-filter on/off'. When it is 'on', it will read the
coredump_filter' file (if it exists) and use its value; otherwise, it
will use the default value mentioned above (0x33) to decide which memory
mappings to dump.
gdb/ChangeLog:
2015-03-31 Sergio Durigan Junior <sergiodj@redhat.com>
Jan Kratochvil <jan.kratochvil@redhat.com>
Oleg Nesterov <oleg@redhat.com>
PR corefiles/16092
* linux-tdep.c: Include 'gdbcmd.h' and 'gdb_regex.h'.
New enum identifying the various options of the coredump_filter
file.
(struct smaps_vmflags): New struct.
(use_coredump_filter): New variable.
(decode_vmflags): New function.
(mapping_is_anonymous_p): Likewise.
(dump_mapping_p): Likewise.
(linux_find_memory_regions_full): New variables
'coredumpfilter_name', 'coredumpfilterdata', 'pid', 'filterflags'.
Removed variable 'modified'. Read /proc/<PID>/smaps file; improve
parsing of its information. Implement memory mapping filtering
based on its contents.
(show_use_coredump_filter): New function.
(_initialize_linux_tdep): New command 'set use-coredump-filter'.
* NEWS: Mention the possibility of using the
'/proc/PID/coredump_filter' file when generating a corefile.
Mention new command 'set use-coredump-filter'.
gdb/doc/ChangeLog:
2015-03-31 Sergio Durigan Junior <sergiodj@redhat.com>
PR corefiles/16092
* gdb.texinfo (gcore): Mention new command 'set
use-coredump-filter'.
(set use-coredump-filter): Document new command.
gdb/testsuite/ChangeLog:
2015-03-31 Sergio Durigan Junior <sergiodj@redhat.com>
PR corefiles/16092
* gdb.base/coredump-filter.c: New file.
* gdb.base/coredump-filter.exp: Likewise.
2015-03-31 23:32:34 +00:00
|
|
|
|
2015-03-31 Sergio Durigan Junior <sergiodj@redhat.com>
|
|
|
|
|
Jan Kratochvil <jan.kratochvil@redhat.com>
|
|
|
|
|
Oleg Nesterov <oleg@redhat.com>
|
|
|
|
|
|
|
|
|
|
PR corefiles/16092
|
|
|
|
|
* linux-tdep.c: Include 'gdbcmd.h' and 'gdb_regex.h'.
|
|
|
|
|
New enum identifying the various options of the coredump_filter
|
|
|
|
|
file.
|
|
|
|
|
(struct smaps_vmflags): New struct.
|
|
|
|
|
(use_coredump_filter): New variable.
|
|
|
|
|
(decode_vmflags): New function.
|
|
|
|
|
(mapping_is_anonymous_p): Likewise.
|
|
|
|
|
(dump_mapping_p): Likewise.
|
|
|
|
|
(linux_find_memory_regions_full): New variables
|
|
|
|
|
'coredumpfilter_name', 'coredumpfilterdata', 'pid', 'filterflags'.
|
|
|
|
|
Removed variable 'modified'. Read /proc/<PID>/smaps file; improve
|
|
|
|
|
parsing of its information. Implement memory mapping filtering
|
|
|
|
|
based on its contents.
|
|
|
|
|
(show_use_coredump_filter): New function.
|
|
|
|
|
(_initialize_linux_tdep): New command 'set use-coredump-filter'.
|
|
|
|
|
* NEWS: Mention the possibility of using the
|
|
|
|
|
'/proc/PID/coredump_filter' file when generating a corefile.
|
|
|
|
|
Mention new command 'set use-coredump-filter'.
|
|
|
|
|
|
2015-03-31 23:17:23 +00:00
|
|
|
|
2015-03-31 Sergio Durigan Junior <sergiodj@redhat.com>
|
|
|
|
|
|
|
|
|
|
* solib-svr4.c (solib_svr4_r_ldsomap): Catch possible exception by
|
|
|
|
|
read_memory_unsigned_integer.
|
|
|
|
|
|
2015-03-31 15:24:02 +00:00
|
|
|
|
2015-03-31 H.J. Lu <hongjiu.lu@intel.com>
|
|
|
|
|
|
|
|
|
|
* Makefile.in (ZLIB): New.
|
|
|
|
|
(ZLIBINC): Likewise.
|
|
|
|
|
(INTERNAL_CFLAGS_BASE): Add $(ZLIBINC).
|
|
|
|
|
(CLIBS): Add $(ZLIB).
|
|
|
|
|
* acinclude.m4: (GDB_AC_CHECK_BFD): Add $zlibdir to LDFLAGS.
|
|
|
|
|
Add -lz to LIBS.
|
|
|
|
|
* gdb_bfd.c: Don't check HAVE_ZLIB_H to include <zlib.h>.
|
|
|
|
|
* top.c (print_gdb_configuration): Remove --with-zlib and
|
|
|
|
|
--without-zlib.
|
|
|
|
|
* config.in: Regenerated.
|
|
|
|
|
* configure: Likewise.
|
|
|
|
|
|
2015-03-25 15:49:05 +00:00
|
|
|
|
2015-03-31 Antoine Tremblay <antoine.tremblay@ericsson.com>
|
|
|
|
|
|
|
|
|
|
* NEWS: Mention info os cpus support.
|
|
|
|
|
* gdb/nat/linux-osdata.c (linux_xfer_osdata_cpus): New function.
|
|
|
|
|
(struct osdata_type): Add cpus entry, reorder the entries in
|
|
|
|
|
alphabetical order.
|
|
|
|
|
|
2015-03-31 13:15:42 +00:00
|
|
|
|
2015-03-31 Matthias Klose <doko@ubuntu.com>
|
|
|
|
|
|
|
|
|
|
* compile/compile.c (compile_to_object): Allow triplets with or
|
|
|
|
|
without vendor set.
|
|
|
|
|
|
2015-03-30 23:41:05 +00:00
|
|
|
|
2015-03-30 Doug Evans <dje@google.com>
|
|
|
|
|
|
|
|
|
|
PR c++/18141
|
|
|
|
|
* cp-namespace.c (cp_search_static_and_baseclasses): Always look for
|
|
|
|
|
klass in VAR_DOMAIN.
|
|
|
|
|
|
2015-03-30 13:58:33 +00:00
|
|
|
|
2015-03-30 Gary Benson <gbenson@redhat.com>
|
|
|
|
|
|
|
|
|
|
* remote.c (remote_mourn_1): Remove function. Update all callers
|
|
|
|
|
to use remote_mourn.
|
|
|
|
|
(extended_remote_mourn_1): Remove function. Update all callers
|
|
|
|
|
to use extended_remote_mourn.
|
|
|
|
|
(extended_remote_attach_1): Remove function. Update all callers
|
|
|
|
|
to use extended_remote_attach.
|
|
|
|
|
|
2015-03-23 19:15:32 +00:00
|
|
|
|
2015-03-28 James Bowman <james.bowman@ftdichip.com>
|
|
|
|
|
|
|
|
|
|
* Makefile.in (ALL_TARGET_OBS): Add ft32-tdep.o.
|
|
|
|
|
(HFILES_NO_SRCDIR): Add ft32-tdep.h.
|
|
|
|
|
(ALLDEPFILES): Add ft32-tdep.c.
|
|
|
|
|
* configure.tgt: Add FT32 entry.
|
|
|
|
|
* ft32-tdep.c: New file, FT32 target-dependent code.
|
|
|
|
|
* ft32-tdep.h: New file, FT32 target-dependent code.
|
|
|
|
|
|
2015-03-27 19:19:37 +00:00
|
|
|
|
2015-03-27 Jan Kratochvil <jan.kratochvil@redhat.com>
|
|
|
|
|
|
|
|
|
|
Revert:
|
|
|
|
|
2015-03-26 Jan Kratochvil <jan.kratochvil@redhat.com>
|
|
|
|
|
Code cleanup.
|
|
|
|
|
* printcmd.c (print_command_1): Move expr variable scope.
|
|
|
|
|
|
2015-03-27 13:37:34 +00:00
|
|
|
|
2015-03-27 Joel Brobecker <brobecker@adacore.com>
|
|
|
|
|
|
|
|
|
|
* dtrace-probe.c (dtrace_process_dof_probe): Initialize expr to NULL.
|
|
|
|
|
|
2015-03-27 12:09:02 +00:00
|
|
|
|
2015-03-27 Andrzej Kaczmarek <andrzej.kaczmarek@tieto.com>
|
|
|
|
|
|
|
|
|
|
* gdb_bfd.c (gdb_bfd_section_index): Fix off-by-one for special
|
|
|
|
|
sections.
|
|
|
|
|
|
2015-03-26 18:14:03 +00:00
|
|
|
|
2015-03-26 Joel Brobecker <brobecker@adacore.com>
|
|
|
|
|
|
|
|
|
|
* dtrace-probe.c (dtrace_process_dof_probe): Contain any
|
|
|
|
|
exception raised while parsing the probe arguments.
|
|
|
|
|
Force parsing to be done using the C language parser.
|
|
|
|
|
* expression.h (parse_expression_with_language): Declare.
|
|
|
|
|
* parse.c (parse_expression_with_language): New function.
|
|
|
|
|
|
2015-03-26 20:29:00 +00:00
|
|
|
|
2015-03-26 Jon Turney <jon.turney@dronecode.org.uk>
|
|
|
|
|
|
|
|
|
|
* MAINTAINERS (Write After Approval): Add "Jon Turney".
|
|
|
|
|
|
2015-03-26 18:41:15 +00:00
|
|
|
|
2015-03-26 Andy Wingo <wingo@igalia.com>
|
|
|
|
|
|
|
|
|
|
PR symtab/18148
|
|
|
|
|
* dwarf2read.c (struct partial_die_info): Add has_const_value
|
|
|
|
|
member.
|
|
|
|
|
(add_partial_symbol): Don't punt on symbols that have const_value
|
|
|
|
|
attributes.
|
|
|
|
|
(read_partial_die): Detect DW_AT_const_value.
|
|
|
|
|
|
2015-03-26 17:44:38 +00:00
|
|
|
|
2015-03-26 Jan Kratochvil <jan.kratochvil@redhat.com>
|
|
|
|
|
|
|
|
|
|
Code cleanup.
|
|
|
|
|
* printcmd.c (print_command_1): Move expr variable scope.
|
|
|
|
|
|
2015-03-26 17:41:24 +00:00
|
|
|
|
2015-03-26 Jan Kratochvil <jan.kratochvil@redhat.com>
|
|
|
|
|
|
|
|
|
|
Code cleanup.
|
|
|
|
|
* printcmd.c (validate_format): Make the parameter cmdname const.
|
|
|
|
|
|
2015-03-26 17:23:05 +00:00
|
|
|
|
2015-03-26 Don Breazeal <donb@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* remote.c (_initialize_remote): Update comment.
|
|
|
|
|
|
Don't set breakpoints on import stubs on Windows amd64
On Windows amd64, setting a breakpoint on a symbol imported from a
shared library after that library is loaded creates a breakpoint with
two locations, one on the import stub, and another in the shared
library, while on i386, the breakpoint is only set in the shared
library.
This is due to the minimal symbol for the import stub not being
correctly given the type mst_solib_trampoline on Windows amd64, unlike
Windows i386.
As currently written, coff_symfile_read is always skipping over the
character after the "__imp_" (amd64) or "_imp_" (i386) prefix,
assuming that it is '_'. However, while i386 is an underscored
target, amd64 is not.
On x86_64-pc-cygwin, it fixes:
- FAIL: gdb.base/solib-symbol.exp: foo in libmd
+ PASS: gdb.base/solib-symbol.exp: foo in libmd
Unfortunately, several other tests which passed now fail but that's
because this issue was masking other problems.
No change on i686-pc-cygwin.
gdb/ChangeLog:
2015-03-26 Pedro Alves <palves@redhat.com>
Jon TURNEY <jon.turney@dronecode.org.uk>
* coffread.c (coff_symfile_read): When constructing the name of an
import stub symbol from import symbol for amd64, only skip the
char after _imp_ if the target is underscored (like i386) and the
char is indeed the target's leading char.
2015-03-26 10:21:07 +00:00
|
|
|
|
2015-03-26 Pedro Alves <palves@redhat.com>
|
|
|
|
|
Jon TURNEY <jon.turney@dronecode.org.uk>
|
|
|
|
|
|
|
|
|
|
* coffread.c (coff_symfile_read): When constructing the name of an
|
|
|
|
|
import stub symbol from import symbol for amd64, only skip the
|
|
|
|
|
char after _imp_ if the target is underscored (like i386) and the
|
|
|
|
|
char is indeed the target's leading char.
|
|
|
|
|
|
Simplify target_async hook interface
All callers of target_async pass it the same callback
(inferior_event_handler). Since both common code and target backends
need to be able to put the target in and out of target async mode at
any given time, there's really no way that a different callback could
be passed. This commit simplifies things, and removes the indirection
altogether. Bonus: with this, gdb's target_async method ends up with
the same signature as gdbserver's.
Tested on x86_64 Fedora 20, native and gdbserver.
gdb/ChangeLog:
2015-03-25 Pedro Alves <palves@redhat.com>
* target.h <to_async>: Replace 'callback' and 'context' parameters
with boolean 'enable' parameter.
(target_async): Replace CALLBACK and CONTEXT parameters with
boolean ENABLE parameter.
* inf-loop.c (inferior_event_handler): Adjust.
* linux-nat.c (linux_nat_attach, linux_nat_resume)
(linux_nat_resume): Adjust.
(async_client_callback, async_client_context): Delete.
(handle_target_event): Call inferior_event_handler directly.
(linux_nat_async): Replace 'callback' and 'context' parameters
with boolean 'enable' parameter. Adjust. Remove references to
async_client_callback and async_client_context.
(linux_nat_close): Adjust.
* record-btrace.c (record_btrace_async): Replace 'callback' and
'context' parameters with boolean 'enable' parameter. Adjust.
(record_btrace_resume): Adjust.
* record-full.c (record_full_async): Replace 'callback' and
'context' parameters with boolean 'enable' parameter. Adjust.
(record_full_resume, record_full_core_resume): Adjust.
* remote.c (struct remote_state) <async_client_callback,
async_client_context>: Delete fields.
(remote_start_remote, extended_remote_attach_1, remote_resume)
(extended_remote_create_inferior): Adjust.
(remote_async_serial_handler): Call inferior_event_handler
directly.
(remote_async): Replace 'callback' and 'context' parameters with
boolean 'enable' parameter. Adjust.
* top.c (gdb_readline_wrapper_cleanup, gdb_readline_wrapper):
Adjust.
* target-delegates.c: Regenerate.
2015-03-25 11:28:31 +00:00
|
|
|
|
2015-03-25 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* target.h <to_async>: Replace 'callback' and 'context' parameters
|
|
|
|
|
with boolean 'enable' parameter.
|
|
|
|
|
(target_async): Replace CALLBACK and CONTEXT parameters with
|
|
|
|
|
boolean ENABLE parameter.
|
|
|
|
|
* inf-loop.c (inferior_event_handler): Adjust.
|
|
|
|
|
* linux-nat.c (linux_nat_attach, linux_nat_resume)
|
|
|
|
|
(linux_nat_resume): Adjust.
|
|
|
|
|
(async_client_callback, async_client_context): Delete.
|
|
|
|
|
(handle_target_event): Call inferior_event_handler directly.
|
|
|
|
|
(linux_nat_async): Replace 'callback' and 'context' parameters
|
|
|
|
|
with boolean 'enable' parameter. Adjust. Remove references to
|
|
|
|
|
async_client_callback and async_client_context.
|
|
|
|
|
(linux_nat_close): Adjust.
|
|
|
|
|
* record-btrace.c (record_btrace_async): Replace 'callback' and
|
|
|
|
|
'context' parameters with boolean 'enable' parameter. Adjust.
|
|
|
|
|
(record_btrace_resume): Adjust.
|
|
|
|
|
* record-full.c (record_full_async): Replace 'callback' and
|
|
|
|
|
'context' parameters with boolean 'enable' parameter. Adjust.
|
|
|
|
|
(record_full_resume, record_full_core_resume): Adjust.
|
|
|
|
|
* remote.c (struct remote_state) <async_client_callback,
|
|
|
|
|
async_client_context>: Delete fields.
|
|
|
|
|
(remote_start_remote, extended_remote_attach_1, remote_resume)
|
|
|
|
|
(extended_remote_create_inferior): Adjust.
|
|
|
|
|
(remote_async_serial_handler): Call inferior_event_handler
|
|
|
|
|
directly.
|
|
|
|
|
(remote_async): Replace 'callback' and 'context' parameters with
|
|
|
|
|
boolean 'enable' parameter. Adjust.
|
|
|
|
|
* top.c (gdb_readline_wrapper_cleanup, gdb_readline_wrapper):
|
|
|
|
|
Adjust.
|
|
|
|
|
* target-delegates.c: Regenerate.
|
|
|
|
|
|
2015-03-25 11:26:43 +00:00
|
|
|
|
2015-03-25 Gary Benson <gbenson@redhat.com>
|
|
|
|
|
Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* target.c (fileio_ft_t): New typedef, define object vector.
|
|
|
|
|
(fileio_fhandles): New static variable.
|
|
|
|
|
(is_closed_fileio_fh): New macro.
|
|
|
|
|
(lowest_closed_fd): New static variable.
|
|
|
|
|
(acquire_fileio_fd): New function.
|
|
|
|
|
(release_fileio_fd): Likewise.
|
|
|
|
|
(fileio_fd_to_fh): New macro.
|
|
|
|
|
(target_fileio_open): Wrap the file descriptor on success.
|
|
|
|
|
(target_fileio_pwrite): Updated to use wrapped file descriptor.
|
|
|
|
|
(target_fileio_pread): Likewise.
|
|
|
|
|
(target_fileio_close): Likewise.
|
|
|
|
|
|
2015-03-24 21:01:29 +00:00
|
|
|
|
2015-03-24 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* thread.c (thread_apply_all_command): Take exited threads into
|
|
|
|
|
account.
|
|
|
|
|
|
2015-03-24 14:24:54 +00:00
|
|
|
|
2015-03-24 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* infrun.c (resume, proceed): Mention
|
|
|
|
|
switch_back_to_stepped_thread, not switch_back_to_stepping.
|
|
|
|
|
|
2015-03-24 14:24:53 +00:00
|
|
|
|
2015-03-24 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* infrun.c (user_visible_resume_ptid): Rewrite going from
|
|
|
|
|
most-locked to unlocked instead of the opposite. Move comment ...
|
|
|
|
|
* infrun.h (user_visible_resume_ptid): ... here.
|
|
|
|
|
|
2015-03-24 18:31:51 +00:00
|
|
|
|
2015-03-24 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* linux-nat.c (linux_nat_resume): Output debug logs before trying
|
|
|
|
|
to resume the event lwp. Use the lwp's ptid instead of the passed
|
|
|
|
|
in (maybe wildcard) ptid.
|
|
|
|
|
(stop_wait_callback): Tweak debug log output.
|
|
|
|
|
(check_stopped_by_breakpoint): Tweak debug log output. Also dump
|
|
|
|
|
TRAP_TRACE.
|
|
|
|
|
(linux_nat_filter_event): In debug output, distinguish a
|
|
|
|
|
resume_stop SIGSTOP from a delayed SIGSTOP. Output debug logs
|
|
|
|
|
before trying to resume the lwp.
|
|
|
|
|
|
2015-03-24 18:14:13 +00:00
|
|
|
|
2015-03-24 Joel Brobecker <brobecker@adacore.com>
|
|
|
|
|
|
|
|
|
|
* gdbtypes.h (struct dynamic_prop_list) <prop>: Remove
|
|
|
|
|
pointer indirection.
|
|
|
|
|
* gdbtypes.c (get_dyn_prop): Adjust, following change above.
|
|
|
|
|
(add_dyn_prop, copy_dynamic_prop_list): Likewise.
|
|
|
|
|
|
2015-03-24 18:03:21 +00:00
|
|
|
|
2015-03-24 Joel Brobecker <brobecker@adacore.com>
|
|
|
|
|
|
|
|
|
|
* gdbtypes.h (enum dynamic_prop_node_kind) <DYN_PROP_DATA_LOCATION>:
|
|
|
|
|
Renames DYN_ATTR_DATA_LOCATION.
|
|
|
|
|
(TYPE_DATA_LOCATION): Use DYN_PROP_DATA_LOCATION instead of
|
|
|
|
|
DYN_ATTR_DATA_LOCATION.
|
|
|
|
|
* dwarf2read.c (set_die_type): Use DYN_PROP_DATA_LOCATION
|
|
|
|
|
instead of DYN_ATTR_DATA_LOCATION.
|
|
|
|
|
|
Remove 'step' parameters from 'proceed' and 'resume'
The "step" parameters of 'proceed' and 'resume' aren't really useful
as indication of whether run control wants to single-step the target,
as that information must already be retrievable from
currently_stepping. In fact, if currently_stepping disagrees with
whether we single-stepped the target, then things break. Thus instead
of having the same information in two places, this patch removes those
parameters.
Setting 'step_start_function' is the only user of proceed's 'step'
argument, other than passing the 'step' argument down to 'resume' and
debug log output. Move that instead to set_step_frame, where we
already set other related fields.
clear_proceed_status keeps its "step" parameter for now because it
needs to know which set of threads should have their state cleared,
and is called before the "stepping_command" flag is set.
Tested on x86_64 Fedora 20, native and gdbserver.
gdb/ChangeLog:
2015-03-24 Pedro Alves <palves@redhat.com>
* breakpoint.c (until_break_command): Adjust call to proceed.
* gdbthread.h (struct thread_control_state) <stepping_command>:
New field.
* infcall.c (run_inferior_call): Adjust call to proceed.
* infcmd.c (run_command_1, proceed_thread_callback, continue_1):
Adjust calls to proceed.
(set_step_frame): Set the current thread's step_start_function
here.
(step_once): Adjust calls to proceed.
(jump_command, signal_command, until_next_command)
(finish_backward, finish_forward, proceed_after_attach_callback)
(attach_command_post_wait): Adjust calls to proceed.
* infrun.c (proceed_after_vfork_done): Adjust call to proceed.
(do_target_resume): New function, factored out from ...
(resume): ... here. Remove 'step' parameter. Instead, check
currently_stepping to determine whether the thread should be
single-stepped.
(proceed): Remove 'step' parameter and don't set the thread's
step_start_function here. Adjust call to 'resume'.
(handle_inferior_event): Adjust calls to 'resume'.
(switch_back_to_stepped_thread): Use do_target_resume instead of
'resume'.
(keep_going): Adjust calls to 'resume'.
* infrun.h (proceed): Remove 'step' parameter.
(resume): Likewise.
* windows-nat.c (do_initial_windows_stuff): Adjust call to
'resume'.
* mi/mi-main.c (proceed_thread): Adjust call to 'proceed'.
2015-03-24 17:50:31 +00:00
|
|
|
|
2015-03-24 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* breakpoint.c (until_break_command): Adjust call to proceed.
|
|
|
|
|
* gdbthread.h (struct thread_control_state) <stepping_command>:
|
|
|
|
|
New field.
|
|
|
|
|
* infcall.c (run_inferior_call): Adjust call to proceed.
|
|
|
|
|
* infcmd.c (run_command_1, proceed_thread_callback, continue_1):
|
|
|
|
|
Adjust calls to proceed.
|
|
|
|
|
(set_step_frame): Set the current thread's step_start_function
|
|
|
|
|
here.
|
|
|
|
|
(step_once): Adjust calls to proceed.
|
|
|
|
|
(jump_command, signal_command, until_next_command)
|
|
|
|
|
(finish_backward, finish_forward, proceed_after_attach_callback)
|
|
|
|
|
(attach_command_post_wait): Adjust calls to proceed.
|
|
|
|
|
* infrun.c (proceed_after_vfork_done): Adjust call to proceed.
|
|
|
|
|
(do_target_resume): New function, factored out from ...
|
|
|
|
|
(resume): ... here. Remove 'step' parameter. Instead, check
|
|
|
|
|
currently_stepping to determine whether the thread should be
|
|
|
|
|
single-stepped.
|
|
|
|
|
(proceed): Remove 'step' parameter and don't set the thread's
|
|
|
|
|
step_start_function here. Adjust call to 'resume'.
|
|
|
|
|
(handle_inferior_event): Adjust calls to 'resume'.
|
|
|
|
|
(switch_back_to_stepped_thread): Use do_target_resume instead of
|
|
|
|
|
'resume'.
|
|
|
|
|
(keep_going): Adjust calls to 'resume'.
|
|
|
|
|
* infrun.h (proceed): Remove 'step' parameter.
|
|
|
|
|
(resume): Likewise.
|
|
|
|
|
* windows-nat.c (do_initial_windows_stuff): Adjust call to
|
|
|
|
|
'resume'.
|
|
|
|
|
* mi/mi-main.c (proceed_thread): Adjust call to 'proceed'.
|
|
|
|
|
|
Make "set scheduler-locking step" depend on user intention, only
Currently, "set scheduler-locking step" is a bit odd. The manual
documents it as being optimized for stepping, so that focus of
debugging does not change unexpectedly, but then it says that
sometimes other threads may run, and thus focus may indeed change
unexpectedly... A user can then be excused to get confused and wonder
why does GDB behave like this.
I don't think a user should have to know about details of how "next"
or whatever other run control command is implemented internally to
understand when does the "scheduler-locking step" setting take effect.
This patch completes a transition that the code has been moving
towards for a while. It makes "set scheduler-locking step" hold
threads depending on whether the _command_ the user entered was a
stepping command [step/stepi/next/nexti], or not.
Before, GDB could end up locking threads even on "continue" if for
some reason run control decides a thread needs to be single stepped
(e.g., for a software watchpoint).
After, if a "continue" happens to need to single-step for some reason,
we won't lock threads (unless when stepping over a breakpoint,
naturally). And if a stepping command wants to continue a thread for
bit, like when skipping a function to a step-resume breakpoint, we'll
still lock threads, so focus of debugging doesn't change.
In order to make this work, we need to record in the thread structure
whether what set it running was a stepping command.
(A follow up patch will remove the "step" parameters of 'proceed' and 'resume')
FWIW, Fedora GDB, which defaults to "scheduler-locking step" (mainline
defaults to "off") carries a different patch that goes in this
direction as well.
Tested on x86_64 Fedora 20, native and gdbserver.
gdb/ChangeLog:
2015-03-24 Pedro Alves <palves@redhat.com>
* gdbthread.h (struct thread_control_state) <stepping_command>:
New field.
* infcmd.c (step_once): Pass step=1 to clear_proceed_status. Set
the thread's stepping_command field.
* infrun.c (resume): Check the thread's stepping_command flag to
determine which threads should be resumed. Rename 'entry_step'
local to user_step.
(clear_proceed_status_thread): Clear 'stepping_command'.
(schedlock_applies): Change parameter type to struct thread_info
pointer. Adjust.
(find_thread_needs_step_over): Remove 'step' parameter. Adjust.
(switch_back_to_stepped_thread): Adjust calls to
'schedlock_applies'.
(_initialize_infrun): Adjust "set scheduler-locking step" help.
gdb/testsuite/ChangeLog:
2015-03-24 Pedro Alves <palves@redhat.com>
* gdb.threads/schedlock.exp (test_step): No longer expect that
"set scheduler-locking step" with "next" over a function call runs
threads unlocked.
gdb/doc/ChangeLog:
2015-03-24 Pedro Alves <palves@redhat.com>
* gdb.texinfo (test_step) <set scheduler-locking step>: No longer
mention that threads may sometimes run unlocked.
2015-03-24 17:50:31 +00:00
|
|
|
|
2015-03-24 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdbthread.h (struct thread_control_state) <stepping_command>:
|
|
|
|
|
New field.
|
|
|
|
|
* infcmd.c (step_once): Pass step=1 to clear_proceed_status. Set
|
|
|
|
|
the thread's stepping_command field.
|
|
|
|
|
* infrun.c (resume): Check the thread's stepping_command flag to
|
|
|
|
|
determine which threads should be resumed. Rename 'entry_step'
|
|
|
|
|
local to user_step.
|
|
|
|
|
(clear_proceed_status_thread): Clear 'stepping_command'.
|
|
|
|
|
(schedlock_applies): Change parameter type to struct thread_info
|
|
|
|
|
pointer. Adjust.
|
|
|
|
|
(find_thread_needs_step_over): Remove 'step' parameter. Adjust.
|
|
|
|
|
(switch_back_to_stepped_thread): Adjust calls to
|
|
|
|
|
'schedlock_applies'.
|
|
|
|
|
(_initialize_infrun): Adjust "set scheduler-locking step" help.
|
|
|
|
|
|
2015-03-24 17:50:30 +00:00
|
|
|
|
2015-03-24 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* infrun.c (step_start_function): Delete and ...
|
|
|
|
|
* gdbthread.h (struct thread_control_state) <step_start_function>:
|
|
|
|
|
... now a field here.
|
|
|
|
|
* infrun.c (clear_proceed_status_thread): Clear the thread's
|
|
|
|
|
step_start_function.
|
|
|
|
|
(proceed, process_event_stop_test, print_stop_event): Adjust.
|
|
|
|
|
|
2015-03-24 17:50:29 +00:00
|
|
|
|
2015-03-24 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* infrun.c (proceed): No longer handle negative step.
|
|
|
|
|
|
2015-03-24 14:05:45 +00:00
|
|
|
|
2015-03-24 Gary Benson <gbenson@redhat.com>
|
|
|
|
|
|
|
|
|
|
* nat/x86-linux.h (x86_linux_new_thread): New declaration.
|
|
|
|
|
(x86_linux_prepare_to_resume): Likewise.
|
|
|
|
|
* x86-linux-nat.c (x86_linux_new_thread):
|
|
|
|
|
Moved to nat/x86-linux.c.
|
|
|
|
|
(x86_linux_prepare_to_resume): Likewise.
|
|
|
|
|
* nat/x86-linux.c (x86_linux_new_thread): New function.
|
|
|
|
|
(x86_linux_prepare_to_resume): Likewise.
|
|
|
|
|
|
2015-03-24 14:05:45 +00:00
|
|
|
|
2015-03-24 Gary Benson <gbenson@redhat.com>
|
|
|
|
|
|
|
|
|
|
* nat/x86-linux-dregs.h: New file.
|
|
|
|
|
* nat/x86-linux-dregs.c: Likewise.
|
|
|
|
|
* Makefile.in (HFILES_NO_SRCDIR): Add nat/x86-linux-dregs.h.
|
|
|
|
|
(x86-linux-dregs.o): New rule.
|
|
|
|
|
* config/i386/linux.mh (NATDEPFILES): Add x86-linux-dregs.o.
|
|
|
|
|
* config/i386/linux64.mh (NATDEPFILES): Likewise.
|
|
|
|
|
* x86-linux-nat.c: Include nat/x86-linux-dregs.h.
|
|
|
|
|
(u_debugreg_offset): Moved to nat/x86-linux-dregs.c.
|
|
|
|
|
(x86_linux_dr_get): Likewise.
|
|
|
|
|
(x86_linux_dr_set): Likewise.
|
|
|
|
|
(x86_linux_dr_get_addr): Likewise.
|
|
|
|
|
(x86_linux_dr_get_control): Likewise.
|
|
|
|
|
(x86_linux_dr_get_status): Likewise.
|
|
|
|
|
(update_debug_registers_callback): Likewise.
|
|
|
|
|
(x86_linux_dr_set_control): Likewise.
|
|
|
|
|
(x86_linux_dr_set_addr): Likewise.
|
|
|
|
|
(x86_linux_update_debug_registers): Likewise.
|
|
|
|
|
|
2015-03-24 14:05:44 +00:00
|
|
|
|
2015-03-24 Gary Benson <gbenson@redhat.com>
|
|
|
|
|
|
|
|
|
|
* x86-linux-nat.c (x86_linux_update_debug_registers):
|
|
|
|
|
New function, factored out from...
|
|
|
|
|
(x86_linux_prepare_to_resume): ...this.
|
|
|
|
|
|
2015-03-24 14:05:44 +00:00
|
|
|
|
2015-03-24 Gary Benson <gbenson@redhat.com>
|
|
|
|
|
|
|
|
|
|
* x86-linux-nat.c (x86_linux_dr_get): Update comments.
|
|
|
|
|
(x86_linux_dr_set): Likewise.
|
|
|
|
|
(x86_linux_dr_get_addr): Likewise.
|
|
|
|
|
(x86_linux_dr_get_control): Likewise.
|
|
|
|
|
(x86_linux_dr_get_status): Likewise.
|
|
|
|
|
(update_debug_registers_callback): Likewise.
|
|
|
|
|
(x86_linux_dr_set_control): Likewise.
|
|
|
|
|
(x86_linux_dr_set_addr): Likewise.
|
|
|
|
|
(x86_linux_prepare_to_resume): Likewise.
|
|
|
|
|
(x86_linux_new_thread): Likewise.
|
|
|
|
|
|
2015-03-24 14:05:44 +00:00
|
|
|
|
2015-03-24 Gary Benson <gbenson@redhat.com>
|
|
|
|
|
|
|
|
|
|
* x86-linux-nat.c (x86_linux_dr_set_addr): Update assertion.
|
|
|
|
|
(x86_linux_new_thread): Rename argument.
|
|
|
|
|
|
2015-03-24 14:05:44 +00:00
|
|
|
|
2015-03-24 Gary Benson <gbenson@redhat.com>
|
|
|
|
|
|
|
|
|
|
* nat/x86-linux.h: New file.
|
|
|
|
|
* nat/x86-linux.c: Likewise.
|
|
|
|
|
* Makefile.in (HFILES_NO_SRCDIR): Add nat/x86-linux.h.
|
|
|
|
|
(x86-linux.o): New rule.
|
|
|
|
|
* config/i386/linux.mh (NATDEPFILES): Add x86-linux.o.
|
|
|
|
|
* config/i386/linux64.mh (NATDEPFILES): Likewise.
|
|
|
|
|
* nat/linux-nat.h (struct arch_lwp_info): New forward declaration.
|
|
|
|
|
(lwp_set_arch_private_info): New declaration.
|
|
|
|
|
(lwp_arch_private_info): Likewise.
|
|
|
|
|
* linux-nat.c (lwp_set_arch_private_info): New function.
|
|
|
|
|
(lwp_arch_private_info): Likewise.
|
|
|
|
|
* x86-linux-nat.c: Include nat/x86-linux.h.
|
|
|
|
|
(arch_lwp_info): Removed structure.
|
|
|
|
|
(update_debug_registers_callback):
|
|
|
|
|
Use lwp_set_debug_registers_changed.
|
|
|
|
|
(x86_linux_prepare_to_resume): Use lwp_debug_registers_changed
|
|
|
|
|
and lwp_set_debug_registers_changed.
|
|
|
|
|
(x86_linux_new_thread): Use lwp_set_debug_registers_changed.
|
|
|
|
|
|
2015-03-24 14:05:44 +00:00
|
|
|
|
2015-03-24 Gary Benson <gbenson@redhat.com>
|
|
|
|
|
|
|
|
|
|
* nat/linux-nat.h (ptid_of_lwp): New declaration.
|
|
|
|
|
(lwp_is_stopped): Likewise.
|
|
|
|
|
(lwp_stop_reason): Likewise.
|
|
|
|
|
* linux-nat.c (ptid_of_lwp): New function.
|
|
|
|
|
(lwp_is_stopped): Likewise.
|
|
|
|
|
(lwp_is_stopped_by_watchpoint): Likewise.
|
|
|
|
|
* x86-linux-nat.c (update_debug_registers_callback):
|
|
|
|
|
Use lwp_is_stopped.
|
|
|
|
|
(x86_linux_prepare_to_resume): Use ptid_of_lwp and
|
|
|
|
|
lwp_stop_reason.
|
|
|
|
|
|
2015-03-24 14:05:44 +00:00
|
|
|
|
2015-03-24 Gary Benson <gbenson@redhat.com>
|
|
|
|
|
|
|
|
|
|
* linux-nat.h (linux_stop_lwp): Move declaration to...
|
|
|
|
|
* nat/linux-nat.h (linux_stop_lwp): New declaration.
|
|
|
|
|
|
2015-03-24 14:05:43 +00:00
|
|
|
|
2015-03-24 Gary Benson <gbenson@redhat.com>
|
|
|
|
|
|
|
|
|
|
* linux-nat.h: Include nat/linux-nat.h.
|
|
|
|
|
(iterate_over_lwps): Move declaration to nat/linux-nat.h.
|
|
|
|
|
* nat/linux-nat.h (struct lwp_info): New forward declaration.
|
|
|
|
|
(iterate_over_lwps_ftype): New typedef.
|
|
|
|
|
(iterate_over_lwps): New declaration.
|
|
|
|
|
* linux-nat.h (iterate_over_lwps): Update comment. Use
|
|
|
|
|
iterate_over_lwps_ftype. Update callback return value check.
|
|
|
|
|
|
2015-03-24 14:05:43 +00:00
|
|
|
|
2015-03-24 Gary Benson <gbenson@redhat.com>
|
|
|
|
|
|
|
|
|
|
* x86-nat.h (x86_debug_reg_state): Move declaration to...
|
|
|
|
|
* nat/x86-dregs.h (x86_debug_reg_state): New declaration.
|
|
|
|
|
|
2015-03-24 14:05:43 +00:00
|
|
|
|
2015-03-24 Gary Benson <gbenson@redhat.com>
|
|
|
|
|
|
|
|
|
|
* nat/linux-nat.h (current_lwp_ptid): New declaration.
|
|
|
|
|
* linux-nat.c (current_lwp_ptid): New function.
|
|
|
|
|
* x86-linux-nat.c: Include nat/linux-nat.h.
|
|
|
|
|
(x86_linux_dr_get_addr): Use current_lwp_ptid.
|
|
|
|
|
(x86_linux_dr_get_control): Likewise.
|
|
|
|
|
(x86_linux_dr_get_status): Likewise.
|
|
|
|
|
(x86_linux_dr_set_control): Likewise.
|
|
|
|
|
(x86_linux_dr_set_addr): Likewise.
|
|
|
|
|
|
2015-02-19 20:23:34 +00:00
|
|
|
|
2015-03-24 Antoine Tremblay <antoine.tremblay@ericsson.com>
|
|
|
|
|
|
|
|
|
|
PR breakpoints/16466
|
|
|
|
|
* breakpoint.c (create_breakpoint): Set thread on breakpoint struct.
|
|
|
|
|
|
2015-03-23 22:42:23 +00:00
|
|
|
|
2015-03-23 Joel Brobecker <brobecker@adacore.com>
|
|
|
|
|
|
|
|
|
|
* ser-mingw.c (ser_windows_setparity): Fix indentation.
|
|
|
|
|
* ser-unix.c (hardwire_setparity): Likewise.
|
|
|
|
|
|
2015-03-23 21:15:42 +00:00
|
|
|
|
2015-03-23 Yurij Grechishhev <yurij.grechishhev@gmail.com>
|
|
|
|
|
|
|
|
|
|
* NEWS: Mention set/show serial parity command.
|
|
|
|
|
* monitor.c (monitor_open): Call serial_setparity.
|
|
|
|
|
* remote.c (remote_open_1): Likewise.
|
|
|
|
|
* ser-base.c (ser_base_serparity): New function.
|
|
|
|
|
* ser-base.h (ser_base_setparity): Add declaration.
|
|
|
|
|
* ser-go32.c (dos_ops): Set "setparity" field.
|
|
|
|
|
* ser-mingw.c (ser_windows_raw): Do not set state.fParity and
|
|
|
|
|
state.Parity.
|
|
|
|
|
(ser_windows_setparity): New function.
|
|
|
|
|
(hardwire_ops): Add ser_windows_setparity.
|
|
|
|
|
(tty_ops): Add NULL for setparity field.
|
|
|
|
|
(pipe_ops): Add ser_base_setparity.
|
|
|
|
|
(tcp_ops): Likewise.
|
|
|
|
|
* ser-pipe.c (pipe_ops): Likewise.
|
|
|
|
|
* ser-tcp.c (tcp_ops): Likewise.
|
|
|
|
|
* ser-unix.c (hardwire_setparity): Add declaration.
|
|
|
|
|
(hardwire_raw): Don't reset PARENB flag.
|
|
|
|
|
(hardwire_setparity): New function.
|
|
|
|
|
(hardwire_ops): Add hardwire_setparity.
|
|
|
|
|
* serial.c (serial_setparity): New function.
|
|
|
|
|
(serial_parity): New global.
|
|
|
|
|
(parity_none, parity_odd, parity_even, parity_enums, parity):
|
|
|
|
|
New static globals.
|
|
|
|
|
(set_parity): New function.
|
|
|
|
|
(_initialize_serial): Add set/show serial parity commands.
|
|
|
|
|
* serial.h (GDBPARITY_NONE): Define.
|
|
|
|
|
(GDBPARITY_ODD): Define.
|
|
|
|
|
(GDBPARITY_EVEN): Define.
|
|
|
|
|
(serial_setparity) Add declaration.
|
|
|
|
|
(struct serial_ops): Add setparity field.
|
|
|
|
|
* target.h (serial_parity): Add declaration.
|
|
|
|
|
|
2015-03-23 20:32:01 +00:00
|
|
|
|
2015-03-23 Keith Seitz <keiths@redhat.com>
|
|
|
|
|
|
|
|
|
|
* linespec.c (linespec_lexer_lex_keyword): Update comment.
|
|
|
|
|
|
2015-03-23 20:29:19 +00:00
|
|
|
|
2015-03-23 Keith Seitz <keiths@redhat.com>
|
|
|
|
|
|
|
|
|
|
* breakpoint.c (parse_breakpoint_sals): Use
|
|
|
|
|
linespec_lexer_lex_keyword to ascertain if the user specified
|
|
|
|
|
a NULL location.
|
|
|
|
|
* linespec.c [IF_KEYWORD_INDEX]: Define.
|
|
|
|
|
(linespec_lexer_lex_keyword): Export.
|
|
|
|
|
(struct ls_parser) <keyword_ok>: Remove.
|
|
|
|
|
A keyword is only a keyword if not followed by another keyword.
|
|
|
|
|
(linespec_lexer_lex_one): Remove keyword_ok handling.
|
|
|
|
|
Add comment explaining why the parsing stream is not advanced
|
|
|
|
|
when a keyword is seen.
|
|
|
|
|
(parse_linespec): Remove parser->keyword_ok.
|
|
|
|
|
* linespec.h (linespec_lexer_lex_keyword): Add declaration.
|
|
|
|
|
|
2015-02-27 17:55:07 +00:00
|
|
|
|
2015-03-23 Keith Seitz <keiths@redhat.com>
|
|
|
|
|
|
|
|
|
|
PR gdb/18021
|
|
|
|
|
* dwarf2read.c (dwarf2_add_member_fn): Issue a complaint
|
|
|
|
|
if we find a static method with DW_AT_vtable_elem_location.
|
|
|
|
|
|
2015-03-21 08:48:34 +00:00
|
|
|
|
2015-03-21 Eli Zaretskii <eliz@gnu.org>
|
|
|
|
|
|
|
|
|
|
* tui/tui-io.c (tui_expand_tabs): Reinitialize the column counter
|
|
|
|
|
before the second loop, to avoid undefined behavior. Reported by
|
|
|
|
|
Anton Blanchard <anton@samba.org>.
|
|
|
|
|
|
2015-03-20 21:45:20 +00:00
|
|
|
|
2015-03-20 Keven Boell <keven.boell@intel.com>
|
|
|
|
|
|
|
|
|
|
* gdbtypes.c (resolve_dynamic_type_internal): Adapt
|
|
|
|
|
data_location usage to linked list.
|
|
|
|
|
(resolve_dynamic_type_internal): Adapt data_location to
|
|
|
|
|
linked list.
|
|
|
|
|
(get_dyn_prop, add_dyn_prop, copy_dynamic_prop_list): New function.
|
|
|
|
|
(copy_type_recursive, copy_type): Add copy of linked list.
|
|
|
|
|
* gdbtypes.h (enum dynamic_prop_node_kind): New enum.
|
|
|
|
|
(struct dynamic_prop_list): New struct.
|
|
|
|
|
* dwarf2read.c (set_die_type): Set data_location data.
|
|
|
|
|
|
2015-03-09 11:58:23 +00:00
|
|
|
|
2015-03-20 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* i386-sol2-tdep.c (i386_sol2_static_transform_name): Move "p" to
|
|
|
|
|
inner block and make it const.
|
|
|
|
|
* machoread.c (get_archive_prefix_len): Make "lparen" const.
|
|
|
|
|
|
2015-03-09 11:58:21 +00:00
|
|
|
|
2015-03-20 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* breakpoint.c (set_breakpoint_condition): Make argument "exp" const.
|
|
|
|
|
* breakpoint.h (set_breakpoint_condition): Update declaration.
|
|
|
|
|
|
2015-03-09 11:58:20 +00:00
|
|
|
|
2015-03-20 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* tui/tui-io.c (tui_expand_tabs): Make "s1" const.
|
|
|
|
|
|
2015-03-09 11:58:20 +00:00
|
|
|
|
2015-03-20 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* xcoffread.c (scan_xcoff_symtab): Make "p" and "q" const.
|
|
|
|
|
|
2015-03-09 11:58:19 +00:00
|
|
|
|
2015-03-20 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* remote-m32r-sdi.c (m32r_open): Make "port_str" const.
|
|
|
|
|
|
2015-03-09 11:58:14 +00:00
|
|
|
|
2015-03-20 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* nto-tdep.c (nto_find_and_open_solib): Make "endian" const.
|
|
|
|
|
(nto_init_solib_absolute_prefix): Likewise.
|
|
|
|
|
|
2015-03-09 11:58:17 +00:00
|
|
|
|
2015-03-20 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* sparc-sol2-tdep.c (sparc_sol2_static_transform_name): Make "p" const.
|
|
|
|
|
* spu-tdep.c (spu_gdbarch_init): Make "name" const.
|
|
|
|
|
|
2015-03-20 16:15:15 +00:00
|
|
|
|
2015-03-20 Jan Kratochvil <jan.kratochvil@redhat.com>
|
|
|
|
|
|
|
|
|
|
* config/djgpp/README: Remove gdb.hp.
|
|
|
|
|
|
Don't call set_gdbarch_cannot_step_breakpoint in aarch64_gdbarch_init
Hi,
I am looking at the following fails in aarch64-linux,
stepi^M
47 NOP; /* after permanent bp */^M
(gdb) FAIL: gdb.base/bp-permanent.exp: always_inserted=off, sw_watchpoint=0: stepi signal with handler: single-step to handler
the test expects GDB single step into signal handler, but GDB doesn't.
The code in infrun.c:resume
/* Most targets can step a breakpoint instruction, thus
executing it normally. But if this one cannot, just
continue and we will hit it anyway. */
if (gdbarch_cannot_step_breakpoint (gdbarch))
step = 0;
change the intended action from "step" to "continue". The gdbarch method
cannot_step_breakpoint isn't documented well, and I don't get much clue
after explore the history. However, from the comments above,
aarch64-linux can step a breakpoint instruction, so don't need to call
set_gdbarch_cannot_step_breakpoint.
gdb:
2015-03-20 Yao Qi <yao.qi@linaro.org>
* aarch64-tdep.c (aarch64_gdbarch_init): Don't call
set_gdbarch_cannot_step_breakpoint.
2015-03-20 10:15:21 +00:00
|
|
|
|
2015-03-20 Yao Qi <yao.qi@linaro.org>
|
|
|
|
|
|
|
|
|
|
* aarch64-tdep.c (aarch64_gdbarch_init): Don't call
|
|
|
|
|
set_gdbarch_cannot_step_breakpoint.
|
|
|
|
|
|
Fix race exposed by gdb.threads/killed.exp
On GNU/Linux, this test sometimes FAILs like this:
(gdb) run
Starting program: /home/pedro/gdb/mygit/build/gdb/testsuite/gdb.threads/killed
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
ptrace: No such process.
(gdb)
Program terminated with signal SIGKILL, Killed.
The program no longer exists.
FAIL: gdb.threads/killed.exp: run program to completion (timeout)
Note the suspicious "No such process" line (that's errno==ESRCH).
Adding debug output we see:
linux_nat_wait: [process -1], [TARGET_WNOHANG]
LLW: enter
LNW: waitpid(-1, ...) returned 18465, ERRNO-OK
LLW: waitpid 18465 received Stopped (signal) (stopped)
LNW: waitpid(-1, ...) returned 18461, ERRNO-OK
LLW: waitpid 18461 received Trace/breakpoint trap (stopped)
LLW: Handling extended status 0x03057f
LHEW: Got clone event from LWP 18461, new child is LWP 18465
LNW: waitpid(-1, ...) returned 0, ERRNO-OK
RSRL: resuming stopped-resumed LWP LWP 18465 at 0x3b36af4b51: step=0
RSRL: resuming stopped-resumed LWP LWP 18461 at 0x3b36af4b51: step=0
sigchld
ptrace: No such process.
(gdb) linux_nat_wait: [process -1], [TARGET_WNOHANG]
LLW: enter
LNW: waitpid(-1, ...) returned 18465, ERRNO-OK
LLW: waitpid 18465 received Killed (terminated)
LLW: LWP 18465 exited.
LNW: waitpid(-1, ...) returned 18461, No child processes
LLW: waitpid 18461 received Killed (terminated)
Process 18461 exited
LNW: waitpid(-1, ...) returned -1, No child processes
LLW: exit
sigchld
infrun: target_wait (-1, status) =
infrun: 18461 [process 18461],
infrun: status->kind = signalled, signal = GDB_SIGNAL_KILL
infrun: TARGET_WAITKIND_SIGNALLED
Program terminated with signal SIGKILL, Killed.
The program no longer exists.
infrun: stop_waiting
FAIL: gdb.threads/killed.exp: run program to completion (timeout)
The issue is that here:
RSRL: resuming stopped-resumed LWP LWP 18465 at 0x3b36af4b51: step=0
RSRL: resuming stopped-resumed LWP LWP 18461 at 0x3b36af4b51: step=0
The first line shows we had just resumed LWP 18465, which does:
void *
child_func (void *dummy)
{
kill (pid, SIGKILL);
exit (1);
}
So if the kernel manages to schedule that thread fast enough, the
process may be killed before GDB has a chance to resume LWP 18461.
GDBserver has code at the tail end of linux_resume_one_lwp to cope
with this:
~~~
ptrace (step ? PTRACE_SINGLESTEP : PTRACE_CONT, lwpid_of (thread),
(PTRACE_TYPE_ARG3) 0,
/* Coerce to a uintptr_t first to avoid potential gcc warning
of coercing an 8 byte integer to a 4 byte pointer. */
(PTRACE_TYPE_ARG4) (uintptr_t) signal);
current_thread = saved_thread;
if (errno)
{
/* ESRCH from ptrace either means that the thread was already
running (an error) or that it is gone (a race condition). If
it's gone, we will get a notification the next time we wait,
so we can ignore the error. We could differentiate these
two, but it's tricky without waiting; the thread still exists
as a zombie, so sending it signal 0 would succeed. So just
ignore ESRCH. */
if (errno == ESRCH)
return;
perror_with_name ("ptrace");
}
~~~
However, that's not a complete fix, because between starting to handle
the resume request and getting that PTRACE_CONTINUE, we run other
ptrace calls that can also fail with ESRCH, and that end up throwing
an error (with perror_with_name).
In the case above, I indeed sometimes see resume_stopped_resumed_lwps
fail in the registers read:
resume_stopped_resumed_lwps (struct lwp_info *lp, void *data)
{
...
CORE_ADDR pc = regcache_read_pc (regcache);
Or e.g., in 32-bit mode, i386_linux_resume has several calls that can
throw too.
Whether to ignore ptrace errors or not depends on context that is only
available somewhere up the call chain. So the fix is to let ptrace
errors throw as they do today, and wrap the resume request in a
TRY/CATCH that swallows it iff the lwp that we were trying to resume
is no longer ptrace-stopped.
gdb/gdbserver/ChangeLog:
2015-03-19 Pedro Alves <palves@redhat.com>
* linux-low.c (linux_resume_one_lwp): Rename to ...
(linux_resume_one_lwp_throw): ... this. Don't handle ESRCH here,
instead call perror_with_name.
(check_ptrace_stopped_lwp_gone): New function.
(linux_resume_one_lwp): Reimplement as wrapper around
linux_resume_one_lwp_throw that swallows errors if the LWP is
gone.
gdb/ChangeLog:
2015-03-19 Pedro Alves <palves@redhat.com>
* linux-nat.c (linux_resume_one_lwp): Rename to ...
(linux_resume_one_lwp_throw): ... this. Don't handle ESRCH here,
instead call perror_with_name.
(check_ptrace_stopped_lwp_gone): New function.
(linux_resume_one_lwp): Reimplement as wrapper around
linux_resume_one_lwp_throw that swallows errors if the LWP is
gone.
(resume_stopped_resumed_lwps): Try register reads in TRY/CATCH and
swallows errors if the LWP is gone. Use
linux_resume_one_lwp_throw instead of linux_resume_one_lwp.
2015-03-19 15:12:33 +00:00
|
|
|
|
2015-03-19 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* linux-nat.c (linux_resume_one_lwp): Rename to ...
|
|
|
|
|
(linux_resume_one_lwp_throw): ... this. Don't handle ESRCH here,
|
|
|
|
|
instead call perror_with_name.
|
|
|
|
|
(check_ptrace_stopped_lwp_gone): New function.
|
|
|
|
|
(linux_resume_one_lwp): Reimplement as wrapper around
|
|
|
|
|
linux_resume_one_lwp_throw that swallows errors if the LWP is
|
|
|
|
|
gone.
|
|
|
|
|
(resume_stopped_resumed_lwps): Try register reads in TRY/CATCH and
|
|
|
|
|
swallows errors if the LWP is gone. Use
|
|
|
|
|
linux_resume_one_lwp_throw instead of linux_resume_one_lwp.
|
|
|
|
|
|
2015-03-19 12:20:25 +00:00
|
|
|
|
2015-03-19 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* linux-nat.c (status_callback): Return early if the LWP has no
|
|
|
|
|
status pending.
|
|
|
|
|
|
2015-03-19 12:24:06 +00:00
|
|
|
|
2015-03-19 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* linux-nat.c (select_event_lwp_callback): Update comment to no
|
|
|
|
|
longer mention SIGTRAP.
|
|
|
|
|
|
2015-03-05 13:36:32 +00:00
|
|
|
|
2015-03-18 Tristan Gingold <gingold@adacore.com>
|
|
|
|
|
|
|
|
|
|
* amd64-windows-tdep.c (amd64_windows_find_unwind_info): Move
|
|
|
|
|
redirection code to ...
|
|
|
|
|
(amd64_windows_frame_decode_insns): ... Here. Fix in prologue
|
|
|
|
|
checks. Fix SAVE_NONVOL operations. Add debug code and comments.
|
|
|
|
|
|
2015-03-18 11:19:02 +00:00
|
|
|
|
2015-03-18 Gary Benson <gbenson@redhat.com>
|
|
|
|
|
|
|
|
|
|
(remote_protocol_features): Remove the "vFile:fstat" feature.
|
|
|
|
|
(remote_hostio_fstat): Probe for "vFile:fstat" support.
|
|
|
|
|
|
Support catch syscall on aarch64 linux
Hi,
This patch is to support catch syscall on aarch64 linux. We
implement gdbarch method get_syscall_number for aarch64-linux,
and add aarch64-linux.xml file, which looks straightforward, however
the changes to test case doesn't.
First of all, we enable catch-syscall.exp on aarch64-linux target,
but skip the multi_arch testing on current stage. I plan to touch
multi arch debugging on aarch64-linux later.
Then, when I run catch-syscall.exp on aarch64-linux, gcc errors that
SYS_pipe isn't defined. We find that aarch64 kernel only has pipe2
syscall and libc already convert pipe to pipe2. As a result, I change
catch-syscall.c to use SYS_pipe if it is defined, otherwise use
SYS_pipe2 instead. The vector all_syscalls in catch-syscall.exp can't
be pre-determined, so I add a new proc setup_all_syscalls to fill it,
according to the availability of SYS_pipe.
Regression tested on {x86_64, aarch64}-linux x {native, gdbserver}.
gdb:
2015-03-18 Yao Qi <yao.qi@linaro.org>
PR tdep/18107
* aarch64-linux-tdep.c: Include xml-syscall.h
(aarch64_linux_get_syscall_number): New function.
(aarch64_linux_init_abi): Call
set_gdbarch_get_syscall_number.
* syscalls/aarch64-linux.xml: New file.
gdb/testsuite:
2015-03-18 Yao Qi <yao.qi@linaro.org>
PR tdep/18107
* gdb.base/catch-syscall.c [!SYS_pipe] (pipe2_syscall): New
variable.
* gdb.base/catch-syscall.exp: Don't skip it on
aarch64*-*-linux* target. Remove elements in all_syscalls.
(test_catch_syscall_multi_arch): Skip it on aarch64*-linux*
target.
(setup_all_syscalls): New proc.
2015-03-18 10:47:45 +00:00
|
|
|
|
2015-03-11 Yao Qi <yao.qi@linaro.org>
|
|
|
|
|
|
|
|
|
|
PR tdep/18107
|
|
|
|
|
* aarch64-linux-tdep.c: Include xml-syscall.h
|
|
|
|
|
(aarch64_linux_get_syscall_number): New function.
|
|
|
|
|
(aarch64_linux_init_abi): Call
|
|
|
|
|
set_gdbarch_get_syscall_number.
|
|
|
|
|
* syscalls/aarch64-linux.xml: New file.
|
|
|
|
|
|
2015-03-17 14:11:20 +00:00
|
|
|
|
2015-03-17 Yurij Grechishhev <yurij.grechishhev@gmail.com>
|
|
|
|
|
|
|
|
|
|
* ser-base.h (ser_base_setstopbits): Change second argument name
|
|
|
|
|
from "rate" to "num".
|
|
|
|
|
|
2015-03-17 11:26:09 +00:00
|
|
|
|
2015-03-17 Gary Benson <gbenson@redhat.com>
|
|
|
|
|
Luke Allardyce <lukeallardyce@gmail.com>
|
|
|
|
|
|
|
|
|
|
PR gdb/18131
|
|
|
|
|
* common/common-remote-fileio.h (sys/stat.h): New include.
|
|
|
|
|
(stuct stat): Remove forward declaration.
|
|
|
|
|
|
2015-03-14 17:47:20 +00:00
|
|
|
|
2015-03-16 John Baldwin <jhb@FreeBSD.org>
|
|
|
|
|
|
|
|
|
|
* fbsd-tdep.c (fbsd_make_corefile_notes): Fetch all target registers
|
|
|
|
|
before writing core register notes.
|
|
|
|
|
|
2015-03-16 11:28:24 +00:00
|
|
|
|
2015-03-16 Yuanhui Zhang <asmwarrior@gmail.com>
|
|
|
|
|
Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb_curses.h (tgetnum): Mark with EXTERN_C.
|
|
|
|
|
* stub-termcap.c (tgetent, tgetnum, tgetflag, tgetstr, tputs)
|
|
|
|
|
(tgoto): Wrap with extern "C".
|
|
|
|
|
|
2015-03-16 11:28:23 +00:00
|
|
|
|
2015-03-16 Pedro Alves <palves@redhat.com>
|
|
|
|
|
Yuanhui Zhang <asmwarrior@gmail.com>
|
|
|
|
|
|
|
|
|
|
* stub-termcap.c (tputs): Change prototype.
|
|
|
|
|
|
2015-03-16 11:31:31 +00:00
|
|
|
|
2015-03-16 Yuanhui Zhang <asmwarrior@gmail.com>
|
|
|
|
|
Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* windows-nat.c (struct thread_info_struct): Rename to ...
|
|
|
|
|
(struct windows_thread_info_struct): ... this.
|
|
|
|
|
(thread_info): Rename to ...
|
|
|
|
|
(windows_thread_info): ... this.
|
|
|
|
|
All users updated.
|
|
|
|
|
|
2015-03-14 10:01:17 +00:00
|
|
|
|
2015-03-14 Jan Kratochvil <jan.kratochvil@redhat.com>
|
|
|
|
|
Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* NEWS: New Removed targets and native configurations.
|
|
|
|
|
|
|
|
|
|
2015-03-13 Jan Kratochvil <jan.kratochvil@redhat.com>
|
Remove HPUX
IIUC it is a pre-requisite for IPv6 support, some UNICes do not support
getaddrinfo required for IPv6. But coincidentally such UNICes are no longer
really supported by GDB. Therefore it was concluded we can remove all such
UNICes and then we can implement IPv6 easily with getaddrinfo.
In mail
Re: getaddrinfo available on all GDB hosts? [Re: [PATCH v2] Add IPv6 support for remote TCP connections]
Message-ID: <20140211034157.GG5485@adacore.com>
https://sourceware.org/ml/gdb-patches/2014-02/msg00333.html
Joel said:
So I chose HP-UX first for this patch.
gdb/ChangeLog
2014-10-16 Jan Kratochvil <jan.kratochvil@redhat.com>
Remove HPUX.
* Makefile.in (ALL_64_TARGET_OBS): Remove ia64-hpux-tdep.o.
(ALL_TARGET_OBS): Remove hppa-hpux-tdep.o, solib-som.o and solib-pa64.o.
(HFILES_NO_SRCDIR): Remove solib-som.h, inf-ttrace.h, solib-pa64.h and
ia64-hpux-tdep.h, solib-ia64-hpux.h.
(ALLDEPFILES): Remove hppa-hpux-tdep.c, hppa-hpux-nat.c,
ia64-hpux-nat.c, ia64-hpux-tdep.c, somread.c and solib-som.c.
* config/djgpp/fnchange.lst: Remove hppa-hpux-nat.c and
hppa-hpux-tdep.c.
* config/ia64/hpux.mh: Remove file.
* config/pa/hpux.mh: Remove file.
* configure: Rebuilt.
* configure.ac (dlgetmodinfo, somread.o): Remove.
* configure.host (hppa*-*-hpux*, ia64-*-hpux*): Make them obsolete.
(ia64-*-hpux*): Remove its float format exception.
* configure.tgt (hppa*-*-hpux*, ia64-*-hpux*): Make them obsolete.
* hppa-hpux-nat.c: Remove file.
* hppa-hpux-tdep.c: Remove file.
* hppa-tdep.c (struct hppa_unwind_info, struct hppa_objfile_private):
Move them here from hppa-tdep.h
(hppa_objfile_priv_data, hppa_init_objfile_priv_data): Make it static.
(hppa_frame_prev_register_helper): Remove HPPA_FLAGS_REGNUM exception.
* hppa-tdep.h (struct hppa_unwind_info, struct hppa_objfile_private):
Move them to hppa-tdep.c.
(hppa_objfile_priv_data, hppa_init_objfile_priv_data): Remove
declarations.
* ia64-hpux-nat.c: Remove file.
* ia64-hpux-tdep.c: Remove file.
* ia64-hpux-tdep.h: Remove file.
* inf-ttrace.c: Remove file.
* inf-ttrace.h: Remove file.
* solib-ia64-hpux.c: Remove file.
* solib-ia64-hpux.h: Remove file.
* solib-pa64.c: Remove file.
* solib-pa64.h: Remove file.
* solib-som.c: Remove file.
* solib-som.h: Remove file.
* somread.c: Remove file.
2015-03-13 19:24:22 +00:00
|
|
|
|
|
|
|
|
|
Remove HPUX.
|
|
|
|
|
* Makefile.in (ALL_64_TARGET_OBS): Remove ia64-hpux-tdep.o.
|
|
|
|
|
(ALL_TARGET_OBS): Remove hppa-hpux-tdep.o, solib-som.o and solib-pa64.o.
|
|
|
|
|
(HFILES_NO_SRCDIR): Remove solib-som.h, inf-ttrace.h, solib-pa64.h and
|
|
|
|
|
ia64-hpux-tdep.h, solib-ia64-hpux.h.
|
|
|
|
|
(ALLDEPFILES): Remove hppa-hpux-tdep.c, hppa-hpux-nat.c,
|
|
|
|
|
ia64-hpux-nat.c, ia64-hpux-tdep.c, somread.c and solib-som.c.
|
|
|
|
|
* config/djgpp/fnchange.lst: Remove hppa-hpux-nat.c and
|
|
|
|
|
hppa-hpux-tdep.c.
|
|
|
|
|
* config/ia64/hpux.mh: Remove file.
|
|
|
|
|
* config/pa/hpux.mh: Remove file.
|
|
|
|
|
* configure: Rebuilt.
|
|
|
|
|
* configure.ac (dlgetmodinfo, somread.o): Remove.
|
|
|
|
|
* configure.host (hppa*-*-hpux*, ia64-*-hpux*): Make them obsolete.
|
|
|
|
|
(ia64-*-hpux*): Remove its float format exception.
|
|
|
|
|
* configure.tgt (hppa*-*-hpux*, ia64-*-hpux*): Make them obsolete.
|
|
|
|
|
* hppa-hpux-nat.c: Remove file.
|
|
|
|
|
* hppa-hpux-tdep.c: Remove file.
|
|
|
|
|
* hppa-tdep.c (struct hppa_unwind_info, struct hppa_objfile_private):
|
|
|
|
|
Move them here from hppa-tdep.h
|
|
|
|
|
(hppa_objfile_priv_data, hppa_init_objfile_priv_data): Make it static.
|
|
|
|
|
(hppa_frame_prev_register_helper): Remove HPPA_FLAGS_REGNUM exception.
|
|
|
|
|
* hppa-tdep.h (struct hppa_unwind_info, struct hppa_objfile_private):
|
|
|
|
|
Move them to hppa-tdep.c.
|
|
|
|
|
(hppa_objfile_priv_data, hppa_init_objfile_priv_data): Remove
|
|
|
|
|
declarations.
|
|
|
|
|
* ia64-hpux-nat.c: Remove file.
|
|
|
|
|
* ia64-hpux-tdep.c: Remove file.
|
|
|
|
|
* ia64-hpux-tdep.h: Remove file.
|
|
|
|
|
* inf-ttrace.c: Remove file.
|
|
|
|
|
* inf-ttrace.h: Remove file.
|
|
|
|
|
* solib-ia64-hpux.c: Remove file.
|
|
|
|
|
* solib-ia64-hpux.h: Remove file.
|
|
|
|
|
* solib-pa64.c: Remove file.
|
|
|
|
|
* solib-pa64.h: Remove file.
|
|
|
|
|
* solib-som.c: Remove file.
|
|
|
|
|
* solib-som.h: Remove file.
|
|
|
|
|
* somread.c: Remove file.
|
|
|
|
|
|
2015-02-18 00:15:45 +00:00
|
|
|
|
2015-03-13 John Baldwin <jhb@FreeBSD.org>
|
|
|
|
|
|
|
|
|
|
* configure.ac: AC_SEARCH_LIBS(kinfo_getvmmap, util).
|
|
|
|
|
* config.in: Regenerate.
|
|
|
|
|
* configure: Regenerate.
|
|
|
|
|
* fbsd-nat.c [!HAVE_KINFO_GETVMMAP] (fbsd_read_mapping): Don't
|
|
|
|
|
define.
|
|
|
|
|
(fbsd_find_memory_regions): Use kinfo_getvmmap to
|
|
|
|
|
enumerate memory regions if present.
|
|
|
|
|
|
2015-02-27 18:17:43 +00:00
|
|
|
|
2015-03-13 John Baldwin <jhb@FreeBSD.org>
|
|
|
|
|
|
|
|
|
|
* amd64fbsd-tdep.c (amd64fbsd_sigtramp_p): Style fixes.
|
|
|
|
|
* i386fbsd-tdep.c: Fix style in various gdb_static_assert
|
|
|
|
|
expressions.
|
|
|
|
|
(i386fbsd_sigtramp_p): Likewise.
|
|
|
|
|
|
2015-03-06 20:18:34 +00:00
|
|
|
|
2015-03-12 John Baldwin <jhb@FreeBSD.org>
|
|
|
|
|
|
|
|
|
|
* MAINTAINERS (Write After Approval): Add John Baldwin.
|
|
|
|
|
|
2015-03-12 11:44:16 +00:00
|
|
|
|
2015-03-12 Gary Benson <gbenson@redhat.com>
|
|
|
|
|
|
|
|
|
|
* solib.c (_initialize_solib): Make "set/show sysroot" use
|
|
|
|
|
add_setshow_optional_filename_cmd so it can be restored to
|
|
|
|
|
empty after being set.
|
|
|
|
|
|
2015-03-11 18:12:07 +00:00
|
|
|
|
2015-03-11 Sergio Durigan Junior <sergiodj@redhat.com>
|
|
|
|
|
|
|
|
|
|
* Makefile.in (SFILES): New source break-catch-syscall.c.
|
|
|
|
|
(COMMON_OBS): New object break-catch-syscall.o.
|
|
|
|
|
* break-catch-syscall.c: New file.
|
|
|
|
|
* breakpoint.c: Remove inclusion of "xml-syscall.h".
|
|
|
|
|
(syscall_catchpoint_p): Move declaration to break-catch-syscall.c
|
|
|
|
|
(struct syscall_catchpoint): Likewise.
|
|
|
|
|
(dtor_catch_syscall): Likewise.
|
|
|
|
|
(catch_syscall_inferior_data): Likewise.
|
|
|
|
|
(struct catch_syscall_inferior_data): Likewise.
|
|
|
|
|
(get_catch_syscall_inferior_data): Likewise.
|
|
|
|
|
(catch_syscall_inferior_data_cleanup): Likewise.
|
|
|
|
|
(insert_catch_syscall): Likewise.
|
|
|
|
|
(remove_catch_syscall): Likewise.
|
|
|
|
|
(breakpoint_hit_catch_syscall): Likewise.
|
|
|
|
|
(print_it_catch_syscall): Likewise.
|
|
|
|
|
(print_one_catch_syscall): Likewise.
|
|
|
|
|
(print_mention_catch_syscall): Likewise.
|
|
|
|
|
(print_recreate_catch_syscall): Likewise.
|
|
|
|
|
(catch_syscall_breakpoint_ops): Likewise.
|
|
|
|
|
(syscall_catchpoint_p): Likewise.
|
|
|
|
|
(create_syscall_event_catchpoint): Likewise.
|
|
|
|
|
(catch_syscall_split_args): Likewise.
|
|
|
|
|
(catch_syscall_command_1): Likewise.
|
|
|
|
|
(is_syscall_catchpoint_enabled): Likewise.
|
|
|
|
|
(catch_syscall_enabled): Likewise.
|
|
|
|
|
(catching_syscall_number): Likewise.
|
|
|
|
|
(catch_syscall_completer): Likewise.
|
|
|
|
|
(clear_syscall_counts): Likewise.
|
|
|
|
|
(initialize_breakpoint_ops): Move initialization of syscall
|
|
|
|
|
catchpoints to break-catch-syscall.c.
|
|
|
|
|
(_initialize_breakpoint): Move code related to syscall catchpoints
|
|
|
|
|
to break-catch-syscall.c.
|
|
|
|
|
|
2015-03-11 18:09:51 +00:00
|
|
|
|
2015-03-11 Sergio Durigan Junior <sergiodj@redhat.com>
|
|
|
|
|
|
|
|
|
|
* breakpoint.c (breakpoint_find_if): New function.
|
|
|
|
|
* breakpoint.h (breakpoint_find_if): New prototype.
|
|
|
|
|
|
2015-03-11 17:53:57 +00:00
|
|
|
|
2015-03-11 Gary Benson <gbenson@redhat.com>
|
|
|
|
|
|
|
|
|
|
* remote-fileio.h (remote_fileio_to_host_stat): New declaration.
|
|
|
|
|
* remote-fileio.c (remote_fileio_to_host_uint): New function.
|
|
|
|
|
(remote_fileio_to_host_ulong): Likewise.
|
|
|
|
|
(remote_fileio_to_host_mode): Likewise.
|
|
|
|
|
(remote_fileio_to_host_time): Likewise.
|
|
|
|
|
(remote_fileio_to_host_stat): Likewise.
|
|
|
|
|
* remote.c (PACKET_vFile_fstat): New enum value.
|
|
|
|
|
(remote_protocol_features): Register the "vFile:fstat" feature.
|
|
|
|
|
(remote_hostio_fstat): New function.
|
|
|
|
|
(remote_bfd_iovec_stat): Use the above.
|
|
|
|
|
(_initialize_remote): Register new "set/show remote
|
|
|
|
|
hostio-fstat-packet" command.
|
|
|
|
|
* symfile.c (separate_debug_file_exists): Update comment.
|
|
|
|
|
* NEWS: Announce new vFile:fstat packet.
|
|
|
|
|
|
2015-03-11 17:53:57 +00:00
|
|
|
|
2015-03-11 Gary Benson <gbenson@redhat.com>
|
|
|
|
|
|
|
|
|
|
* common/common-remote-fileio.h: New file.
|
|
|
|
|
* common/common-remote-fileio.c: Likewise.
|
|
|
|
|
* Makefile.in (SFILES): Add common/common-remote-fileio.c.
|
|
|
|
|
(HFILES_NO_SRCDIR): Add common/common-remote-fileio.h.
|
|
|
|
|
(COMMON_OBS): Add common-remote-fileio.o.
|
|
|
|
|
(common-remote-fileio.o): New rule.
|
|
|
|
|
* remote-fileio.h (common-remote-fileio.h): New include.
|
|
|
|
|
* remote-fileio.c (gdb/fileio.h): Do not include.
|
|
|
|
|
(remote_fileio_to_be): Moved to common-remote-fileio.h.
|
|
|
|
|
(remote_fileio_to_fio_uint): Likewise.
|
|
|
|
|
(remote_fileio_to_fio_time): Likewise.
|
|
|
|
|
(remote_fileio_mode_to_target): Moved to common-remote-fileio.c.
|
|
|
|
|
(remote_fileio_to_fio_mode): Likewise.
|
|
|
|
|
(remote_fileio_to_fio_ulong): Likewise.
|
|
|
|
|
(remote_fileio_to_fio_stat): Likewise.
|
|
|
|
|
|
2015-03-11 13:32:23 +00:00
|
|
|
|
2015-03-11 Andy Wingo <wingo@igalia.com>
|
|
|
|
|
|
|
|
|
|
* guile/scm-value.c (gdbscm_value_dynamic_type): Fix typo in which
|
|
|
|
|
we were checking the cached type, not the cached dynamic type.
|
|
|
|
|
|
2015-03-11 13:25:29 +00:00
|
|
|
|
2015-03-11 Andy Wingo <wingo@igalia.com>
|
|
|
|
|
|
|
|
|
|
* guile/scm-cmd.c (cmdscm_destroyer): Don't xfree the name and
|
|
|
|
|
other strings, as these are on the GC'd heap, and will be
|
|
|
|
|
collected along with the smob.
|
|
|
|
|
|
2015-03-11 13:20:06 +00:00
|
|
|
|
2015-03-11 Andy Wingo <wingo@igalia.com>
|
|
|
|
|
|
|
|
|
|
* guile/scm-objfile.c (gdbscm_objfile_progspace): New function.
|
|
|
|
|
(objfile_functions): Bind gdbscm_objfile_progspace to
|
|
|
|
|
objfile-progspace.
|
|
|
|
|
* guile/lib/gdb.scm: Add objfile-progspace to exports.
|
|
|
|
|
|
2015-03-11 12:07:53 +00:00
|
|
|
|
2015-03-11 Andy Wingo <wingo@igalia.com>
|
|
|
|
|
|
|
|
|
|
* guile/guile.c (_initialize_guile): Disable automatic
|
|
|
|
|
finalization, if Guile offers us that possibility.
|
|
|
|
|
* guile/guile.c (call_initialize_gdb_module):
|
|
|
|
|
* guile/scm-safe-call.c (gdbscm_with_catch): Arrange to run
|
|
|
|
|
finalizers in appropriate places.
|
|
|
|
|
* configure.ac (AC_TRY_LIBGUILE): Add a check for
|
|
|
|
|
scm_set_automatic_finalization_enabled.
|
|
|
|
|
* configure: Regenerated.
|
|
|
|
|
|
2015-03-11 10:11:45 +00:00
|
|
|
|
2015-03-11 Andreas Arnez <arnez@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
* s390-linux-tdep.c (s390_skip_prologue): Skip the prologue using
|
|
|
|
|
SAL, if possible.
|
|
|
|
|
|
2015-03-11 10:11:44 +00:00
|
|
|
|
2015-03-11 Andreas Arnez <arnez@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
* s390-linux-nat.c (struct arch_lwp_info): New.
|
|
|
|
|
(s390_fix_watch_points): Rename to...
|
|
|
|
|
(s390_prepare_to_resume): ...this. Skip the PER info update
|
|
|
|
|
unless the watch points have changed.
|
|
|
|
|
(s390_refresh_per_info, s390_new_thread): New functions.
|
|
|
|
|
(s390_insert_watchpoint): Call s390_refresh_per_info instead of
|
|
|
|
|
s390_fix_watch_points.
|
|
|
|
|
(s390_remove_watchpoint): Likewise.
|
|
|
|
|
(_initialize_s390_nat): Reflect renaming of s390_fix_watch_points.
|
|
|
|
|
Register s390_prepare_to_resume.
|
|
|
|
|
|
2015-03-09 11:27:05 +00:00
|
|
|
|
2015-03-09 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
Revert:
|
|
|
|
|
2015-03-07 Pedro Alves <palves@redhat.com>
|
|
|
|
|
* common/gdb_socket.h: New file.
|
|
|
|
|
* ser-tcp.c: Include gdb_socket.h. Don't include netinet/in.h nor
|
|
|
|
|
sys/socket.h.
|
|
|
|
|
(net_open): Use union gdb_sockaddr_u.
|
|
|
|
|
|
2015-02-28 19:11:10 +00:00
|
|
|
|
2015-03-07 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* configure.ac (build_warnings): Move -Wmissing-prototypes
|
|
|
|
|
-Wdeclaration-after-statement -Wmissing-parameter-type
|
|
|
|
|
-Wold-style-declaration -Wold-style-definition to the C-specific
|
|
|
|
|
set.
|
|
|
|
|
* configure: Regenerate.
|
|
|
|
|
|
Fix struct sockaddr/sockaddr_in/sockaddr_un strict aliasing violations
Building gdbserver in C++ mode shows:
gdb/gdbserver/tracepoint.c: In function ‘void* gdb_agent_helper_thread(void*)’:
gdb/gdbserver/tracepoint.c:7190:47: error: cannot convert ‘sockaddr_un*’ to ‘sockaddr*’ for argument ‘2’ to ‘int accept(int, sockaddr*, socklen_t*)’
fd = accept (listen_fd, &sockaddr, &tmp);
A few places in the tree already have an explicit cast to struct
sockaddr *, but that's a strict aliasing violation. Instead of
propagating invalid code, fix this by using a union instead.
gdb/ChangeLog:
2015-03-07 Pedro Alves <palves@redhat.com>
* common/gdb_socket.h: New file.
* ser-tcp.c: Include gdb_socket.h. Don't include netinet/in.h nor
sys/socket.h.
(net_open): Use union gdb_sockaddr_u.
gdb/gdbserver/ChangeLog:
2015-03-07 Pedro Alves <palves@redhat.com>
* gdbreplay.c: No longer include <netinet/in.h>, <sys/socket.h>,
or <winsock2.h> here. Instead include "gdb_socket.h".
(remote_open): Use union gdb_sockaddr_u.
* remote-utils.c: No longer include <netinet/in.h>, <sys/socket.h>
or <winsock2.h> here. Instead include "gdb_socket.h".
(handle_accept_event, remote_prepare): Use union gdb_sockaddr_u.
* tracepoint.c: Include "gdb_socket.h" instead of <sys/socket.h>
or <sys/un.h>.
(init_named_socket, gdb_agent_helper_thread): Use union
gdb_sockaddr_u.
2015-03-07 17:30:46 +00:00
|
|
|
|
2015-03-07 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* common/gdb_socket.h: New file.
|
|
|
|
|
* ser-tcp.c: Include gdb_socket.h. Don't include netinet/in.h nor
|
|
|
|
|
sys/socket.h.
|
|
|
|
|
(net_open): Use union gdb_sockaddr_u.
|
|
|
|
|
|
Make TRY/CATCH use real C++ try/catch in C++ mode
Although the current TRY/CATCH implementation works in C++ mode too,
it relies on setjmp/longjmp, and longjmp bypasses calling the
destructors of objects on the stack, which is obviously bad for C++.
This patch fixes this by makes TRY/CATCH use real try/catch in C++
mode behind the scenes. The way this is done allows RAII and cleanups
to coexist while we phase out cleanups, instead of requiring a flag
day.
This patch is not strictly necessary until we require a C++ compiler
and start actually using RAII, though I'm all for baby steps, and it
shows my proposed way forward. Putting it in now, allows for easier
experimentation and exposure of potential problems with real C++
exceptions.
gdb/ChangeLog:
2015-03-07 Pedro Alves <palves@redhat.com>
* common/common-exceptions.c [!__cplusplus] (enum catcher_state)
(exceptions_state_mc_action_iter)
(exceptions_state_mc_action_iter_1, exceptions_state_mc_catch):
Don't define.
[__cplusplus] (try_scope_depth): New global.
[__cplusplus] (exception_try_scope_entry)
(exception_try_scope_exit, gdb_exception_sliced_copy)
(exception_rethrow): New functions.
(throw_exception): In C++ mode, throw
gdb_exception_RETURN_MASK_QUIT for RETURN_QUIT and
gdb_exception_RETURN_MASK_ERROR for RETURN_ERROR.
(throw_it): In C++ mode, use try_scope_depth.
* common/common-exceptions.h [!__cplusplus]
(exceptions_state_mc_action_iter)
(exceptions_state_mc_action_iter_1, exceptions_state_mc_catch):
Don't declare.
[__cplusplus] (exception_try_scope_entry)
(exception_try_scope_exit, exception_rethrow): Declare.
[__cplusplus] (struct exception_try_scope): New struct.
[__cplusplus] (TRY, CATCH, END_CATCH): Reimplement on top of real
C++ exceptions.
(struct gdb_exception_RETURN_MASK_ALL)
(struct gdb_exception_RETURN_MASK_ERROR)
(struct gdb_exception_RETURN_MASK_QUIT): New types.
2015-03-07 14:50:03 +00:00
|
|
|
|
2015-03-07 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* common/common-exceptions.c [!__cplusplus] (enum catcher_state)
|
|
|
|
|
(exceptions_state_mc_action_iter)
|
|
|
|
|
(exceptions_state_mc_action_iter_1, exceptions_state_mc_catch):
|
|
|
|
|
Don't define.
|
|
|
|
|
[__cplusplus] (try_scope_depth): New global.
|
|
|
|
|
[__cplusplus] (exception_try_scope_entry)
|
|
|
|
|
(exception_try_scope_exit, gdb_exception_sliced_copy)
|
|
|
|
|
(exception_rethrow): New functions.
|
|
|
|
|
(throw_exception): In C++ mode, throw
|
|
|
|
|
gdb_exception_RETURN_MASK_QUIT for RETURN_QUIT and
|
|
|
|
|
gdb_exception_RETURN_MASK_ERROR for RETURN_ERROR.
|
|
|
|
|
(throw_it): In C++ mode, use try_scope_depth.
|
|
|
|
|
* common/common-exceptions.h [!__cplusplus]
|
|
|
|
|
(exceptions_state_mc_action_iter)
|
|
|
|
|
(exceptions_state_mc_action_iter_1, exceptions_state_mc_catch):
|
|
|
|
|
Don't declare.
|
|
|
|
|
[__cplusplus] (exception_try_scope_entry)
|
|
|
|
|
(exception_try_scope_exit, exception_rethrow): Declare.
|
|
|
|
|
[__cplusplus] (struct exception_try_scope): New struct.
|
|
|
|
|
[__cplusplus] (TRY, CATCH, END_CATCH): Reimplement on top of real
|
|
|
|
|
C++ exceptions.
|
|
|
|
|
(struct gdb_exception_RETURN_MASK_ALL)
|
|
|
|
|
(struct gdb_exception_RETURN_MASK_ERROR)
|
|
|
|
|
(struct gdb_exception_RETURN_MASK_QUIT): New types.
|
|
|
|
|
|
2015-03-07 14:50:03 +00:00
|
|
|
|
2015-03-07 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* main.c (handle_command_errors): Remove volatile qualifier from
|
|
|
|
|
parameter.
|
|
|
|
|
|
2015-03-07 14:50:05 +00:00
|
|
|
|
2015-03-07 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* breakpoint.c (save_breakpoints): Adjust to avoid code between
|
|
|
|
|
TRY and CATCH.
|
|
|
|
|
* gdbtypes.c (safe_parse_type): Remove empty line.
|
|
|
|
|
(types_deeply_equal):
|
|
|
|
|
* guile/scm-frame.c (gdbscm_frame_name):
|
|
|
|
|
* linux-thread-db.c (find_new_threads_once):
|
|
|
|
|
* python/py-breakpoint.c (bppy_get_commands):
|
|
|
|
|
* record-btrace.c (record_btrace_insert_breakpoint)
|
|
|
|
|
(record_btrace_remove_breakpoint, record_btrace_start_replaying)
|
|
|
|
|
(record_btrace_start_replaying): Adjust to avoid code between TRY
|
|
|
|
|
and CATCH.
|
|
|
|
|
|
Split TRY_CATCH into TRY + CATCH
This patch splits the TRY_CATCH macro into three, so that we go from
this:
~~~
volatile gdb_exception ex;
TRY_CATCH (ex, RETURN_MASK_ERROR)
{
}
if (ex.reason < 0)
{
}
~~~
to this:
~~~
TRY
{
}
CATCH (ex, RETURN_MASK_ERROR)
{
}
END_CATCH
~~~
Thus, we'll be getting rid of the local volatile exception object, and
declaring the caught exception in the catch block.
This allows reimplementing TRY/CATCH in terms of C++ exceptions when
building in C++ mode, while still allowing to build GDB in C mode
(using setjmp/longjmp), as a transition step.
TBC, after this patch, is it _not_ valid to have code between the TRY
and the CATCH blocks, like:
TRY
{
}
// some code here.
CATCH (ex, RETURN_MASK_ERROR)
{
}
END_CATCH
Just like it isn't valid to do that with C++'s native try/catch.
By switching to creating the exception object inside the CATCH block
scope, we can get rid of all the explicitly allocated volatile
exception objects all over the tree, and map the CATCH block more
directly to C++'s catch blocks.
The majority of the TRY_CATCH -> TRY+CATCH+END_CATCH conversion was
done with a script, rerun from scratch at every rebase, no manual
editing involved. After the mechanical conversion, a few places
needed manual intervention, to fix preexisting cases where we were
using the exception object outside of the TRY_CATCH block, and cases
where we were using "else" after a 'if (ex.reason) < 0)' [a CATCH
after this patch]. The result was folded into this patch so that GDB
still builds at each incremental step.
END_CATCH is necessary for two reasons:
First, because we name the exception object in the CATCH block, which
requires creating a scope, which in turn must be closed somewhere.
Declaring the exception variable in the initializer field of a for
block, like:
#define CATCH(EXCEPTION, mask) \
for (struct gdb_exception EXCEPTION; \
exceptions_state_mc_catch (&EXCEPTION, MASK); \
EXCEPTION = exception_none)
would avoid needing END_CATCH, but alas, in C mode, we build with C90,
which doesn't allow mixed declarations and code.
Second, because when TRY/CATCH are wired to real C++ try/catch, as
long as we need to handle cleanup chains, even if there's no CATCH
block that wants to catch the exception, we need for stop at every
frame in the unwind chain and run cleanups, then rethrow. That will
be done in END_CATCH.
After we require C++, we'll still need TRY/CATCH/END_CATCH until
cleanups are completely phased out -- TRY/CATCH in C++ mode will
save/restore the current cleanup chain, like in C mode, and END_CATCH
catches otherwise uncaugh exceptions, runs cleanups and rethrows, so
that C++ cleanups and exceptions can coexist.
IMO, this still makes the TRY/CATCH code look a bit more like a
newcomer would expect, so IMO worth it even if we weren't considering
C++.
gdb/ChangeLog.
2015-03-07 Pedro Alves <palves@redhat.com>
* common/common-exceptions.c (struct catcher) <exception>: No
longer a pointer to volatile exception. Now an exception value.
<mask>: Delete field.
(exceptions_state_mc_init): Remove all parameters. Adjust.
(exceptions_state_mc): No longer pop the catcher here.
(exceptions_state_mc_catch): New function.
(throw_exception): Adjust.
* common/common-exceptions.h (exceptions_state_mc_init): Remove
all parameters.
(exceptions_state_mc_catch): Declare.
(TRY_CATCH): Rename to ...
(TRY): ... this. Remove EXCEPTION and MASK parameters.
(CATCH, END_CATCH): New.
All callers adjusted.
gdb/gdbserver/ChangeLog:
2015-03-07 Pedro Alves <palves@redhat.com>
Adjust all callers of TRY_CATCH to use TRY/CATCH/END_CATCH
instead.
2015-03-07 15:14:14 +00:00
|
|
|
|
2015-03-07 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* common/common-exceptions.c (struct catcher) <exception>: No
|
|
|
|
|
longer a pointer to volatile exception. Now an exception value.
|
|
|
|
|
<mask>: Delete field.
|
|
|
|
|
(exceptions_state_mc_init): Remove all parameters. Adjust.
|
|
|
|
|
(exceptions_state_mc): No longer pop the catcher here.
|
|
|
|
|
(exceptions_state_mc_catch): New function.
|
|
|
|
|
(throw_exception): Adjust.
|
|
|
|
|
* common/common-exceptions.h (exceptions_state_mc_init): Remove
|
|
|
|
|
all parameters.
|
|
|
|
|
(exceptions_state_mc_catch): Declare.
|
|
|
|
|
(TRY_CATCH): Rename to ...
|
|
|
|
|
(TRY): ... this. Remove EXCEPTION and MASK parameters.
|
|
|
|
|
(CATCH, END_CATCH): New.
|
|
|
|
|
All callers adjusted.
|
|
|
|
|
|
2015-03-07 14:50:04 +00:00
|
|
|
|
2015-03-07 Tom Tromey <tromey@redhat.com>
|
|
|
|
|
|
|
|
|
|
* top.c (quit_force): Inline and delete DO_TRY, DO_PRINT_EX.
|
|
|
|
|
|
2015-03-07 14:50:04 +00:00
|
|
|
|
2015-03-07 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* amd64-tdep.c (amd64_frame_cache, amd64_sigtramp_frame_cache)
|
|
|
|
|
(amd64_epilogue_frame_cache): Normal exception handling code.
|
|
|
|
|
* break-catch-throw.c (check_status_exception_catchpoint)
|
|
|
|
|
(re_set_exception_catchpoint): Ditto.
|
|
|
|
|
* cli/cli-interp.c (safe_execute_command):
|
|
|
|
|
* cli/cli-script.c (script_from_file): Ditto.
|
|
|
|
|
* compile/compile-c-symbols.c (generate_c_for_for_one_variable):
|
|
|
|
|
Ditto.
|
|
|
|
|
* compile/compile-object-run.c (compile_object_run): Ditto.
|
|
|
|
|
* cp-abi.c (baseclass_offset): Ditto.
|
|
|
|
|
* cp-valprint.c (cp_print_value): Ditto.
|
|
|
|
|
* exceptions.c (catch_exceptions_with_msg):
|
|
|
|
|
* frame-unwind.c (frame_unwind_try_unwinder): Ditto.
|
|
|
|
|
* frame.c (get_frame_address_in_block_if_available): Ditto.
|
|
|
|
|
* i386-tdep.c (i386_frame_cache, i386_epilogue_frame_cache)
|
|
|
|
|
(i386_sigtramp_frame_cache): Ditto.
|
|
|
|
|
* infcmd.c (post_create_inferior): Ditto.
|
|
|
|
|
* linespec.c (parse_linespec, find_linespec_symbols):
|
|
|
|
|
* p-valprint.c (pascal_object_print_value): Ditto.
|
|
|
|
|
* parse.c (parse_expression_for_completion): Ditto.
|
|
|
|
|
* python/py-finishbreakpoint.c (bpfinishpy_init): Ditto.
|
|
|
|
|
* remote.c (remote_get_noisy_reply): Ditto.
|
|
|
|
|
* s390-linux-tdep.c (s390_frame_unwind_cache): Ditto.
|
|
|
|
|
* solib-svr4.c (solib_svr4_r_map): Ditto.
|
|
|
|
|
|
2015-03-07 14:52:22 +00:00
|
|
|
|
2015-03-06 Gary Benson <gbenson@redhat.com>
|
2015-03-06 09:42:06 +00:00
|
|
|
|
|
|
|
|
|
* common/common-utils.h (startswith): New inline function.
|
|
|
|
|
All places where this logic was used updated to use the above.
|
|
|
|
|
|
PR gdb/18002: Fix reinsert of a permanent breakpoints
When we find out that a breakpoint is set on top of a program
breakpoint, we mark it as "permanent". E.g.,:
...
if (bp_loc_is_permanent (loc))
{
loc->inserted = 1;
loc->permanent = 1;
}
...
Note we didn't fill in the breakpoint's shadow (shadow_len remains 0).
In case the target claims support for evaluating breakpoint
conditions, GDB sometimes reinserts breakpoints that are already
inserted (to update the conditions on the target side). Since GDB
doesn't know whether the target supports evaluating conditions _of_
software breakpoints (vs hardware breakpoints, etc.) until it actually
tries it, if the target doesn't actually support z0 breakpoints, GDB
ends up reinserting a GDB-managed software/memory breakpoint
(mem-break.c).
And that is the case that is buggy: breakpoints that are marked
inserted contribute their shadows (if any) to the memory returned by
target_read_memory, to mask out breakpoints. Permanent breakpoints
are always marked as inserted. So if the permanent breakpoint doesn't
have a shadow yet in its shadow buffer, but we set shadow_len before
calling target_read_memory, then the still clear shadow_contents
buffer will be used by the breakpoint masking code... And then from
there on, the permanent breakpoint has a broken shadow buffer, and
thus any memory read out of that address will read bogus code, and
many random bad things fall out from that.
The fix is just to set shadow_len at the same time shadow_contents is
set, not one before and another after...
Fixes all gdb.base/bp-permanent.exp FAILs on PPC64 GNU/Linux gdbserver
and probably any other gdbserver port that doesn't do z0 breakpoints.
gdb/ChangeLog:
2015-03-05 Pedro Alves <palves@redhat.com>
PR gdb/18002
* mem-break.c (default_memory_insert_breakpoint): Set shadow_len
after reading the breakpoint's shadow memory.
2015-03-05 23:39:45 +00:00
|
|
|
|
2015-03-05 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
PR gdb/18002
|
|
|
|
|
* mem-break.c (default_memory_insert_breakpoint): Set shadow_len
|
|
|
|
|
after reading the breakpoint's shadow memory.
|
|
|
|
|
|
2015-03-05 16:12:42 +00:00
|
|
|
|
2015-03-05 Mark Kettenis <kettenis@gnu.org>
|
|
|
|
|
|
|
|
|
|
* hppabsd-nat.c: Remove file.
|
|
|
|
|
* hppaobsd-nat.c: New file.
|
|
|
|
|
* Makefile.in (ALLDEPFILES): Remove hppabsd-nat.c. Add
|
|
|
|
|
hppaobsd-nat.c.
|
|
|
|
|
* config/pa/obsd.mh (NATDEPFILES): Replace hppabsd-nat.o with
|
|
|
|
|
hppaobsd-nat.o.
|
|
|
|
|
|
2015-03-04 20:41:17 +00:00
|
|
|
|
2015-03-04 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* target.h (struct target_ops) <to_decr_pc_after_break>: Delete.
|
|
|
|
|
(target_decr_pc_after_break): Delete declaration.
|
|
|
|
|
* target.c (default_target_decr_pc_after_break)
|
|
|
|
|
(target_decr_pc_after_break): Delete.
|
|
|
|
|
* linux-nat.c (check_stopped_by_breakpoint, linux_nat_wait_1): Use
|
|
|
|
|
gdbarch_decr_pc_after_break instead of target_decr_pc_after_break.
|
|
|
|
|
* linux-thread-db.c (check_event): Likewise.
|
|
|
|
|
* infrun.c (adjust_pc_after_break): Likewise.
|
|
|
|
|
* darwin-nat.c (cancel_breakpoint): Likewise.
|
|
|
|
|
* aix-thread.c (aix_thread_wait): Likewise.
|
|
|
|
|
* target-delegates.c: Regenerate.
|
|
|
|
|
|
2015-03-04 20:41:16 +00:00
|
|
|
|
2015-03-04 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* linux-nat.c (save_sigtrap): Check for breakpoints before
|
|
|
|
|
checking watchpoints.
|
|
|
|
|
(status_callback) [USE_SIGTRAP_SIGINFO]: Don't check whether a
|
|
|
|
|
breakpoint is inserted if relying on SIGTRAP's siginfo.si_code.
|
|
|
|
|
(check_stopped_by_breakpoint) [USE_SIGTRAP_SIGINFO]: Decide whether
|
|
|
|
|
a breakpoint triggered based on the SIGTRAP's siginfo.si_code.
|
|
|
|
|
(linux_nat_stopped_by_sw_breakpoint)
|
|
|
|
|
(linux_nat_supports_stopped_by_sw_breakpoint)
|
|
|
|
|
(linux_nat_stopped_by_hw_breakpoint)
|
|
|
|
|
(linux_nat_supports_stopped_by_hw_breakpoint): New functions.
|
|
|
|
|
(linux_nat_wait_1): Don't re-increment the PC if relying on
|
|
|
|
|
SIGTRAP's siginfo->si_code.
|
|
|
|
|
(linux_nat_add_target): Install new target methods.
|
|
|
|
|
* linux-thread-db.c (check_event): Don't account for breakpoint PC
|
|
|
|
|
offset if the target already adjusted the PC.
|
|
|
|
|
* nat/linux-ptrace.h (USE_SIGTRAP_SIGINFO): New.
|
|
|
|
|
(GDB_ARCH_TRAP_BRKPT): New.
|
|
|
|
|
(TRAP_HWBKPT): Define if not already defined.
|
|
|
|
|
|
remote+docs: software/hardware breakpoint traps
This adjusts target remote to tell the core whether a trap was caused
by a breakpoint.
To that end, the patch teaches GDB about new RSP stop reasons "T05
swbreak" and "T05 hwbreak", that remote targets report back to GDB,
similarly to how "T05 watch" indicates a stop caused by a watchpoint.
Because targets that can report these events are expected to
themselves adjust the PC after a software breakpoint, these new stop
reasons must only be reported if the stub is talking to a GDB that
understands them. Because of that, the use of the new stop reasons
needs to be handshaked on initial connection, using the qSupported
mechanism. GDB simply sends "swbreak+" in its qSupports query, and
the stub reports back "swbreak+" too.
Because these new stop reasons are required to fix a fundamental
non-stop mode problem, this commit extends the remote non-stop intro
section in the manual, documenting the events as required.
To be clear, GDB will still cope with remote targets that don't
support these new stop reasons; it will behave just like today.
Tested on x86-64 Fedora 20, native and gdbserver.
gdb/ChangeLog:
2015-03-04 Pedro Alves <palves@redhat.com>
* NEWS: Mention the new "swbreak" and "hwbreak" stop reasons.
* remote.c (struct remote_state) <remote_stopped_by_watchpoint_p>:
Delete field.
<stop_reason>: New field.
(PACKET_swbreak_feature, PACKET_hwbreak_feature): New enum values.
(packet_set_cmd_state): New function.
(remote_protocol_features): Register the "swbreak" and "hwbreak"
features.
(remote_query_supported): If not disabled with the corresponding
"set remote foo-packet" command, report support for the swbreak
and hwbreak features.
(struct stop_reply) <remote_stopped_by_watchpoint_p>: Delete
field.
<stop_reason>: New field.
(remote_parse_stop_reply): Handle "swbreak" and "hwbreak".
(remote_wait_as): Adjust.
(remote_stopped_by_sw_breakpoint)
(remote_supports_stopped_by_sw_breakpoint)
(remote_stopped_by_hw_breakpoint)
(remote_supports_stopped_by_hw_breakpoint): New functions.
(remote_stopped_by_watchpoint): New function.
(init_remote_ops): Install them.
(_initialize_remote): Register new "set/show remote
swbreak-feature-packet" and "set/show remote
swbreak-feature-packet" commands.
gdb/doc/ChangeLog:
2015-03-04 Pedro Alves <palves@redhat.com>
* gdb.texinfo (Remote Configuration): Document the "set/show
remote swbreak-feature-packet" and "set/show remote
hwbreak-feature-packet" commands.
(Packets) <Z0>: Add cross link to the "swbreak" stop reason's
decription.
(Stop Reply Packets): Document the swbreak and hwbreak stop
reasons.
(General Query Packets): Document the swbreak and hwbreak
qSupported features.
(Remote Non-Stop): Explain that swbreak and hwbreak are required.
2015-03-04 20:41:16 +00:00
|
|
|
|
2015-03-04 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* NEWS: Mention the new "swbreak" and "hwbreak" stop reasons.
|
|
|
|
|
* remote.c (struct remote_state) <remote_stopped_by_watchpoint_p>:
|
|
|
|
|
Delete field.
|
|
|
|
|
<stop_reason>: New field.
|
|
|
|
|
(PACKET_swbreak_feature, PACKET_hwbreak_feature): New enum values.
|
|
|
|
|
(packet_set_cmd_state): New function.
|
|
|
|
|
(remote_protocol_features): Register the "swbreak" and "hwbreak"
|
|
|
|
|
features.
|
|
|
|
|
(remote_query_supported): If not disabled with the corresponding
|
|
|
|
|
"set remote foo-packet" command, report support for the swbreak
|
|
|
|
|
and hwbreak features.
|
|
|
|
|
(struct stop_reply) <remote_stopped_by_watchpoint_p>: Delete
|
|
|
|
|
field.
|
|
|
|
|
<stop_reason>: New field.
|
|
|
|
|
(remote_parse_stop_reply): Handle "swbreak" and "hwbreak".
|
|
|
|
|
(remote_wait_as): Adjust.
|
|
|
|
|
(remote_stopped_by_sw_breakpoint)
|
|
|
|
|
(remote_supports_stopped_by_sw_breakpoint)
|
|
|
|
|
(remote_stopped_by_hw_breakpoint)
|
|
|
|
|
(remote_supports_stopped_by_hw_breakpoint): New functions.
|
|
|
|
|
(remote_stopped_by_watchpoint): New function.
|
|
|
|
|
(init_remote_ops): Install them.
|
|
|
|
|
(_initialize_remote): Register new "set/show remote
|
|
|
|
|
swbreak-feature-packet" and "set/show remote
|
|
|
|
|
swbreak-feature-packet" commands.
|
|
|
|
|
|
2015-03-04 20:41:15 +00:00
|
|
|
|
2015-03-04 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* btrace.h: Include target/waitstatus.h.
|
|
|
|
|
(struct btrace_thread_info) <stop_reason>: New field.
|
|
|
|
|
* record-btrace.c (record_btrace_step_thread): Use
|
|
|
|
|
record_check_stopped_by_breakpoint instead of breakpoint_here_p.
|
|
|
|
|
(record_btrace_decr_pc_after_break): Delete.
|
|
|
|
|
(record_btrace_stopped_by_sw_breakpoint)
|
|
|
|
|
(record_btrace_supports_stopped_by_sw_breakpoint)
|
|
|
|
|
(record_btrace_stopped_by_hw_breakpoint)
|
|
|
|
|
(record_btrace_supports_stopped_by_hw_breakpoint): New functions.
|
|
|
|
|
(init_record_btrace_ops): Install them.
|
|
|
|
|
* record-full.c (record_full_hw_watchpoint): Delete and replace
|
|
|
|
|
with ...
|
|
|
|
|
(record_full_stop_reason): ... this throughout.
|
|
|
|
|
(record_full_exec_insn): Adjust.
|
|
|
|
|
(record_full_wait_1): Adjust. No longer re-increment the PC.
|
|
|
|
|
(record_full_wait_1): Adjust. Use
|
|
|
|
|
record_check_stopped_by_breakpoint instead of breakpoint_here_p.
|
|
|
|
|
(record_full_stopped_by_watchpoint): Adjust.
|
|
|
|
|
(record_full_stopped_by_sw_breakpoint)
|
|
|
|
|
(record_full_supports_stopped_by_sw_breakpoint)
|
|
|
|
|
(record_full_supports_stopped_by_sw_breakpoint)
|
|
|
|
|
(record_full_stopped_by_hw_breakpoint)
|
|
|
|
|
(record_full_supports_stopped_by_hw_breakpoint): New functions.
|
|
|
|
|
(init_record_full_ops, init_record_full_core_ops): Install them.
|
|
|
|
|
* record.c (record_check_stopped_by_breakpoint): New function.
|
|
|
|
|
* record.h: Include target/waitstatus.h.
|
|
|
|
|
(record_check_stopped_by_breakpoint): New declaration.
|
|
|
|
|
|
2015-03-04 20:41:15 +00:00
|
|
|
|
2015-03-04 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
enum lwp_stop_reason -> enum target_stop_reason
|
|
|
|
|
* linux-nat.c (linux_resume_one_lwp, check_stopped_by_watchpoint)
|
|
|
|
|
(linux_nat_stopped_by_watchpoint, status_callback)
|
|
|
|
|
(linux_nat_wait_1): Adjust.
|
|
|
|
|
* linux-nat.h (enum lwp_stop_reason): Delete.
|
|
|
|
|
(struct lwp_info) <stop_reason>: Now an enum target_stop_reason.
|
|
|
|
|
* x86-linux-nat.c (x86_linux_prepare_to_resume): Adjust.
|
|
|
|
|
* target/waitstatus.h (enum target_stop_reason): New.
|
|
|
|
|
|
Teach GDB about targets that can tell whether a trap is a breakpoint event
The moribund locations heuristics are problematic. This patch teaches
GDB about targets that can reliably tell whether a trap was caused by
a software or hardware breakpoint, and thus don't need moribund
locations, thus bypassing all the problems that mechanism has.
The non-stop-fair-events.exp test is frequently failing currently.
E.g., see https://sourceware.org/ml/gdb-testers/2015-q1/msg03148.html.
The root cause is a fundamental problem with moribund locations. For
example, the stepped_breakpoint logic added by af48d08f breaks in this
case (which is what happens with that test):
- Step thread A, no breakpoint is set at PC.
- The kernel doesn't schedule thread A yet.
- Insert breakpoint at A's PC, for some reason (e.g., a step-resume
breakpoint for thread B).
- Kernel finally schedules thread A.
- thread A's stepped_breakpoint flag is not set, even though it now
stepped a breakpoint instruction.
- adjust_pc_after_break gets the PC wrong, because PC == PREV_PC, but
stepped_breakpoint is not set.
We needed the stepped_breakpoint logic to workaround moribund
locations, because otherwise adjust_pc_after_break could apply an
adjustment when it shouldn't just because there _used_ to be a
breakpoint at PC (a moribund breakpoint location). For example, on
x86, that's wrong if the thread really hasn't executed an int3, but
instead executed some other 1-byte long instruction. Getting the PC
adjustment wrong of course leads to the inferior executing the wrong
instruction.
Other problems with moribund locations are:
- if a true SIGTRAP happens to be raised when the program is
executing the PC that used to have a breakpoint, GDB will assume
that is a trap for a breakpoint that has recently been removed, and
thus we miss reporting the random signal to the user.
- to minimize that, we get rid of moribund location after a while.
That while is defined as just a certain number of events being
processed. That number of events sometimes passes by before a
delayed breakpoint is processed, and GDB confuses the trap for a
random signal, thus reporting the random trap. Once the user
resumes the thread, the program crashes because the PC was not
adjusted...
The fix for all this is to bite the bullet and get rid of heuristics
and instead rely on the target knowing accurately what caused the
SIGTRAP. The target/kernel/stub is in the best position to know what
that, because it can e.g. consult priviledged CPU flags GDB has no
access to, or by knowing which exception vector entry was called when
the instruction trapped, etc. Most debug APIs I've seen to date
report breakpoint hits as a distinct event in some fashion. For
example, on the Linux kernel, whether a breakpoint was executed is
exposed to userspace in the si_code field of the SIGTRAP's siginfo.
On Windows, the debug API reports a EXCEPTION_BREAKPOINT exception
code.
We needed to keep around deleted breakpoints in an on-the-side list
(the moribund locations) for two main reasons:
- Know that a SIGTRAP actually is a delayed event for a hit of a
breakpoint that was removed before the event was processed, and
thus should not be reported as a random signal.
- So we still do the decr_pc_after_break adjustment in that case, so
that the thread is resumed at the correct address.
In the new model, if GDB processes an event the target tells is a
breakpoint trap, and GDB doesn't find the corresponding breakpoint in
its breakpoint tables, it means that event is a delayed event for a
breakpoint that has since been removed, and thus the event should be
ignored.
For the decr_pc_after_after issue, it ends up being much simpler that
on targets that can reliably tell whether a breakpoint trapped, for
the breakpoint trap to present the PC already adjusted. Proper
multi-threading support already implies that targets needs to be doing
decr_pc_after_break adjustment themselves, otherwise for example, in
all-stop if two threads hit a breakpoint simultaneously, and the user
does "info threads", he'll see the non-event thread that hit the
breakpoint stopped at the wrong PC.
This way (target adjusts) also ends up eliminating the need for some
awkward re-incrementing of the PC in the record-full and Linux targets
that we do today, and the need for the target_decr_pc_after_break
hook.
If the target always adjusts, then there's a case where GDB needs to
re-increment the PC. Say, on x86, an "int3" instruction that was
explicitly written in the program traps. In this case, GDB should
report a random SIGTRAP signal to the user, with the PC pointing at
the instruction past the int3, just like if GDB was not debugging the
program. The user may well decide to pass the SIGTRAP to the program
because the program being debugged has a SIGTRAP handler that handles
its own breakpoints, and expects the PC to be unadjusted.
Tested on x86-64 Fedora 20.
gdb/ChangeLog:
2015-03-04 Pedro Alves <palves@redhat.com>
* breakpoint.c (need_moribund_for_location_type): New function.
(bpstat_stop_status): Don't skipping checking moribund locations
of breakpoint types which the target tell caused a stop.
(program_breakpoint_here_p): New function, factored out from ...
(bp_loc_is_permanent): ... this.
(update_global_location_list): Don't create a moribund location if
the target supports reporting stops of the type of the removed
breakpoint.
* breakpoint.h (program_breakpoint_here_p): New declaration.
* infrun.c (adjust_pc_after_break): Return early if the target has
already adjusted the PC. Add comments.
(handle_signal_stop): If nothing explains a signal, and the target
tells us the stop was caused by a software breakpoint, check if
there's a breakpoint instruction in the memory. If so, adjust the
PC before presenting the stop to the user. Otherwise, ignore the
trap. If nothing explains a signal, and the target tells us the
stop was caused by a hardware breakpoint, ignore the trap.
* target.h (struct target_ops) <to_stopped_by_sw_breakpoint,
to_supports_stopped_by_sw_breakpoint, to_stopped_by_hw_breakpoint,
to_supports_stopped_by_hw_breakpoint>: New fields.
(target_stopped_by_sw_breakpoint)
(target_supports_stopped_by_sw_breakpoint)
(target_stopped_by_hw_breakpoint)
(target_supports_stopped_by_hw_breakpoint): Define.
* target-delegates.c: Regenerate.
2015-03-04 20:41:15 +00:00
|
|
|
|
2015-03-04 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* breakpoint.c (need_moribund_for_location_type): New function.
|
|
|
|
|
(bpstat_stop_status): Don't skipping checking moribund locations
|
|
|
|
|
of breakpoint types which the target tell caused a stop.
|
|
|
|
|
(program_breakpoint_here_p): New function, factored out from ...
|
|
|
|
|
(bp_loc_is_permanent): ... this.
|
|
|
|
|
(update_global_location_list): Don't create a moribund location if
|
|
|
|
|
the target supports reporting stops of the type of the removed
|
|
|
|
|
breakpoint.
|
|
|
|
|
* breakpoint.h (program_breakpoint_here_p): New declaration.
|
|
|
|
|
* infrun.c (adjust_pc_after_break): Return early if the target has
|
|
|
|
|
already adjusted the PC. Add comments.
|
|
|
|
|
(handle_signal_stop): If nothing explains a signal, and the target
|
|
|
|
|
tells us the stop was caused by a software breakpoint, check if
|
|
|
|
|
there's a breakpoint instruction in the memory. If so, adjust the
|
|
|
|
|
PC before presenting the stop to the user. Otherwise, ignore the
|
|
|
|
|
trap. If nothing explains a signal, and the target tells us the
|
|
|
|
|
stop was caused by a hardware breakpoint, ignore the trap.
|
|
|
|
|
* target.h (struct target_ops) <to_stopped_by_sw_breakpoint,
|
|
|
|
|
to_supports_stopped_by_sw_breakpoint, to_stopped_by_hw_breakpoint,
|
|
|
|
|
to_supports_stopped_by_hw_breakpoint>: New fields.
|
|
|
|
|
(target_stopped_by_sw_breakpoint)
|
|
|
|
|
(target_supports_stopped_by_sw_breakpoint)
|
|
|
|
|
(target_stopped_by_hw_breakpoint)
|
|
|
|
|
(target_supports_stopped_by_hw_breakpoint): Define.
|
|
|
|
|
* target-delegates.c: Regenerate.
|
|
|
|
|
|
2015-03-04 15:03:33 +00:00
|
|
|
|
2015-03-04 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* infrun.c (follow_fork_inferior): Use the whole of the
|
|
|
|
|
inferior_ptid and pending_follow.related_pid ptids instead of
|
|
|
|
|
building ptids from the process components. Adjust verbose output
|
|
|
|
|
to use target_pid_to_str.
|
|
|
|
|
* linux-nat.c (linux_child_follow_fork): Use the whole of the
|
|
|
|
|
inferior_ptid and pending_follow.related_pid ptids instead of
|
|
|
|
|
building ptids from the process components.
|
|
|
|
|
|
2015-03-04 13:22:42 +00:00
|
|
|
|
2015-03-04 Mark Kettenis <kettenis@gnu.org>
|
|
|
|
|
|
|
|
|
|
* inf-ptrace.c [PT_GET_PROCESS_STATE]
|
|
|
|
|
(inf_ptrace_insert_fork_catchpoint): New function.
|
|
|
|
|
(inf_ptrace_remove_fork_catchpoint): New function.
|
|
|
|
|
(inf_ptrace_target) [PT_GET_PROCESS_STATE]: Install them.
|
|
|
|
|
|
2015-03-04 09:40:41 +00:00
|
|
|
|
2015-03-04 Andreas Arnez <arnez@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
* s390-linux-tdep.c (s390_register_name): Return empty string
|
|
|
|
|
instead of NULL for registers that shouldn't be visible.
|
|
|
|
|
|
2015-03-04 09:40:40 +00:00
|
|
|
|
2015-03-04 Andreas Arnez <arnez@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
* s390-linux-tdep.c (s390_gdbarch_init): Use the correct syscall
|
|
|
|
|
XML file for 64-bit targets.
|
|
|
|
|
|
2015-03-03 17:45:11 +00:00
|
|
|
|
2015-03-03 Simon Marchi <simon.marchi@ericsson.com>
|
|
|
|
|
|
|
|
|
|
* target.h (find_default_create_inferior): Remove declaration.
|
|
|
|
|
(find_default_attach): Likewise.
|
|
|
|
|
|
2015-03-03 16:28:15 +00:00
|
|
|
|
2015-03-03 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* inf-ptrace.c (inf_ptrace_resume): Remove spurious whitespace.
|
|
|
|
|
Use ptid_get_pid to get the overall process id when resuming all
|
|
|
|
|
threads.
|
|
|
|
|
|
Linux/ptrace: don't convert ptids when asking inf-ptrace layer to resume LWP
Ref: https://sourceware.org/ml/gdb-patches/2015-03/msg00060.html
The record-btrace target can hit an assertion here:
Breakpoint 1, record_btrace_fetch_registers (ops=0x974bfc0 <record_btrace_ops>,
regcache=0x9a0a798, regno=8) at gdb/record-btrace.c:1202
1202 gdb_assert (tp != NULL);
(gdb) p regcache->ptid
$3 = {pid = 23856, lwp = 0, tid = 0}
The problem is that the linux-nat layer converts the ptid to a
single-process ptid before passing the request down to the inf-ptrace
layer, which loses information, and then record-btrace can't find the
corresponding thread in GDB's thread list:
(gdb) bt
#0 record_btrace_fetch_registers (ops=0x974bfc0 <record_btrace_ops>, regcache=0x9a0a798, regno=8)
at gdb/record-btrace.c:1202
#1 0x083f4ee2 in delegate_fetch_registers (self=0x974bfc0 <record_btrace_ops>, arg1=0x9a0a798,
arg2=8) at gdb/target-delegates.c:149
#2 0x08406562 in target_fetch_registers (regcache=0x9a0a798, regno=8)
at gdb/target.c:3279
#3 0x08355255 in regcache_raw_read (regcache=0x9a0a798, regnum=8,
buf=0xbfffe6c0 "¨\003\222\tÀ8kIøæÿ¿HO5\b\035]")
at gdb/regcache.c:643
#4 0x083558a7 in regcache_cooked_read (regcache=0x9a0a798, regnum=8,
buf=0xbfffe6c0 "¨\003\222\tÀ8kIøæÿ¿HO5\b\035]")
at gdb/regcache.c:734
#5 0x08355de3 in regcache_cooked_read_unsigned (regcache=0x9a0a798, regnum=8, val=0xbfffe738)
at gdb/regcache.c:838
#6 0x0827a106 in i386_linux_resume (ops=0x9737ca0 <linux_ops_saved>, ptid=..., step=1,
signal=GDB_SIGNAL_0) at gdb/i386-linux-nat.c:670
#7 0x08280c12 in linux_resume_one_lwp (lp=0x9a0a5b8, step=1, signo=GDB_SIGNAL_0)
at gdb/linux-nat.c:1529
#8 0x08281281 in linux_nat_resume (ops=0x98da608, ptid=..., step=1, signo=GDB_SIGNAL_0)
at gdb/linux-nat.c:1708
#9 0x0850738e in record_btrace_resume (ops=0x98da608, ptid=..., step=1, signal=GDB_SIGNAL_0)
at gdb/record-btrace.c:1760
...
The fix is just to not lose information, and let the intact ptid reach
record-btrace.c.
Tested on x86-64 Fedora 20, -m32.
gdb/ChangeLog:
2015-03-03 Pedro Alves <palves@redhat.com>
* i386-linux-nat.c (i386_linux_resume): Get the ptrace PID out of
the lwp field of ptid. Pass the full ptid to get_thread_regcache.
* inf-ptrace.c (get_ptrace_pid): New function.
(inf_ptrace_resume): Use it.
* linux-nat.c (linux_resume_one_lwp): Pass the LWP's ptid ummodified
to the lower layer.
2015-03-03 13:33:44 +00:00
|
|
|
|
2015-03-03 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* i386-linux-nat.c (i386_linux_resume): Get the ptrace PID out of
|
|
|
|
|
the lwp field of ptid. Pass the full ptid to get_thread_regcache.
|
|
|
|
|
* inf-ptrace.c (get_ptrace_pid): New function.
|
|
|
|
|
(inf_ptrace_resume): Use it.
|
|
|
|
|
* linux-nat.c (linux_resume_one_lwp): Pass the LWP's ptid ummodified
|
|
|
|
|
to the lower layer.
|
|
|
|
|
|
2015-01-29 09:43:05 +00:00
|
|
|
|
2015-03-03 Markus Metzger <markus.t.metzger@intel.com>
|
|
|
|
|
|
|
|
|
|
* nat/linux-btrace.c: Include sys/utsname.h.
|
|
|
|
|
(linux_determine_kernel_ptr_bits): New.
|
|
|
|
|
(linux_enable_bts): Call linux_determine_kernel_ptr_bits.
|
|
|
|
|
* x86-linux-nat.c (x86_linux_enable_btrace): Do not overwrite non-zero
|
|
|
|
|
ptr_bits.
|
|
|
|
|
|
2015-01-23 12:32:12 +00:00
|
|
|
|
2015-03-03 Markus Metzger <markus.t.metzger@intel.com>
|
|
|
|
|
|
|
|
|
|
* btrace.c (ftrace_update_function): Treat return as tailcall for
|
|
|
|
|
"_dl_runtime_resolve".
|
|
|
|
|
|
2014-06-24 12:25:50 +00:00
|
|
|
|
2015-03-03 Markus Metzger <markus.t.metzger@intel.com>
|
|
|
|
|
|
|
|
|
|
* btrace.h (btrace_function) <lbegin, lend>: Remove.
|
|
|
|
|
* btrace.c (ftrace_debug): Do not print the line range.
|
|
|
|
|
(ftrace_skip_file, ftrace_update_lines): Remove.
|
|
|
|
|
(ftrace_new_function): Remove lbegin and lend initialization.
|
|
|
|
|
(btrace_compute_ftrace_bts): Remove call to ftrace_update_lines.
|
|
|
|
|
* record-btrace.c (btrace_compute_src_line_range): New.
|
|
|
|
|
(btrace_call_history_src_line): Call btrace_compute_src_line_range.
|
|
|
|
|
|
follow-exec: delete all non-execing threads
This fixes invalid reads Valgrind first caught when debugging against
a GDBserver patched with a series that adds exec events to the remote
protocol. Like these, using the gdb.threads/thread-execl.exp test:
$ valgrind ./gdb -data-directory=data-directory ./testsuite/gdb.threads/thread-execl -ex "tar extended-remote :9999" -ex "b thread_execler" -ex "c" -ex "set scheduler-locking on"
...
Breakpoint 1, thread_execler (arg=0x0) at src/gdb/testsuite/gdb.threads/thread-execl.c:29
29 if (execl (image, image, NULL) == -1)
(gdb) n
Thread 32509.32509 is executing new program: build/gdb/testsuite/gdb.threads/thread-execl
[New Thread 32509.32532]
==32510== Invalid read of size 4
==32510== at 0x5AA7D8: delete_breakpoint (breakpoint.c:13989)
==32510== by 0x6285D3: delete_thread_breakpoint (thread.c:100)
==32510== by 0x628603: delete_step_resume_breakpoint (thread.c:109)
==32510== by 0x61622B: delete_thread_infrun_breakpoints (infrun.c:2928)
==32510== by 0x6162EF: for_each_just_stopped_thread (infrun.c:2958)
==32510== by 0x616311: delete_just_stopped_threads_infrun_breakpoints (infrun.c:2969)
==32510== by 0x616C96: fetch_inferior_event (infrun.c:3267)
==32510== by 0x63A2DE: inferior_event_handler (inf-loop.c:57)
==32510== by 0x4E0E56: remote_async_serial_handler (remote.c:11877)
==32510== by 0x4AF620: run_async_handler_and_reschedule (ser-base.c:137)
==32510== by 0x4AF6F0: fd_event (ser-base.c:182)
==32510== by 0x63806D: handle_file_event (event-loop.c:762)
==32510== Address 0xcf333e0 is 16 bytes inside a block of size 200 free'd
==32510== at 0x4A07577: free (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==32510== by 0x77CB74: xfree (common-utils.c:98)
==32510== by 0x5AA954: delete_breakpoint (breakpoint.c:14056)
==32510== by 0x5988BD: update_breakpoints_after_exec (breakpoint.c:3765)
==32510== by 0x61360F: follow_exec (infrun.c:1091)
==32510== by 0x6186FA: handle_inferior_event (infrun.c:4061)
==32510== by 0x616C55: fetch_inferior_event (infrun.c:3261)
==32510== by 0x63A2DE: inferior_event_handler (inf-loop.c:57)
==32510== by 0x4E0E56: remote_async_serial_handler (remote.c:11877)
==32510== by 0x4AF620: run_async_handler_and_reschedule (ser-base.c:137)
==32510== by 0x4AF6F0: fd_event (ser-base.c:182)
==32510== by 0x63806D: handle_file_event (event-loop.c:762)
==32510==
[Switching to Thread 32509.32532]
Breakpoint 1, thread_execler (arg=0x0) at src/gdb/testsuite/gdb.threads/thread-execl.c:29
29 if (execl (image, image, NULL) == -1)
(gdb)
The breakpoint in question is the step-resume breakpoint of the
non-main thread, the one that was "next"ed.
The exact same issue can be seen on mainline with native debugging, by
running the thread-execl.exp test in non-stop mode, because the kernel
doesn't report a thread exit event for the execing thread.
Tested on x86_64 Fedora 20.
gdb/ChangeLog:
2015-03-02 Pedro Alves <palves@redhat.com>
* infrun.c (follow_exec): Delete all threads of the process except
the event thread. Extended comments.
gdb/testsuite/ChangeLog:
2015-03-02 Pedro Alves <palves@redhat.com>
* gdb.threads/thread-execl.exp (do_test): Handle non-stop.
(top level): Call do_test with non-stop as well.
2015-03-03 01:25:17 +00:00
|
|
|
|
2015-03-02 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* infrun.c (follow_exec): Delete all threads of the process except
|
|
|
|
|
the event thread. Extended comments.
|
|
|
|
|
|
2015-03-02 14:05:01 +00:00
|
|
|
|
2015-03-02 Joel Brobecker <brobecker@adacore.com>
|
|
|
|
|
|
|
|
|
|
* contrib/ari/gdb_ari.sh: Reinstate checks for "true" and "false".
|
|
|
|
|
|
Remove use of stdbool.h in GDB sources.
Using type bool from stdbool unfortunately causes problems trying
to build GDB on AiX and Solaris:
In file included from ../../src/gdb/utils.h:24:0,
from ../../src/gdb/defs.h:707,
from ../../src/gdb/utils.c:20:
/[...]/curses.h:96:14: error: two or more data types in declaration
specifiers
typedef char bool;
^
make[2]: *** [utils.o] Error 1
In theory, the problem is in curses.h which, in both cases, do
something similar. On Solaris:
#if !defined(__cplusplus) && !defined(_BOOL)
typedef char bool;
#endif /* !defined(__cplusplus) && !defined(_BOOL) */
On AiX:
#if !defined(__cplusplus) || (defined(__IBMCPP__) &&(__IBMCPP__<400))
#ifndef _BOOL
#define _BOOL
typedef int bool;
#endif
#endif
You can reproduce the same problem by trying to compile:
% cat toto.c
#include <stdbool.h>
#include <curses.h>
% gcc -c toto.c
In file included from toto.c:1:0:
/[...]/curses.h:159:13: error: two or more data types in declaration
specifiers
typedef int bool;
^
This specific issue wouldn't occur if we included curses.h before
including stdbool.h, and I looked at that just to be complete.
Here is a small schematic representation of the include logic:
* utils.c:
-> defs.h -> utils.h -> stdbool.h
-> gdb_curses.h -> curses.h
Because defs.h should always be first on the list, it means that
stdbool.h will always necessarily be included ahead of curses.h.
But, thinking beyond this very specific issue, it shows that using
stdbool.h is going to cause problems on these systems until either
GCC fixes those includes in a way that makes them work; or we switch
to C++.
In the meantime, I think the path of least resistance is to revert
the use of stdbool.h, and use integers, the way we've done up until
now. The benefits of using type "bool" are modest, IMO, so not
a great loss, and a temporary one.
gdb/ChangeLog:
* utils.h: Remove <stdbool.h> #include.
(producer_is_gcc): Change return type to "int".
* utils.c (producer_is_gcc): Change return type to int.
Return 1 instead of true, and 0 instead of false.
Adjust function documentation accordingly.
2015-03-02 14:01:23 +00:00
|
|
|
|
2015-03-02 Joel Brobecker <brobecker@adacore.com>
|
|
|
|
|
|
|
|
|
|
* utils.h: Remove <stdbool.h> #include.
|
|
|
|
|
(producer_is_gcc): Change return type to "int".
|
|
|
|
|
* utils.c (producer_is_gcc): Change return type to int.
|
|
|
|
|
Return 1 instead of true, and 0 instead of false.
|
|
|
|
|
Adjust function documentation accordingly.
|
|
|
|
|
|
S390: Add vector register support to gdb
Recognize S/390 targets with the new vector feature and present their
vector registers appropriately: as 32 new 128-bit wide registers
v0-v31, where the first 16 embed the floating point registers f0-f15.
Each of the full registers v0-v15 is modelled as a pseudo register.
gdb/ChangeLog:
* s390-linux-nat.c (have_regset_vxrs): New static variable.
(s390_linux_fetch_inferior_registers): Handle vector registers, if
present.
(s390_linux_store_inferior_registers): Likewise.
(s390_get_hwcap): Remove function. Embed its logic...
(s390_read_description): ...here. Yield a target description with
vector registers if applicable.
* s390-linux-tdep.c: Include "features/s390-vx-linux64.c",
"features/s390-tevx-linux64.c", "features/s390x-vx-linux64.c", and
"features/s390x-tevx-linux64.c".
(struct gdbarch_tdep) <v0_full_regnum>: New field.
(s390_dwarf_regmap): Add vector registers. Remove bogus entries
for "GNU/Linux-specific registers".
(s390_dwarf_reg_r0l): New enum value.
(s390_dwarf_reg_to_regnum): Support vector registers.
(s390_adjust_frame_regnum): Adjust pseudo DWARF register numbers
of GPR lower halves.
(regnum_is_vxr_full): New function.
(s390_register_name): New function.
(s390_pseudo_register_name): Handle v0-v15, which are composed of
f0-f15 and v0l-v15l.
(s390_pseudo_register_type): Likewise.
(s390_pseudo_register_read): Likewise.
(s390_pseudo_register_write): Likewise.
(s390_value_from_register): Account for the fact that values are
placed left-justified in vector registers.
(s390_pseudo_register_reggroup_p): Add pseudo registers v0-v15 to
the vector reggroup and omit them from the general reggroup.
(s390_regmap_vxrs_low, s390_regmap_vxrs_high): New register maps.
(s390_vxrs_low_regset, s390_vxrs_high_regset): New regsets.
(s390_iterate_over_regset_sections): Add iterations for the two
new vector regsets.
(s390_core_read_description): Yield a target description with
vector registers if applicable.
(s390_gdbarch_init): Handle target descriptions with vector
registers. Add "register_name" gdbarch method.
(_initialize_s390_tdep): Call new tdesc initialization functions.
* s390-linux-tdep.h (HWCAP_S390_VX): New macro.
(S390_V0_LOWER_REGNUM, S390_V1_LOWER_REGNUM, S390_V2_LOWER_REGNUM)
(S390_V3_LOWER_REGNUM, S390_V4_LOWER_REGNUM, S390_V5_LOWER_REGNUM)
(S390_V6_LOWER_REGNUM, S390_V7_LOWER_REGNUM, S390_V8_LOWER_REGNUM)
(S390_V9_LOWER_REGNUM, S390_V10_LOWER_REGNUM)
(S390_V11_LOWER_REGNUM, S390_V12_LOWER_REGNUM)
(S390_V13_LOWER_REGNUM, S390_V14_LOWER_REGNUM)
(S390_V15_LOWER_REGNUM, S390_V16_REGNUM, S390_V17_REGNUM)
(S390_V18_REGNUM, S390_V19_REGNUM, S390_V20_REGNUM)
(S390_V21_REGNUM, S390_V22_REGNUM, S390_V23_REGNUM)
(S390_V24_REGNUM, S390_V25_REGNUM, S390_V26_REGNUM)
(S390_V27_REGNUM, S390_V28_REGNUM, S390_V29_REGNUM)
(S390_V30_REGNUM, S390_V31_REGNUM): New macros.
(S390_NUM_REGS): Adjust value.
(s390_vxrs_low_regset, s390_vxrs_high_regset): Declare.
(tdesc_s390_vx_linux64, tdesc_s390_tevx_linux64)
(tdesc_s390x_vx_linux64, tdesc_s390x_tevx_linux64): Likewise.
* NEWS: Announce S/390 vector register support.
2015-03-02 09:57:39 +00:00
|
|
|
|
2015-03-02 Andreas Arnez <arnez@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
* s390-linux-nat.c (have_regset_vxrs): New static variable.
|
|
|
|
|
(s390_linux_fetch_inferior_registers): Handle vector registers, if
|
|
|
|
|
present.
|
|
|
|
|
(s390_linux_store_inferior_registers): Likewise.
|
|
|
|
|
(s390_get_hwcap): Remove function. Embed its logic...
|
|
|
|
|
(s390_read_description): ...here. Yield a target description with
|
|
|
|
|
vector registers if applicable.
|
|
|
|
|
* s390-linux-tdep.c: Include "features/s390-vx-linux64.c",
|
|
|
|
|
"features/s390-tevx-linux64.c", "features/s390x-vx-linux64.c", and
|
|
|
|
|
"features/s390x-tevx-linux64.c".
|
|
|
|
|
(struct gdbarch_tdep) <v0_full_regnum>: New field.
|
|
|
|
|
(s390_dwarf_regmap): Add vector registers. Remove bogus entries
|
|
|
|
|
for "GNU/Linux-specific registers".
|
|
|
|
|
(s390_dwarf_reg_r0l): New enum value.
|
|
|
|
|
(s390_dwarf_reg_to_regnum): Support vector registers.
|
|
|
|
|
(s390_adjust_frame_regnum): Adjust pseudo DWARF register numbers
|
|
|
|
|
of GPR lower halves.
|
|
|
|
|
(regnum_is_vxr_full): New function.
|
|
|
|
|
(s390_register_name): New function.
|
|
|
|
|
(s390_pseudo_register_name): Handle v0-v15, which are composed of
|
|
|
|
|
f0-f15 and v0l-v15l.
|
|
|
|
|
(s390_pseudo_register_type): Likewise.
|
|
|
|
|
(s390_pseudo_register_read): Likewise.
|
|
|
|
|
(s390_pseudo_register_write): Likewise.
|
|
|
|
|
(s390_value_from_register): Account for the fact that values are
|
|
|
|
|
placed left-justified in vector registers.
|
|
|
|
|
(s390_pseudo_register_reggroup_p): Add pseudo registers v0-v15 to
|
|
|
|
|
the vector reggroup and omit them from the general reggroup.
|
|
|
|
|
(s390_regmap_vxrs_low, s390_regmap_vxrs_high): New register maps.
|
|
|
|
|
(s390_vxrs_low_regset, s390_vxrs_high_regset): New regsets.
|
|
|
|
|
(s390_iterate_over_regset_sections): Add iterations for the two
|
|
|
|
|
new vector regsets.
|
|
|
|
|
(s390_core_read_description): Yield a target description with
|
|
|
|
|
vector registers if applicable.
|
|
|
|
|
(s390_gdbarch_init): Handle target descriptions with vector
|
|
|
|
|
registers. Add "register_name" gdbarch method.
|
|
|
|
|
(_initialize_s390_tdep): Call new tdesc initialization functions.
|
|
|
|
|
* s390-linux-tdep.h (HWCAP_S390_VX): New macro.
|
|
|
|
|
(S390_V0_LOWER_REGNUM, S390_V1_LOWER_REGNUM, S390_V2_LOWER_REGNUM)
|
|
|
|
|
(S390_V3_LOWER_REGNUM, S390_V4_LOWER_REGNUM, S390_V5_LOWER_REGNUM)
|
|
|
|
|
(S390_V6_LOWER_REGNUM, S390_V7_LOWER_REGNUM, S390_V8_LOWER_REGNUM)
|
|
|
|
|
(S390_V9_LOWER_REGNUM, S390_V10_LOWER_REGNUM)
|
|
|
|
|
(S390_V11_LOWER_REGNUM, S390_V12_LOWER_REGNUM)
|
|
|
|
|
(S390_V13_LOWER_REGNUM, S390_V14_LOWER_REGNUM)
|
|
|
|
|
(S390_V15_LOWER_REGNUM, S390_V16_REGNUM, S390_V17_REGNUM)
|
|
|
|
|
(S390_V18_REGNUM, S390_V19_REGNUM, S390_V20_REGNUM)
|
|
|
|
|
(S390_V21_REGNUM, S390_V22_REGNUM, S390_V23_REGNUM)
|
|
|
|
|
(S390_V24_REGNUM, S390_V25_REGNUM, S390_V26_REGNUM)
|
|
|
|
|
(S390_V27_REGNUM, S390_V28_REGNUM, S390_V29_REGNUM)
|
|
|
|
|
(S390_V30_REGNUM, S390_V31_REGNUM): New macros.
|
|
|
|
|
(S390_NUM_REGS): Adjust value.
|
|
|
|
|
(s390_vxrs_low_regset, s390_vxrs_high_regset): Declare.
|
|
|
|
|
(tdesc_s390_vx_linux64, tdesc_s390_tevx_linux64)
|
|
|
|
|
(tdesc_s390x_vx_linux64, tdesc_s390x_tevx_linux64): Likewise.
|
|
|
|
|
* NEWS: Announce S/390 vector register support.
|
|
|
|
|
|
2015-03-02 09:57:39 +00:00
|
|
|
|
2015-03-02 Andreas Arnez <arnez@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
* features/s390-tevx-linux64.xml: New file.
|
|
|
|
|
* features/s390-vx-linux64.xml: New file.
|
|
|
|
|
* features/s390-vx.xml: New file.
|
|
|
|
|
* features/s390x-tevx-linux64.xml: New file.
|
|
|
|
|
* features/s390x-vx-linux64.xml: New file.
|
|
|
|
|
* features/Makefile (WHICH): Add s390-vx-linux64,
|
|
|
|
|
s390x-vx-linux64, s390-tevx-linux64, and s390x-tevx-linux64.
|
|
|
|
|
(s390-vx-linux64-expedite, s390-tevx-linux64-expedite)
|
|
|
|
|
(s390x-vx-linux64-expedite, s390x-tevx-linux64-expedite): New
|
|
|
|
|
macros.
|
|
|
|
|
* features/s390-tevx-linux64.c: New generated file.
|
|
|
|
|
* features/s390-vx-linux64.c: Likewise.
|
|
|
|
|
* features/s390x-tevx-linux64.c: Likewise.
|
|
|
|
|
* features/s390x-vx-linux64.c: Likewise.
|
|
|
|
|
* regformats/s390-tevx-linux64.dat: Likewise.
|
|
|
|
|
* regformats/s390-vx-linux64.dat: Likewise.
|
|
|
|
|
* regformats/s390x-tevx-linux64.dat: Likewise.
|
|
|
|
|
* regformats/s390x-vx-linux64.dat: Likewise.
|
|
|
|
|
|
2015-02-28 20:05:27 +00:00
|
|
|
|
2015-02-28 Doug Evans <xdje42@gmail.com>
|
|
|
|
|
|
|
|
|
|
* symtab.h (struct symtab) <next>: Fix comment.
|
|
|
|
|
|
2015-02-27 22:40:36 +00:00
|
|
|
|
2015-02-27 Simon Marchi <simon.marchi@ericsson.com>
|
|
|
|
|
|
|
|
|
|
* python/python.c (python_GdbModuleDef): Rename GdbMethods to
|
|
|
|
|
python_GdbMethods.
|
|
|
|
|
|
2015-02-26 14:03:47 +00:00
|
|
|
|
2015-02-27 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* dtrace-probe.c (dtrace_probe_ops): Make extern.
|
|
|
|
|
|
2015-02-09 14:59:12 +00:00
|
|
|
|
2015-02-27 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* common/common-exceptions.h (exception_none): Declare.
|
|
|
|
|
* common/common-exceptions.c (exception_none): Moved from
|
|
|
|
|
exceptions.c.
|
|
|
|
|
(exceptions_state_mc_init): Use exception_none.
|
|
|
|
|
* exceptions.c (exception_none): Move to
|
|
|
|
|
common/common-exceptions.c.
|
|
|
|
|
* exceptions.h (exception_none): Move to
|
|
|
|
|
common/common-exceptions.h.
|
|
|
|
|
|
2015-02-09 14:59:10 +00:00
|
|
|
|
2015-02-27 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* main.c (catch_command_errors, catch_command_errors_const):
|
|
|
|
|
Remove 'mask' argument. Adjust.
|
|
|
|
|
(captured_main): Adjust callers.
|
|
|
|
|
|
2014-10-22 11:27:50 +00:00
|
|
|
|
2015-02-27 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* python/python-internal.h: Include "extension-priv.h".
|
|
|
|
|
|
2014-10-22 11:26:06 +00:00
|
|
|
|
2015-02-27 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* breakpoint.h (enum print_stop_action): Move further up in the
|
|
|
|
|
file.
|
|
|
|
|
|
2014-10-22 11:16:56 +00:00
|
|
|
|
2015-02-27 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdbarch.sh: Include regcache.h.
|
|
|
|
|
* gdbarch.h: Regenerate.
|
|
|
|
|
|
2014-10-22 04:58:23 +00:00
|
|
|
|
2015-02-27 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* arm-tdep.c (decode_insn) <arm_handle_insn, thumb_handle_insn>:
|
|
|
|
|
Remove duplicate const.
|
|
|
|
|
* sparc-sol2-tdep.c (sparc_sol2_static_transform_name): Remove
|
|
|
|
|
duplicate const.
|
|
|
|
|
|
2015-02-09 13:22:27 +00:00
|
|
|
|
2015-02-27 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* cp-valprint.c (vtbl_ptr_name): Use EXPORTED_CONST.
|
|
|
|
|
* guile/guile.c (extension_language_guile): Use EXPORTED_CONST.
|
|
|
|
|
* features/feature_to_c.sh: Tag the generated xml_builtin array
|
|
|
|
|
with extern const in C++ mode.
|
|
|
|
|
|
2014-06-05 20:36:27 +00:00
|
|
|
|
2015-02-27 Tom Tromey <tromey@redhat.com>
|
|
|
|
|
|
|
|
|
|
* minidebug.c (struct lzma_stream): Rename to ...
|
|
|
|
|
(struct gdb_lzma_stream): ... this.
|
|
|
|
|
(lzma_open, lzma_pread, lzma_close, lzma_stat): Adjust.
|
|
|
|
|
|
2014-10-22 04:09:07 +00:00
|
|
|
|
2015-02-27 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* mi/mi-cmd-stack.c (mi_apply_ext_lang_frame_filter): New
|
|
|
|
|
function.
|
|
|
|
|
(mi_cmd_stack_list_locals, mi_cmd_stack_list_args)
|
|
|
|
|
(mi_cmd_stack_list_variables): Use it.
|
|
|
|
|
|
2014-10-22 12:51:07 +00:00
|
|
|
|
2015-02-27 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* x86-linux-nat.c (u_debugreg_offset): New function.
|
|
|
|
|
(x86_linux_dr_get, x86_linux_dr_set): Use it.
|
|
|
|
|
|
2014-10-19 23:06:55 +00:00
|
|
|
|
2015-02-27 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* nat/x86-dregs.h (enum target_hw_bp_type): Remove forward
|
|
|
|
|
declaration.
|
|
|
|
|
Include break-common.h.
|
|
|
|
|
|
2014-10-22 05:08:20 +00:00
|
|
|
|
2015-02-27 Tom Tromey <tromey@redhat.com>
|
|
|
|
|
Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* arm-tdep.c (set_fp_model_sfunc, arm_set_abi): Use 'int' for
|
|
|
|
|
local used to iterate over enums.
|
|
|
|
|
* completer.c (signal_completer): Likewise.
|
|
|
|
|
* i386-tdep.c (i386_stap_parse_special_token): Likewise.
|
|
|
|
|
* rs6000-tdep.c (powerpc_set_vector_abi): Likewise.
|
|
|
|
|
* tui/tui-data.c (tui_next_win, tui_prev_win): Likewise.
|
|
|
|
|
* tui/tui-layout.c (next_layout, prev_layout): Likewise.
|
|
|
|
|
* tui/tui-win.c (tui_refresh_all_win, tui_rehighlight_all)
|
|
|
|
|
(tui_resize_all, tui_set_focus_command, tui_all_windows_info): Likewise.
|
|
|
|
|
* tui-wingeneral.c (tui_refresh_all): Likewise.
|
|
|
|
|
|
2014-10-22 03:35:38 +00:00
|
|
|
|
2015-02-27 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* target.h: Include "infrun.h".
|
|
|
|
|
|
proc-service, extern "C"
libthread_db.so calls symbols in the client (GDB), through the
proc-service interface. These routines must have extern "C" linkage
so their symbol names are not mangled when GDB is built as a C++
program. On the GDBserver side, we were missing fallback declarations for
all these symbols.
gdb/ChangeLog:
2015-02-27 Pedro Alves <palves@redhat.com>
* gdb_proc_service.h: Wrap with EXTERN_C_PUSH/EXTERN_C_POP.
gdb/gdbserver/ChangeLog:
2015-02-27 Pedro Alves <palves@redhat.com>
* gdb_proc_service.h: Wrap with EXTERN_C_PUSH/EXTERN_C_POP.
[!HAVE_PROC_SERVICE_H] (struct ps_prochandle): Forward declare.
[!HAVE_PROC_SERVICE_H] (ps_pdread, ps_pdwrite, ps_ptread)
ps_ptwrite, ps_lgetregs, ps_lsetregs, ps_lgetfpregs)
(ps_lsetfpregs, ps_getpid)
(ps_get_thread_area, ps_pglobal_lookup, ps_pstop, ps_pcontinue)
(ps_lstop, ps_lcontinue, ps_lgetxregsize, ps_lgetxregs)
(ps_lsetxregs, ps_plog): Declare.
2015-02-09 14:59:09 +00:00
|
|
|
|
2015-02-27 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb_proc_service.h: Wrap with EXTERN_C_PUSH/EXTERN_C_POP.
|
|
|
|
|
|
Make functions and variables exported by the IPA be extern "C"
Functions and variables that are exported by the IPA DSO (that
GDBserver needs to look up) should have "C" mangling, thus be declared
with extern "C".
Function and variable declarations need the extern "C" marker, but
variable definitions can't be marked extern, so the patch splits
IP_AGENT_EXPORT into three.
Building in C++ mode revealed that a few variables were missing
IP_AGENT_EXPORT, thus the IPA has been broken when stripped, even in C
mode... So this ends being a bug fix as well.
gdb/ChangeLog:
2015-02-27 Pedro Alves <palves@redhat.com>
* common/agent.h (IPA_SYM_EXPORTED_NAME): New.
(IPA_SYM): Use it.
* common/common-defs.h (EXTERN_C_PUSH, EXTERN_C_POP): New macros.
gdb/gdbserver/ChangeLog:
2015-02-27 Pedro Alves <palves@redhat.com>
* linux-amd64-ipa.c (gdb_agent_get_raw_reg): Use
IP_AGENT_EXPORT_FUNC.
* linux-i386-ipa.c (gdb_agent_get_raw_reg): Use
IP_AGENT_EXPORT_FUNC.
* tracepoint.c (ATTR_USED, ATTR_NOINLINE, ATTR_CONSTRUCTOR)
(IP_AGENT_EXPORT): Delete.
(gdb_tp_heap_buffer, gdb_jump_pad_buffer, gdb_jump_pad_buffer_end)
(gdb_trampoline_buffer, gdb_trampoline_buffer_end)
(gdb_trampoline_buffer_error, collecting, gdb_collect)
(stop_tracing, flush_trace_buffer, about_to_request_buffer_space)
(trace_buffer_is_full, stopping_tracepoint, expr_eval_result)
(error_tracepoint, tracepoints, tracing, trace_buffer_ctrl)
(trace_buffer_ctrl_curr, trace_buffer_lo, trace_buffer_hi)
(traceframe_read_count, traceframe_write_count)
(traceframes_created, trace_state_variables, get_raw_reg)
(get_trace_state_variable_value, set_trace_state_variable_value)
(ust_loaded, helper_thread_id, cmd_buf): Use
IPA_SYM_EXPORTED_NAME.
(stop_tracing, flush_trace_buffer): Use IP_AGENT_EXPORT_FUNC.
(tracepoints) Use IP_AGENT_EXPORT_VAR.
(stopping_tracepoint, trace_buffer_is_full, expr_eval_result): Use
IP_AGENT_EXPORT_VAR and wrap in EXTERN_C_PUSH/EXTERN_C_POP.
(last_tracepoint): Move into !IN_PROCESS_AGENT block.
(error_tracepoint): Use IP_AGENT_EXPORT_VAR and wrap in
EXTERN_C_PUSH/EXTERN_C_POP.
(trace_state_variables): Use IP_AGENT_EXPORT_VAR.
(trace_buffer_lo, trace_buffer_hi): Use IP_AGENT_EXPORT_VAR and
wrap in EXTERN_C_PUSH/EXTERN_C_POP.
(trace_buffer_ctrl, trace_buffer_ctrl_curr)
(traceframe_write_count, traceframe_read_count)
(traceframes_created, tracing): Use IP_AGENT_EXPORT_VAR.
(about_to_request_buffer_space, get_trace_state_variable_value)
(set_trace_state_variable_value): Use IP_AGENT_EXPORT_FUNC.
(collecting): Use IP_AGENT_EXPORT_VAR and wrap in
EXTERN_C_PUSH/EXTERN_C_POP.
(gdb_collect): Use IP_AGENT_EXPORT_FUNC.
(ust_loaded, cmd_buf): Use IP_AGENT_EXPORT_VAR.
(helper_thread_id, gdb_agent_capability): Use IP_AGENT_EXPORT_VAR
and wrap in EXTERN_C_PUSH/EXTERN_C_POP.
(gdb_tp_heap_buffer, gdb_jump_pad_buffer, gdb_jump_pad_buffer_end)
(gdb_trampoline_buffer, gdb_trampoline_buffer_end)
(gdb_trampoline_buffer_error): Use IP_AGENT_EXPORT_VAR.
* tracepoint.h (ATTR_USED, ATTR_NOINLINE, EXPORTED_SYMBOL):
Define.
(IP_AGENT_EXPORT_FUNC, IP_AGENT_EXPORT_VAR)
(IP_AGENT_EXPORT_VAR_DECL): Define.
(tracing): Declare.
(gdb_agent_get_raw_reg): Declare.
2015-02-09 14:59:08 +00:00
|
|
|
|
2015-02-27 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* common/agent.h (IPA_SYM_EXPORTED_NAME): New.
|
|
|
|
|
(IPA_SYM): Use it.
|
|
|
|
|
* common/common-defs.h (EXTERN_C_PUSH, EXTERN_C_POP): New macros.
|
|
|
|
|
|
2015-02-09 14:59:08 +00:00
|
|
|
|
2015-02-27 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* cli-out.c (_rl_erase_entire_line): Move declaration out of
|
|
|
|
|
cli_mld_erase_entire_line, and make it extern "C".
|
|
|
|
|
* common/common-defs.h (EXTERN_C): New.
|
|
|
|
|
* completer.c (_rl_completion_prefix_display_length)
|
|
|
|
|
(_rl_print_completions_horizontally, QSFUNC): Move declarations
|
|
|
|
|
out of gdb_display_match_list_1.
|
|
|
|
|
(_rl_qsort_string_compare): Move declaration out of
|
|
|
|
|
gdb_display_match_list_1, and make it extern "C".
|
|
|
|
|
* defs.h (re_comp): Use EXTERN_C.
|
|
|
|
|
* maint.c (_mcleanup): Move declaration out of mcleanup_wrapper,
|
|
|
|
|
and make it extern "C".
|
|
|
|
|
(monstartup): Move declaration out of maintenance_set_profile_cmd,
|
|
|
|
|
and make it extern "C".
|
|
|
|
|
(main): Move declaration out of maintenance_set_profile_cmd.
|
|
|
|
|
* nat/linux-ptrace.c (linux_ptrace_attach_fail_reason_string): Use
|
|
|
|
|
EXTERN_C.
|
|
|
|
|
|
2015-02-09 14:59:06 +00:00
|
|
|
|
2015-02-27 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* python/python.c (GdbMethods): Rename to ...
|
|
|
|
|
(python_GdbMethods): ... this and make extern.
|
|
|
|
|
(GdbModuleDef): Rename to ...
|
|
|
|
|
(python_GdbModuleDef): ... this and make extern.
|
|
|
|
|
|
2015-02-09 17:13:39 +00:00
|
|
|
|
2015-02-27 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* record-btrace.c (set_record_btrace_cmdlist)
|
|
|
|
|
(show_record_btrace_cmdlist): Remove redefinitions.
|
|
|
|
|
|
Fix struct, union, and enum nesting in C++
In C, an enum or structure defined inside other structure has global
scope just like it had been defined outside the struct in the first
place. However, in C++, such a nested structure is given a name that
is nested inside the structure. This patch moves such affected
structures/enums out to global scope, so that code using them works
the same in C++ as it works today in C.
gdb/ChangeLog:
2015-02-27 Tom Tromey <tromey@redhat.com>
Pedro Alves <palves@redhat.com>
* dwarf2-frame.c (enum cfa_how_kind, struct
dwarf2_frame_state_reg_info): Move out of struct
dwarf2_frame_state.
* dwarf2read.c (struct tu_stats): Move out of struct
dwarf2_per_objfile.
(struct file_entry): Move out of struct line_header.
(struct nextfield, struct nextfnfield, struct fnfieldlist, struct
typedef_field_list): Move out of struct field_info.
* gdbtypes.h (enum dynamic_prop_kind, union dynamic_prop_data):
Move out of struct dynamic_prop.
(union type_owner, union field_location, struct field, struct
range_bounds, union type_specific): Move out of struct main_type.
(struct fn_fieldlist, struct fn_field, struct typedef_field)
(VOFFSET_STATIC): Move out of struct cplus_struct_type.
(struct call_site_target, union call_site_parameter_u, struct
call_site_parameter): Move out of struct call_site.
* m32c-tdep.c (enum m32c_prologue_kind): Move out of struct
m32c_prologue.
(enum srcdest_kind): Move out of struct srcdest.
* main.c (enum cmdarg_kind): Move out of struct cmdarg.
* prologue-value.h (enum prologue_value_kind): Move out of struct
prologue_value.
* s390-linux-tdep.c (enum s390_abi_kind): Move out of struct
gdbarch_tdep.
* stabsread.c (struct nextfield, struct next_fnfieldlist): Move
out of struct field_info.
* symfile.h (struct other_sections): Move out of struct
section_addr_info.
* symtab.c (struct symbol_cache_slot): Move out struct
block_symbol_cache.
* target-descriptions.c (enum tdesc_type_kind): Move out of
typedef struct tdesc_type.
* tui/tui-data.h (enum tui_line_or_address_kind): Move out of
struct tui_line_or_address.
* value.c (enum internalvar_kind, union internalvar_data): Move
out of struct internalvar.
* xtensa-tdep.h (struct ctype_cache): Move out of struct
gdbarch_tdep.
2015-02-09 14:59:05 +00:00
|
|
|
|
2015-02-27 Tom Tromey <tromey@redhat.com>
|
|
|
|
|
Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* dwarf2-frame.c (enum cfa_how_kind, struct
|
|
|
|
|
dwarf2_frame_state_reg_info): Move out of struct
|
|
|
|
|
dwarf2_frame_state.
|
|
|
|
|
* dwarf2read.c (struct tu_stats): Move out of struct
|
|
|
|
|
dwarf2_per_objfile.
|
|
|
|
|
(struct file_entry): Move out of struct line_header.
|
|
|
|
|
(struct nextfield, struct nextfnfield, struct fnfieldlist, struct
|
|
|
|
|
typedef_field_list): Move out of struct field_info.
|
|
|
|
|
* gdbtypes.h (enum dynamic_prop_kind, union dynamic_prop_data):
|
|
|
|
|
Move out of struct dynamic_prop.
|
|
|
|
|
(union type_owner, union field_location, struct field, struct
|
|
|
|
|
range_bounds, union type_specific): Move out of struct main_type.
|
|
|
|
|
(struct fn_fieldlist, struct fn_field, struct typedef_field)
|
|
|
|
|
(VOFFSET_STATIC): Move out of struct cplus_struct_type.
|
|
|
|
|
(struct call_site_target, union call_site_parameter_u, struct
|
|
|
|
|
call_site_parameter): Move out of struct call_site.
|
|
|
|
|
* m32c-tdep.c (enum m32c_prologue_kind): Move out of struct
|
|
|
|
|
m32c_prologue.
|
|
|
|
|
(enum srcdest_kind): Move out of struct srcdest.
|
|
|
|
|
* main.c (enum cmdarg_kind): Move out of struct cmdarg.
|
|
|
|
|
* prologue-value.h (enum prologue_value_kind): Move out of struct
|
|
|
|
|
prologue_value.
|
|
|
|
|
* s390-linux-tdep.c (enum s390_abi_kind): Move out of struct
|
|
|
|
|
gdbarch_tdep.
|
|
|
|
|
* stabsread.c (struct nextfield, struct next_fnfieldlist): Move
|
|
|
|
|
out of struct field_info.
|
|
|
|
|
* symfile.h (struct other_sections): Move out of struct
|
|
|
|
|
section_addr_info.
|
|
|
|
|
* symtab.c (struct symbol_cache_slot): Move out struct
|
|
|
|
|
block_symbol_cache.
|
|
|
|
|
* target-descriptions.c (enum tdesc_type_kind): Move out of
|
|
|
|
|
typedef struct tdesc_type.
|
|
|
|
|
* tui/tui-data.h (enum tui_line_or_address_kind): Move out of
|
|
|
|
|
struct tui_line_or_address.
|
|
|
|
|
* value.c (enum internalvar_kind, union internalvar_data): Move
|
|
|
|
|
out of struct internalvar.
|
|
|
|
|
* xtensa-tdep.h (struct ctype_cache): Move out of struct
|
|
|
|
|
gdbarch_tdep.
|
|
|
|
|
|
2015-02-27 16:33:07 +00:00
|
|
|
|
2015-02-27 Tom Tromey <tromey@redhat.com>
|
|
|
|
|
Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
Rename symbols whose names are reserved C++ keywords throughout.
|
|
|
|
|
|
Add --enable-build-with-cxx configure switch
This new option, disabled by default for now, allows specifying
whether to build GDB, GDBserver, and friends with a C++ (98/03)
compiler.
The name of the switch should be familiar to those who followed GCC's
own C++ conversion process.
. Adding -fpermissive to COMPILER in C++ mode (see the new
build-with-cxx.m4 file) makes errors like these be warnings instead:
gdb/infrun.c:6597:1: error: initializing argument 1 of ‘void sig_print_info(gdb_signal)’ [-fpermissive]
sig_print_info (enum gdb_signal oursig)
^
gdb/infrun.c: In function ‘void do_restore_infcall_suspend_state_cleanup(void*)’:
gdb/infrun.c:7164:39: error: invalid conversion from ‘void*’ to ‘infcall_suspend_state*’ [-fpermissive]
restore_infcall_suspend_state (state);
^
so that the compiler carries on compiling the file. -Werror still
catches the warnings, so nothing is lost, only our lifes are made
easier by concentrating on getting other more important things out of
the way first.
There's no way to quiet those warnings. Until they're all fixed, when
building in C++ mode, -Werror is disabled by default.
. Adding -Wno-narrowing suppresses thousands of instances of this warning:
gdb/arm-linux-tdep.c:439:1: error: narrowing conversion of ‘-1’ from ‘int’ to ‘ULONGEST {aka long unsigned int}’ inside { } is ill-formed in C++11 [-Werror=narrowing]
gdb/arm-linux-tdep.c:439:1: error: narrowing conversion of ‘-1l’ from ‘LONGEST {aka long int}’ to ‘ULONGEST {aka long unsigned int}’ inside { } is ill-formed in C++11 [-Werror=narrowing]
gdb/arm-linux-tdep.c:450:1: error: narrowing conversion of ‘-1’ from ‘int’ to ‘ULONGEST {aka long unsigned int}’ inside { } is ill-formed in C++11 [-Werror=narrowing]
We can defer handling those until we target C++11.
. Adding -Wno-sign-compare suppresses thousands of instances of this warning:
gdb/linux-record.c:1763:32: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if (tmpulongest == tdep->fcntl_F_GETLK64)
^
. Adding -Wno-write-strings suppresses thousands of instances of this warning:
gdb/mi/mi-cmd-var.c: In function ‘void mi_cmd_var_show_attributes(char*, char**, int)’:
gdb/mi/mi-cmd-var.c:514:12: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
attstr = "editable";
^
gdb/mi/mi-cmd-var.c:516:12: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
attstr = "noneditable";
^
For now, it's best to hide these warnings from view until we're
'-fpermissive'-clean, and can thus start building with -Werror.
The C compiler has always managed to build working GDBs with these
issues in the code, so a C++ compiler should too.
gdb/ChangeLog:
2015-02-27 Pedro Alves <palves@redhat.com>
* Makefile.in (COMPILER): New, get it from autoconf.
(COMPILE.pre, CC_LD): Use COMPILER.
(CXX): Get from autoconf instead.
(CXX_FOR_TARGET): Default to g++ instead of gcc.
* acinclude.m4: Include build-with-cxx.m4.
* build-with-cxx.m4: New file.
* configure.ac: Call AC_PROG_CXX and GDB_AC_BUILD_WITH_CXX.
Disable -Werror by default if building in C++ mode.
(build_warnings): Add -Wno-sign-compare, -Wno-write-strings and
-Wno-narrowing in C++ mode. Only enable -Wpointer-sign in C mode.
Run supported-warning-flags tests with the C++ compiler.
Save/restore CXXFLAGS too.
* configure: Regenerate.
gdb/gdbserver/ChangeLog:
2015-02-27 Pedro Alves <palves@redhat.com>
* Makefile.in (COMPILER): New, get it from autoconf.
(CXX): Get from autoconf instead.
(COMPILE.pre): Use COMPILER.
(CC-LD): Rename to ...
(CC_LD): ... this. Use COMPILER.
(gdbserver$(EXEEXT), gdbreplay$(EXEEXT), $(IPA_LIB)): Adjust.
(CXX_FOR_TARGET): Default to g++ instead of gcc.
* acinclude.m4: Include build-with-cxx.m4.
* configure.ac: Call AC_PROG_CXX and GDB_AC_BUILD_WITH_CXX.
Disable -Werror by default if building in C++ mode.
(build_warnings): Add -Wno-sign-compare, -Wno-write-strings and
-Wno-narrowing in C++ mode. Run supported-warning-flags tests with
the C++ compiler. Save/restore CXXFLAGS too.
* configure: Regenerate.
2015-02-27 13:11:25 +00:00
|
|
|
|
2015-02-27 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* Makefile.in (COMPILER): New, get it from autoconf.
|
|
|
|
|
(COMPILE.pre, CC_LD): Use COMPILER.
|
|
|
|
|
(CXX): Get from autoconf instead.
|
|
|
|
|
(CXX_FOR_TARGET): Default to g++ instead of gcc.
|
|
|
|
|
* acinclude.m4: Include build-with-cxx.m4.
|
|
|
|
|
* build-with-cxx.m4: New file.
|
|
|
|
|
* configure.ac: Call AC_PROG_CXX and GDB_AC_BUILD_WITH_CXX.
|
|
|
|
|
Disable -Werror by default if building in C++ mode.
|
|
|
|
|
(build_warnings): Add -Wno-sign-compare, -Wno-write-strings and
|
|
|
|
|
-Wno-narrowing in C++ mode. Only enable -Wpointer-sign in C mode.
|
|
|
|
|
Run supported-warning-flags tests with the C++ compiler.
|
|
|
|
|
Save/restore CXXFLAGS too.
|
|
|
|
|
* configure: Regenerate.
|
|
|
|
|
|
Create libiberty.m4, have GDB and GDBserver use it
Converting GDB to be a C++ program, I stumbled on 'basename' issues,
like:
src/gdb/../include/ansidecl.h:169:64: error: new declaration ‘char* basename(const char*)’
/usr/include/string.h:597:26: error: ambiguates old declaration ‘const char* basename(const char*)’
which I believe led to this bit in gold's configure.ac:
dnl We have to check these in C, not C++, because autoconf generates
dnl tests which have no type information, and current glibc provides
dnl multiple declarations of functions like basename when compiling
dnl with C++.
AC_CHECK_DECLS([basename, ffs, asprintf, vasprintf, snprintf, vsnprintf, strverscmp])
These checks IIUC intend to generate all the HAVE_DECL_FOO symbols
that libiberty.h and ansidecl.h check.
GDB is missing these checks currently, which results in the conflict
shown above.
This adds an m4 file that both GDB and GDBserver's configury use to
pull in the autoconf checks that libiberty clients needs done in order
to use these libiberty.h/ansidecl.h.
gdb/ChangeLog:
2015-02-27 Pedro Alves <palves@redhat.com>
* libiberty.m4: New file.
* acinclude.m4: Include libiberty.m4.
* configure.ac: Call libiberty_INIT.
* config.in, configure: Regenerate.
gdb/gdbserver/
2015-02-27 Pedro Alves <palves@redhat.com>
* acinclude.m4: Include libiberty.m4.
* configure.ac: Call libiberty_INIT.
* config.in, configure: Regenerate.
2015-02-27 15:52:02 +00:00
|
|
|
|
2015-02-27 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* libiberty.m4: New file.
|
|
|
|
|
* acinclude.m4: Include libiberty.m4.
|
|
|
|
|
* configure.ac: Call libiberty_INIT.
|
|
|
|
|
* config.in, configure: Regenerate.
|
|
|
|
|
|
2015-02-27 09:47:54 +00:00
|
|
|
|
2015-02-27 Andreas Arnez <arnez@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
* s390-linux-tdep.c (s390_gcc_target_options): Not just handle
|
|
|
|
|
31-bit targets, but 64-bit targets as well.
|
|
|
|
|
(s390_gnu_triplet_regexp): New function.
|
|
|
|
|
(s390_gdbarch_init): Set the gcc_target_options gdbarch method for
|
|
|
|
|
64-bit targets as well. Set the gnu_triplet_regexp gdbarch
|
|
|
|
|
method.
|
|
|
|
|
|
2015-02-27 08:49:59 +00:00
|
|
|
|
2015-02-27 Jon TURNEY <jon.turney@dronecode.org.uk> (tiny patch)
|
2015-02-18 23:13:47 +00:00
|
|
|
|
|
|
|
|
|
* windows-nat.c (CONTEXT_DEBUGGER): Remove.
|
|
|
|
|
(CONTEXT_DEBUGGER_DR): Add CONTEXT_SEGMENTS. Incorporate flags
|
|
|
|
|
from CONTEXT_DEBUGGER.
|
|
|
|
|
|
2015-02-27 01:31:29 +00:00
|
|
|
|
2015-02-26 Doug Evans <dje@google.com>
|
|
|
|
|
|
|
|
|
|
* gdbtypes.c (internal_type_vptr_fieldno): Add missing call to
|
|
|
|
|
CHECK_TYPEDEF.
|
|
|
|
|
(set_type_vptr_fieldno): Ditto.
|
|
|
|
|
(internal_type_vptr_basetype, set_type_vptr_basetype): Ditto.
|
|
|
|
|
* gnu-v3-abi.c (gnuv3_dynamic_class): Ditto.
|
|
|
|
|
|
2015-02-26 18:29:12 +00:00
|
|
|
|
2015-02-26 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* auto-load.h (file_is_auto_load_safe): Add ATTRIBUTE_PRINTF.
|
|
|
|
|
* complaints.c (vcomplaint): Pass argument FMT directly to
|
|
|
|
|
printf-like functions instead of complaint->fmt.
|
|
|
|
|
* ctf.c (ctf_save_write_metadata): Add ATTRIBUTE_PRINTF.
|
|
|
|
|
* darwin-nat.c (inferior_debug): Add ATTRIBUTE_PRINTF.
|
|
|
|
|
* compile/compile-loc2c.c (pushf, unary, binary): Add
|
|
|
|
|
ATTRIBUTE_PRINTF.
|
|
|
|
|
(do_compile_dwarf_expr_to_c): Pass string literal as format string
|
|
|
|
|
to pushf.
|
|
|
|
|
(BINARY): Pass string literal as format string to 'binary'.
|
|
|
|
|
* compile/compile-object-load.c (link_callbacks_einfo): Add
|
|
|
|
|
ATTRIBUTE_PRINTF.
|
|
|
|
|
* guile/guile-internal.h (gdbscm_printf): Add ATTRIBUTE_PRINTF.
|
|
|
|
|
|
2015-02-26 17:13:58 +00:00
|
|
|
|
2015-02-26 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* windows-termcap.c: Rename to ...
|
|
|
|
|
* stub-termcap.c: ... this. Adjust header line.
|
|
|
|
|
* Makefile.in (SFILES): Refer to stub-termcap.c instead of
|
|
|
|
|
windows-termcap.c.
|
|
|
|
|
* configure: Regenerate.
|
|
|
|
|
* configure.ac: Refer to stub-termcap.o instead of
|
|
|
|
|
windows-termcap.o.
|
|
|
|
|
* gdb_curses.h: Mention stub-termcap.c instead of
|
|
|
|
|
windows-termcap.c.
|
|
|
|
|
|
2015-02-26 16:40:57 +00:00
|
|
|
|
2015-02-26 Jan Kratochvil <jan.kratochvil@redhat.com>
|
|
|
|
|
|
|
|
|
|
* compile/compile-c-symbols.c (convert_one_symbol, convert_symbol_bmsym)
|
|
|
|
|
(gcc_symbol_address): Call gnu_ifunc_resolve_addr.
|
|
|
|
|
|
2015-02-25 16:00:01 +00:00
|
|
|
|
2015-02-26 Antoine Tremblay <antoine.tremblay@ericsson.com>
|
|
|
|
|
|
|
|
|
|
* gdb/infcmd.c (print_return_value): use type_to_string to print type.
|
|
|
|
|
|
2015-02-26 13:08:01 +00:00
|
|
|
|
2015-02-26 Jan Kratochvil <jan.kratochvil@redhat.com>
|
|
|
|
|
|
|
|
|
|
* elfread.c (elf_read_minimal_symbols): Use bfd_alloc for
|
|
|
|
|
bfd_canonicalize_symtab.
|
|
|
|
|
|
2015-02-25 14:51:42 +00:00
|
|
|
|
2015-02-25 John Baldwin <jhb@FreeBSD.org>
|
|
|
|
|
|
|
|
|
|
* amd64fbsd-nat.c: Include sys/user.h.
|
|
|
|
|
(_initialize_amd64fbsd_nat): Use the KERN_PROC_SIGTRAMP sysctl
|
|
|
|
|
instead of KERN_PS_STRINGS to locate the signal trampoline.
|
|
|
|
|
* i386fbsd-nat.c: Include sys/user.h.
|
|
|
|
|
(_initialize_i386fbsd_nat): Use the KERN_PROC_SIGTRAMP sysctl
|
|
|
|
|
instead of KERN_PS_STRINGS to locate the signal trampoline.
|
|
|
|
|
* amd64fbsd-tdep.c (amd64fbsd_sigtramp_code): New.
|
|
|
|
|
(amd64fbsd_sigtramp_p): New.
|
|
|
|
|
(amd64fbsd_sigtramp_start_addr, amd64fbsd_sigtramp_end_addr): No
|
|
|
|
|
longer set default values.
|
|
|
|
|
(amd64fbsd_init_abi): Set "sigtramp_p" to "amd64fbsd_sigtramp_p".
|
|
|
|
|
* i386fbsd-tdep.c (i386fbsd_sigtramp_start)
|
|
|
|
|
(i386fbsd_sigtramp_middle, i386fbsd_sigtramp_end)
|
|
|
|
|
(i386fbsd_freebsd4_sigtramp_start)
|
|
|
|
|
(i386fbsd_freebsd4_sigtramp_middle)
|
|
|
|
|
(i386fbsd_freebsd4_sigtramp_end, i386fbsd_osigtramp_start)
|
|
|
|
|
(i386fbsd_osigtramp_middle, i386fbsd_osigtramp_end): New.
|
|
|
|
|
(i386fbsd_sigtramp_p): New.
|
|
|
|
|
(i386fbsd_sigtramp_start_addr, i386fbsd_sigtramp_end_addr): No
|
|
|
|
|
longer set default values.
|
|
|
|
|
(i386fbsd_init_abi): Set "sigtramp_p" to "i386fbsd_sigtramp_p".
|
|
|
|
|
|
2015-02-26 11:07:57 +00:00
|
|
|
|
2015-02-25 John Baldwin <jhb@freebsd.org>
|
|
|
|
|
|
|
|
|
|
* amd64fbsd-tdep.c (amd64fbsd_sigcontext_addr): Use
|
|
|
|
|
get_frame_register instead of frame_unwind_register_unsigned.
|
|
|
|
|
|
2015-02-26 10:50:08 +00:00
|
|
|
|
2015-02-26 Jan Kratochvil <jan.kratochvil@redhat.com>
|
|
|
|
|
|
|
|
|
|
PR build/18033
|
|
|
|
|
* compile/compile-c-support.c (c_compute_program): Change // comment.
|
|
|
|
|
* compile/compile-object-load.c (setup_sections): Change // comment.
|
|
|
|
|
|
2015-02-26 09:42:04 +00:00
|
|
|
|
2015-02-26 Joel Brobecker <brobecker@adacore.com>
|
|
|
|
|
|
|
|
|
|
PR build/18033:
|
|
|
|
|
* iq2000-tdep.c (iq2000_frame_cache): Delete C++-style comment.
|
|
|
|
|
|
remote.c: simplify parsing stop reasons in T stop replies
We need to be careful with parsing optional stop reasons that start
with an hex character ("awatch", "core"), as GDBs that aren't aware of
them parse them as real numbers. That's silly of course, given that
there should be a colon after those magic "numbers". So if strtol on
"abbz:" doesn't return "first invalid char" pointing to the colon, we
know that "abbz" isn't really a register number. It must be optional
stop info we don't know about. This adjusts GDB to work that way,
removing the need for the special casing done upfront:
/* If this packet is an awatch packet, don't parse the 'a'
as a register number. */
if (strncmp (p, "awatch", strlen("awatch")) != 0
&& strncmp (p, "core", strlen ("core") != 0))
For as long as we care about compatibility with GDB 7.9, we'll need to
continue to be careful about this, so I added a comment.
Tested on x86_64 Fedora 20, native gdbserver.
gdb/ChangeLog:
2015-02-23 Pedro Alves <palves@redhat.com>
* remote.c (skip_to_semicolon): New function.
(remote_parse_stop_reply) <T stop reply>: Use it. Don't
special case the stop reasons that look like hex numbers
upfront. Instead handle real register numbers after matching
all the known stop reasons.
2015-02-23 16:45:39 +00:00
|
|
|
|
2015-02-23 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* remote.c (skip_to_semicolon): New function.
|
|
|
|
|
(remote_parse_stop_reply) <T stop reply>: Use it. Don't
|
|
|
|
|
special case the stop reasons that look like hex numbers
|
|
|
|
|
upfront. Instead handle real register numbers after matching
|
|
|
|
|
all the known stop reasons.
|
|
|
|
|
|
2015-02-22 05:58:31 +00:00
|
|
|
|
2015-02-21 Doug Evans <dje@google.com>
|
|
|
|
|
|
|
|
|
|
PR c++/17976, symtab/17821
|
|
|
|
|
* cp-namespace.c (cp_search_static_and_baseclasses): New parameter
|
|
|
|
|
is_in_anonymous. All callers updated.
|
|
|
|
|
(find_symbol_in_baseclass): Ditto.
|
|
|
|
|
(cp_lookup_nested_symbol_1): Ditto. Don't search all static blocks
|
|
|
|
|
for symbols in an anonymous namespace.
|
|
|
|
|
* dwarf2read.c (namespace_name): Don't call dwarf2_name, fetch
|
|
|
|
|
DW_AT_name directly.
|
|
|
|
|
(dwarf2_name): Convert missing namespace name to
|
|
|
|
|
CP_ANONYMOUS_NAMESPACE_STR.
|
|
|
|
|
|
GNU/Linux: Stop using libthread_db/td_ta_thr_iter
TL;DR - GDB can hang if something refreshes the thread list out of the
target while the target is running. GDB hangs inside td_ta_thr_iter.
The fix is to not use that libthread_db function anymore.
Long version:
Running the testsuite against my all-stop-on-top-of-non-stop series is
still exposing latent non-stop bugs.
I was originally seeing this with the multi-create.exp test, back when
we were still using libthread_db thread event breakpoints. The
all-stop-on-top-of-non-stop series forces a thread list refresh each
time GDB needs to start stepping over a breakpoint (to pause all
threads). That test hits the thread event breakpoint often, resulting
in a bunch of step-over operations, thus a bunch of thread list
refreshes while some threads in the target are running.
The commit adds a real non-stop mode test that triggers the issue,
based on multi-create.exp, that does an explicit "info threads" when a
breakpoint is hit. IOW, it does the same things the as-ns series was
doing when testing multi-create.exp.
The bug is a race, so it unfortunately takes several runs for the test
to trigger it. In fact, even when setting the test running in a loop,
it sometimes takes several minutes for it to trigger for me.
The race is related to libthread_db's td_ta_thr_iter. This is
libthread_db's entry point for walking the thread list of the
inferior.
Sometimes, when GDB refreshes the thread list from the target,
libthread_db's td_ta_thr_iter can somehow see glibc's thread list as a
cycle, and get stuck in an infinite loop.
The issue is that when a thread exits, its thread control structure in
glibc is moved from a "used" list to a "cache" list. These lists are
simply circular linked lists where the "next/prev" pointers are
embedded in the thread control structure itself. The "next" pointer
of the last element of the list points back to the list's sentinel
"head". There's only one set of "next/prev" pointers for both lists;
thus a thread can only be in one of the lists at a time, not in both
simultaneously.
So when thread C exits, simplifying, the following happens. A-C are
threads. stack_used and stack_cache are the list's heads.
Before:
stack_used -> A -> B -> C -> (&stack_used)
stack_cache -> (&stack_cache)
After:
stack_used -> A -> B -> (&stack_used)
stack_cache -> C -> (&stack_cache)
td_ta_thr_iter starts by iterating at the list's head's next, and
iterates until it sees a thread whose next pointer points to the
list's head again. Thus in the before case above, C's next points to
stack_used, indicating end of list. In the same case, the stack_cache
list is empty.
For each thread being iterated, td_ta_thr_iter reads the whole thread
object out of the inferior. This includes the thread's "next"
pointer.
In the scenario above, it may happen that td_ta_thr_iter is iterating
thread B and has already read B's thread structure just before thread
C exits and its control structure moves to the cached list.
Now, recall that td_ta_thr_iter is running in the context of GDB, and
there's no locking between GDB and the inferior. From it's local copy
of B, td_ta_thr_iter believes that the next thread after B is thread
C, so it happilly continues iterating to C, a thread that has already
exited, and is now in the stack cache list.
After iterating C, td_ta_thr_iter finds the stack_cache head, which
because it is not stack_used, td_ta_thr_iter assumes it's just another
thread. After this, unless the reverse race triggers, GDB gets stuck
in td_ta_thr_iter forever walking the stack_cache list, as no thread
in thatlist has a next pointer that points back to stack_used (the
terminating condition).
Before fully understanding the issue, I tried adding cycle detection
to GDB's td_ta_thr_iter callback. However, td_ta_thr_iter skips
calling the callback in some cases, which means that it's possible
that the callback isn't called at all, making it impossible for GDB to
break the loop. I did manage to get GDB stuck in that state more than
once.
Fortunately, we can avoid the issue altogether. We don't really need
td_ta_thr_iter for live debugging nowadays, given PTRACE_EVENT_CLONE.
We already know how to map and lwp id to a thread id without iterating
(thread_from_lwp), so use that more.
gdb/ChangeLog:
2015-02-20 Pedro Alves <palves@redhat.com>
* linux-nat.c (linux_handle_extended_wait): Call
thread_db_notice_clone whenever a new clone LWP is detected.
(linux_stop_and_wait_all_lwps, linux_unstop_all_lwps): New
functions.
* linux-nat.h (thread_db_attach_lwp): Delete declaration.
(thread_db_notice_clone, linux_stop_and_wait_all_lwps)
(linux_unstop_all_lwps): Declare.
* linux-thread-db.c (struct thread_get_info_inout): Delete.
(thread_get_info_callback): Delete.
(thread_from_lwp): Use td_thr_get_info and record_thread.
(thread_db_attach_lwp): Delete.
(thread_db_notice_clone): New function.
(try_thread_db_load_1): If /proc is mounted and shows the
process'es task list, walk over all LWPs and call thread_from_lwp
instead of relying on td_ta_thr_iter.
(attach_thread): Don't call check_thread_signals here. Split the
tail part of the function (which adds the thread to the core GDB
thread list) to ...
(record_thread): ... this function. Call check_thread_signals
here.
(thread_db_wait): Don't call thread_db_find_new_threads_1. Always
call thread_from_lwp.
(thread_db_update_thread_list): Rename to ...
(thread_db_update_thread_list_org): ... this.
(thread_db_update_thread_list): New function.
(thread_db_find_thread_from_tid): Delete.
(thread_db_get_ada_task_ptid): Simplify.
* nat/linux-procfs.c: Include <sys/stat.h>.
(linux_proc_task_list_dir_exists): New function.
* nat/linux-procfs.h (linux_proc_task_list_dir_exists): Declare.
gdb/gdbserver/ChangeLog:
2015-02-20 Pedro Alves <palves@redhat.com>
* thread-db.c: Include "nat/linux-procfs.h".
(thread_db_init): Skip listing new threads if the kernel supports
PTRACE_EVENT_CLONE and /proc/PID/task/ is accessible.
gdb/testsuite/ChangeLog:
2015-02-20 Pedro Alves <palves@redhat.com>
* gdb.threads/multi-create-ns-info-thr.exp: New file.
2015-02-20 20:21:59 +00:00
|
|
|
|
2015-02-20 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* linux-nat.c (linux_handle_extended_wait): Call
|
|
|
|
|
thread_db_notice_clone whenever a new clone LWP is detected.
|
|
|
|
|
(linux_stop_and_wait_all_lwps, linux_unstop_all_lwps): New
|
|
|
|
|
functions.
|
|
|
|
|
* linux-nat.h (thread_db_attach_lwp): Delete declaration.
|
|
|
|
|
(thread_db_notice_clone, linux_stop_and_wait_all_lwps)
|
|
|
|
|
(linux_unstop_all_lwps): Declare.
|
|
|
|
|
* linux-thread-db.c (struct thread_get_info_inout): Delete.
|
|
|
|
|
(thread_get_info_callback): Delete.
|
|
|
|
|
(thread_from_lwp): Use td_thr_get_info and record_thread.
|
|
|
|
|
(thread_db_attach_lwp): Delete.
|
|
|
|
|
(thread_db_notice_clone): New function.
|
|
|
|
|
(try_thread_db_load_1): If /proc is mounted and shows the
|
|
|
|
|
process'es task list, walk over all LWPs and call thread_from_lwp
|
|
|
|
|
instead of relying on td_ta_thr_iter.
|
|
|
|
|
(attach_thread): Don't call check_thread_signals here. Split the
|
|
|
|
|
tail part of the function (which adds the thread to the core GDB
|
|
|
|
|
thread list) to ...
|
|
|
|
|
(record_thread): ... this function. Call check_thread_signals
|
|
|
|
|
here.
|
|
|
|
|
(thread_db_wait): Don't call thread_db_find_new_threads_1. Always
|
|
|
|
|
call thread_from_lwp.
|
|
|
|
|
(thread_db_update_thread_list): Rename to ...
|
|
|
|
|
(thread_db_update_thread_list_org): ... this.
|
|
|
|
|
(thread_db_update_thread_list): New function.
|
|
|
|
|
(thread_db_find_thread_from_tid): Delete.
|
|
|
|
|
(thread_db_get_ada_task_ptid): Simplify.
|
|
|
|
|
* nat/linux-procfs.c: Include <sys/stat.h>.
|
|
|
|
|
(linux_proc_task_list_dir_exists): New function.
|
|
|
|
|
* nat/linux-procfs.h (linux_proc_task_list_dir_exists): Declare.
|
|
|
|
|
|
linux-nat.c: fix a few lin_lwp_attach_lwp issues
This function has a few latent bugs that are triggered by a non-stop
mode test that will be added in a subsequent patch.
First, as described in the function's intro comment, the function is
supposed to return 1 if we're already auto attached to the thread, but
haven't processed the PTRACE_EVENT_CLONE event of its parent thread
yet.
Then, we may find that we're trying to attach to a clone child that
hasn't yet stopped for its initial stop, and therefore 'waitpid(...,
WNOHANG)' returns 0. In that case, we're currently adding the LWP to
the stopped_pids list, which results in linux_handle_extended_wait
skipping the waitpid call on the child, and thus confusing things
later on when the child eventually reports the stop.
Then, the tail end of lin_lwp_attach_lwp always sets the
last_resume_kind of the LWP to resume_stop, which is wrong given that
the user may be doing "info threads" while some threads are running.
And then, the else branch of lin_lwp_attach_lwp always sets the
stopped flag of the LWP. This branch is reached if the LWP is the
main LWP, which may well be running at this point (to it's wrong to
set its 'stopped' flag).
AFAICS, there's no reason anymore for special-casing the main/leader
LWP here:
- For the "attach" case, linux_nat_attach already adds the main LWP to
the lwp list, and sets its 'stopped' flag.
- For the "run" case, after linux_nat_create_inferior, end up in
linux_nat_wait_1 here:
/* The first time we get here after starting a new inferior, we may
not have added it to the LWP list yet - this is the earliest
moment at which we know its PID. */
if (ptid_is_pid (inferior_ptid))
{
/* Upgrade the main thread's ptid. */
thread_change_ptid (inferior_ptid,
ptid_build (ptid_get_pid (inferior_ptid),
ptid_get_pid (inferior_ptid), 0));
lp = add_initial_lwp (inferior_ptid);
lp->resumed = 1;
}
... which adds the LWP to the LWP list already, before
lin_lwp_attach_lwp can ever be reached.
gdb/ChangeLog:
2015-02-20 Pedro Alves <palves@redhat.com>
* linux-nat.c (lin_lwp_attach_lwp): No longer special case the
main LWP. Handle the case of waitpid returning 0 if we're already
attached to the LWP. Don't set the LWP's last_resume_kind to
resume_stop if we already knew about the LWP.
(linux_nat_filter_event): Add debug logs.
2015-02-20 20:21:59 +00:00
|
|
|
|
2015-02-20 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* linux-nat.c (lin_lwp_attach_lwp): No longer special case the
|
|
|
|
|
main LWP. Handle the case of waitpid returning 0 if we're already
|
|
|
|
|
attached to the LWP. Don't set the LWP's last_resume_kind to
|
|
|
|
|
resume_stop if we already knew about the LWP.
|
|
|
|
|
(linux_nat_filter_event): Add debug logs.
|
|
|
|
|
|
2015-02-19 20:48:49 +00:00
|
|
|
|
2015-02-20 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* target.h (forward_target_decr_pc_after_break): Delete
|
|
|
|
|
declaration.
|
|
|
|
|
|
PR18006: internal error if threaded program calls clone(CLONE_VM)
On GNU/Linux, if a pthreaded program has a thread call clone(CLONE_VM)
directly, and then that clone LWP hits a debug event (breakpoint,
etc.) GDB internal errors. Threaded programs shouldn't really be
calling clone directly, but GDB shouldn't crash either.
The crash looks like this:
(gdb) break clone_fn
Breakpoint 2 at 0x4007d8: file clone-thread_db.c, line 35.
(gdb) r
...
[Thread debugging using libthread_db enabled]
...
src/gdb/linux-nat.c:1030: internal-error: lin_lwp_attach_lwp: Assertion `lwpid > 0' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
The problem is that 'clone' ends up clearing the parent thread's tid
field in glibc's thread data structure. For x86_64, the glibc code in
question is here:
sysdeps/unix/sysv/linux/x86_64/clone.S:
...
testq $CLONE_THREAD, %rdi
jne 1f
testq $CLONE_VM, %rdi
movl $-1, %eax <----
jne 2f
movl $SYS_ify(getpid), %eax
syscall
2: movl %eax, %fs:PID
movl %eax, %fs:TID <----
1:
When GDB refreshes the thread list out of libthread_db, it finds a
thread with LWP with pid -1 (the clone's parent), which naturally
isn't yet on the thread list. GDB then tries to attach to that bogus
LWP id, which is caught by that assertion.
The fix is to detect the bad PID early.
Tested on x86-64 Fedora 20. GDBserver doesn't need any fix.
gdb/ChangeLog:
2015-02-20 Pedro Alves <palves@redhat.com>
PR threads/18006
* linux-thread-db.c (thread_get_info_callback): Return early if
the thread's lwp id is -1.
gdb/testsuite/ChangeLog:
2015-02-20 Pedro Alves <palves@redhat.com>
PR threads/18006
* gdb.threads/clone-thread_db.c: New file.
* gdb.threads/clone-thread_db.exp: New file.
2015-02-20 19:00:21 +00:00
|
|
|
|
2015-02-20 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
PR threads/18006
|
|
|
|
|
* linux-thread-db.c (thread_get_info_callback): Return early if
|
|
|
|
|
the thread's lwp id is -1.
|
|
|
|
|
|
2015-02-20 17:20:23 +00:00
|
|
|
|
2015-02-20 Joel Brobecker <brobecker@adacore.com>
|
|
|
|
|
|
|
|
|
|
GDB 7.9 released.
|
|
|
|
|
|
2015-02-19 22:42:37 +00:00
|
|
|
|
2015-02-19 Steve Ellcey <sellcey@imgtec.com>
|
|
|
|
|
|
|
|
|
|
* dtrace-probe.c (dtrace_process_dof_probe): Initialize arg.expr.
|
|
|
|
|
(dtrace_get_probes) Change type of variable 'dof'.
|
|
|
|
|
|
2015-02-12 19:55:08 +00:00
|
|
|
|
2015-02-19 Antoine Tremblay <antoine.tremblay@ericsson.com>
|
|
|
|
|
|
|
|
|
|
PR breakpoints/16812
|
|
|
|
|
* linux-nat.c (linux_nat_filter_event): Report SIGTRAP,SIGILL,SIGSEGV.
|
|
|
|
|
* nat/linux-ptrace.c (linux_wstatus_maybe_breakpoint): Add.
|
|
|
|
|
* nat/linux-ptrace.h: Add linux_wstatus_maybe_breakpoint.
|
|
|
|
|
|
[gdb/ax] small "setv" fix and documentation's adjustment.
gdb/doc/agentexpr.texi documents the "setv" opcode as follow:
@item @code{setv} (0x2d) @var{n}: @result{} @var{v}
Set trace state variable number @var{n} to the value found on the top
of the stack. The stack is unchanged, so that the value is readily
available if the assignment is part of a larger expression. The
handling of @var{n} is as described for @code{getv}.
The @item line is incorrect (and does not match with its
description), so this patch fixes it.
Additionally, in gdb/common/ax.def we find the line:
DEFOP (setv, 2, 0, 0, 1, 0x2d)
From the comment earlier in the file:
Each line is of the form:
DEFOP (name, size, data_size, consumed, produced, opcode)
[...]
CONSUMED is the number of stack elements consumed.
PRODUCED is the number of stack elements produced.
which is saying that nothing is consumed and one item is produced.
Both should be 0 or both should be 1.
This patch sets them both to 1, which seems better since if nothing
is on the stack an error will occur.
gdb/ChangeLog:
* common/ax.def (setv): Fix consumed entry in setv DEFOP.
gdb/doc/ChangeLog:
* agentexpr.texi (Bytecode Descriptions): Fix summary line for setv.
Tested on x86_64-linux.
2015-02-19 14:53:50 +00:00
|
|
|
|
2015-02-19 David Taylor <dtaylor@emc.com>
|
|
|
|
|
|
|
|
|
|
* common/ax.def (setv): Fix consumed entry in setv DEFOP.
|
|
|
|
|
|
2015-02-18 23:50:51 +00:00
|
|
|
|
2015-02-18 Patrick Palka <patrick@parcs.ath.cx>
|
|
|
|
|
|
|
|
|
|
* tui/tui-io.c (tui_handle_resize_during_io): Remove this
|
|
|
|
|
function.
|
|
|
|
|
(tui_putc): Don't call tui_handle_resize_during_io.
|
|
|
|
|
(tui_getc): Likewise.
|
|
|
|
|
(tui_mld_getc): Likewise.
|
|
|
|
|
* tui/tui-win.c: Include event-loop.h and tui/tui-io.h.
|
|
|
|
|
(tui_sigwinch_token): New static variable.
|
|
|
|
|
(tui_initialize_win): Adjust documentation. Set
|
|
|
|
|
tui_sigwinch_token.
|
|
|
|
|
(tui_async_resize_screen): New asynchronous callback.
|
|
|
|
|
(tui_sigwinch_handler): Adjust documentation. Asynchronously
|
|
|
|
|
invoke tui_async_resize_screen.
|
|
|
|
|
|
2015-02-18 12:52:53 +00:00
|
|
|
|
2015-02-18 Jose E. Marchesi <jose.marchesi@oracle.com>
|
|
|
|
|
|
|
|
|
|
* configure: Regenerated.
|
|
|
|
|
* configure.ac: Use GDB_AC_TRANSFORM.
|
|
|
|
|
* Makefile.in (aclocal_m4_deps): Added transform.m4.
|
|
|
|
|
* acinclude.m4: sinclude transform.m4.
|
|
|
|
|
* transform.m4: New file.
|
|
|
|
|
(GDB_AC_TRANSFORM): New macro.
|
|
|
|
|
|
2015-02-17 15:43:48 +00:00
|
|
|
|
2015-02-17 Jose E. Marchesi <jose.marchesi@oracle.com>
|
|
|
|
|
|
|
|
|
|
* NEWS: Announce the support for DTrace SDT probes.
|
|
|
|
|
|
2015-02-17 15:04:01 +00:00
|
|
|
|
2015-02-17 Jose E. Marchesi <jose.marchesi@oracle.com>
|
|
|
|
|
|
|
|
|
|
* amd64-linux-tdep.c: Include "parser-defs.h" and "user-regs.h".
|
|
|
|
|
(amd64_dtrace_parse_probe_argument): New function.
|
|
|
|
|
(amd64_dtrace_probe_is_enabled): Likewise.
|
|
|
|
|
(amd64_dtrace_enable_probe): Likewise.
|
|
|
|
|
(amd64_dtrace_disable_probe): Likewise.
|
|
|
|
|
(amd64_linux_init_abi): Register the
|
|
|
|
|
`gdbarch_dtrace_probe_argument', `gdbarch_dtrace_enable_probe',
|
|
|
|
|
`gdbarch_dtrace_disable_probe' and
|
|
|
|
|
`gdbarch_dtrace_probe_is_enabled' hooks.
|
|
|
|
|
(amd64_dtrace_disabled_probe_sequence_1): New constant.
|
|
|
|
|
(amd64_dtrace_disabled_probe_sequence_2): Likewise.
|
|
|
|
|
(amd64_dtrace_enable_probe_sequence): Likewise.
|
|
|
|
|
(amd64_dtrace_disable_probe_sequence): Likewise.
|
|
|
|
|
|
2015-02-17 15:03:22 +00:00
|
|
|
|
2015-01-17 Jose E. Marchesi <jose.marchesi@oracle.com>
|
|
|
|
|
|
|
|
|
|
* breakpoint.c (BREAK_ARGS_HELP): Help string updated to mention
|
|
|
|
|
the -probe-dtrace new vpossible value for PROBE_MODIFIER.
|
|
|
|
|
* configure.ac (CONFIG_OBS): dtrace-probe.o added if BFD can
|
|
|
|
|
handle ELF files.
|
|
|
|
|
* Makefile.in (SFILES): dtrace-probe.c added.
|
|
|
|
|
* configure: Regenerate.
|
|
|
|
|
* dtrace-probe.c: New file.
|
|
|
|
|
(SHT_SUNW_dof): New constant.
|
|
|
|
|
(dtrace_probe_type): New enum.
|
|
|
|
|
(dtrace_probe_arg): New struct.
|
|
|
|
|
(dtrace_probe_arg_s): New typedef.
|
|
|
|
|
(struct dtrace_probe_enabler): New struct.
|
|
|
|
|
(dtrace_probe_enabler_s): New typedef.
|
|
|
|
|
(dtrace_probe): New struct.
|
|
|
|
|
(dtrace_probe_is_linespec): New function.
|
|
|
|
|
(dtrace_dof_sect_type): New enum.
|
|
|
|
|
(dtrace_dof_dofh_ident): Likewise.
|
|
|
|
|
(dtrace_dof_encoding): Likewise.
|
|
|
|
|
(DTRACE_DOF_ENCODE_LSB): Likewise.
|
|
|
|
|
(DTRACE_DOF_ENCODE_MSB): Likewise.
|
|
|
|
|
(dtrace_dof_hdr): New struct.
|
|
|
|
|
(dtrace_dof_sect): Likewise.
|
|
|
|
|
(dtrace_dof_provider): Likewise.
|
|
|
|
|
(dtrace_dof_probe): Likewise.
|
|
|
|
|
(DOF_UINT): New macro.
|
|
|
|
|
(DTRACE_DOF_PTR): Likewise.
|
|
|
|
|
(DTRACE_DOF_SECT): Likewise.
|
|
|
|
|
(dtrace_process_dof_probe): New function.
|
|
|
|
|
(dtrace_process_dof): Likewise.
|
|
|
|
|
(dtrace_build_arg_exprs): Likewise.
|
|
|
|
|
(dtrace_get_arg): Likewise.
|
|
|
|
|
(dtrace_get_probes): Likewise.
|
|
|
|
|
(dtrace_get_probe_argument_count): Likewise.
|
|
|
|
|
(dtrace_can_evaluate_probe_arguments): Likewise.
|
|
|
|
|
(dtrace_evaluate_probe_argument): Likewise.
|
|
|
|
|
(dtrace_compile_to_ax): Likewise.
|
|
|
|
|
(dtrace_probe_destroy): Likewise.
|
|
|
|
|
(dtrace_gen_info_probes_table_header): Likewise.
|
|
|
|
|
(dtrace_gen_info_probes_table_values): Likewise.
|
|
|
|
|
(dtrace_probe_is_enabled): Likewise.
|
|
|
|
|
(dtrace_probe_ops): New variable.
|
|
|
|
|
(info_probes_dtrace_command): New function.
|
|
|
|
|
(_initialize_dtrace_probe): Likewise.
|
|
|
|
|
(dtrace_type_name): Likewise.
|
|
|
|
|
|
2015-02-17 14:54:44 +00:00
|
|
|
|
2015-02-17 Jose E. Marchesi <jose.marchesi@oracle.com>
|
|
|
|
|
|
|
|
|
|
* gdbarch.sh (dtrace_parse_probe_argument): New.
|
|
|
|
|
(dtrace_probe_is_enabled): Likewise.
|
|
|
|
|
(dtrace_enable_probe): Likewise.
|
|
|
|
|
(dtrace_disable_probe): Likewise.
|
|
|
|
|
* gdbarch.c: Regenerate.
|
|
|
|
|
* gdbarch.h: Regenerate.
|
|
|
|
|
|
2015-02-17 14:51:07 +00:00
|
|
|
|
2015-02-17 Jose E. Marchesi <jose.marchesi@oracle.com>
|
|
|
|
|
|
|
|
|
|
* stap-probe.c (stap_probe_ops): Add NULLs in the static
|
|
|
|
|
stap_probe_ops for `enable_probe' and `disable_probe'.
|
|
|
|
|
* probe.c (enable_probes_command): New function.
|
|
|
|
|
(disable_probes_command): Likewise.
|
|
|
|
|
(_initialize_probe): Define the cli commands `enable probe' and
|
|
|
|
|
`disable probe'.
|
|
|
|
|
(parse_probe_linespec): New function.
|
|
|
|
|
(info_probes_for_ops): Use parse_probe_linespec.
|
|
|
|
|
* probe.h (probe_ops): New hooks `enable_probe' and
|
|
|
|
|
`disable_probe'.
|
|
|
|
|
|
2015-02-17 14:50:19 +00:00
|
|
|
|
2015-02-17 Jose E. Marchesi <jose.marchesi@oracle.com>
|
|
|
|
|
|
|
|
|
|
* probe.c (compute_probe_arg): Moved from stap-probe.c
|
|
|
|
|
(compile_probe_arg): Likewise.
|
|
|
|
|
(probe_funcs): Likewise.
|
|
|
|
|
* stap-probe.c (compute_probe_arg): Moved to probe.c.
|
|
|
|
|
(compile_probe_arg): Likewise.
|
|
|
|
|
(probe_funcs): Likewise.
|
|
|
|
|
|
2015-02-17 14:49:12 +00:00
|
|
|
|
2015-02-17 Jose E. Marchesi <jose.marchesi@oracle.com>
|
|
|
|
|
|
|
|
|
|
* probe.c (print_ui_out_not_applicables): New function.
|
|
|
|
|
(exists_probe_with_pops): Likewise.
|
|
|
|
|
(info_probes_for_ops): Do not include column headers for probe
|
|
|
|
|
types for which no probe has been actually found on any object.
|
|
|
|
|
Also invoke `print_ui_out_not_applicables' in order to match the
|
|
|
|
|
column rows with the header when probes of several types are
|
|
|
|
|
listed.
|
|
|
|
|
Print the "Type" column.
|
|
|
|
|
* probe.h (probe_ops): Added a new probe operation `type_name'.
|
|
|
|
|
* stap-probe.c (stap_probe_ops): Add `stap_type_name'.
|
|
|
|
|
(stap_type_name): New function.
|
|
|
|
|
|
2015-02-17 13:06:10 +00:00
|
|
|
|
2015-02-17 Patrick Palka <patrick@parcs.ath.cx>
|
|
|
|
|
|
|
|
|
|
* tui/tui-io.c (tui_getc): Don't call key_is_command_char.
|
|
|
|
|
(key_is_command_char): Delete.
|
|
|
|
|
|
TUI: resize windows to new terminal size before displaying them
If the user:
#1 - disables the TUI
#2 - resizes the terminal
#3 - and then re-enables the TUI
the next wgetch() returns KEY_RESIZE. This indicates to the ncurses
client that ncurses detected that the terminal has been resized. We
don't handle KEY_RESIZE anywhere, so it gets passed on to readline
which interprets it as a multibyte character, and then the end result
is that the first key press after enabling the TUI is misinterpreted.
We shouldn't really need to handle KEY_RESIZE (and not all ncurses
implementations have that). We have our own SIGWINCH handler, and,
when we re-enable the TUI, we explicitly detect terminal resizes and
resize all windows. The reason ncurses currently does detects a
resize is that something within tui_enable forces a refresh/display of
some window before we get to do the actual resizing. Setting a break
on ncurses' 'resizeterm' function helps find the culprit(s):
(top-gdb) bt
#0 resizeterm (ToLines=28, ToCols=114) at ../../ncurses/base/resizeterm.c:462
#1 0x0000003b42812f3f in _nc_update_screensize (sp=0x2674730) at ../../ncurses/tinfo/lib_setup.c:443
#2 0x0000003b0821cbe0 in doupdate () at ../../ncurses/tty/tty_update.c:726
#3 0x0000003b08215539 in wrefresh (win=0x2a7bc00) at ../../ncurses/base/lib_refresh.c:65
#4 0x00000000005257cb in tui_refresh_win (win_info=0xd73d60 <_locator>) at /home/pedro/gdb/mygit/src/gdb/tui/tui-wingeneral.c:60
#5 0x000000000052265b in tui_show_locator_content () at /home/pedro/gdb/mygit/src/gdb/tui/tui-stack.c:269
#6 0x00000000005273a6 in tui_set_key_mode (mode=TUI_COMMAND_MODE) at /home/pedro/gdb/mygit/src/gdb/tui/tui.c:321
#7 0x00000000005278c7 in tui_enable () at /home/pedro/gdb/mygit/src/gdb/tui/tui.c:494
#8 0x0000000000527011 in tui_rl_switch_mode (notused1=1, notused2=1) at /home/pedro/gdb/mygit/src/gdb/tui/tui.c:108
That is, tui_enable calls tui_set_key_mode before we've resized all
windows, and that refreshes a window as side effect.
And if we're already debugging something (there's a frame), then we'll
instead show a window from within tui_show_frame_info:
(top-gdb) bt
#0 resizeterm (ToLines=28, ToCols=114) at ../../ncurses/base/resizeterm.c:462
#1 0x0000003b42812f3f in _nc_update_screensize (sp=0x202e6c0) at ../../ncurses/tinfo/lib_setup.c:443
#2 0x0000003b0821cbe0 in doupdate () at ../../ncurses/tty/tty_update.c:726
#3 0x0000003b08215539 in wrefresh (win=0x2042890) at ../../ncurses/base/lib_refresh.c:65
#4 0x00000000005257cb in tui_refresh_win (win_info=0xd73d60 <_locator>) at /home/pedro/gdb/mygit/src/gdb/tui/tui-wingeneral.c:60
#5 0x000000000052265b in tui_show_locator_content () at /home/pedro/gdb/mygit/src/gdb/tui/tui-stack.c:269
#6 0x0000000000522931 in tui_show_frame_info (fi=0x16b9cc0) at /home/pedro/gdb/mygit/src/gdb/tui/tui-stack.c:364
#7 0x00000000005278ba in tui_enable () at /home/pedro/gdb/mygit/src/gdb/tui/tui.c:491
#8 0x0000000000527011 in tui_rl_switch_mode (notused1=1, notused2=1) at /home/pedro/gdb/mygit/src/gdb/tui/tui.c:108
The fix is to resize windows earlier.
gdb/ChangeLog:
2015-02-17 Pedro Alves <palves@redhat.com>
* tui/tui.c (tui_enable): Resize windows before anything
might show a window.
2015-02-17 10:05:52 +00:00
|
|
|
|
2015-02-17 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* tui/tui.c (tui_enable): Resize windows before anything
|
|
|
|
|
might show a window.
|
|
|
|
|
|
2015-02-16 16:24:53 +00:00
|
|
|
|
2015-02-17 Max Ostapenko <m.ostapenko@partner.samsung.com>
|
|
|
|
|
|
|
|
|
|
PR gdb/17984
|
|
|
|
|
* aarch64-linux-nat.c: Don't include features/aarch64.c anymore.
|
|
|
|
|
(aarch64_linux_read_description): Remove initialize_tdesc_aarch64
|
|
|
|
|
call.
|
|
|
|
|
* aarch64-tdep.h (tdesc_aarch64): Declare.
|
|
|
|
|
|
2015-02-12 15:51:53 +00:00
|
|
|
|
2015-02-12 Mark Wielaard <mjw@redhat.com>
|
|
|
|
|
|
|
|
|
|
* contrib/ari/gdb_ari.sh: Remove checks for "true" and "false".
|
|
|
|
|
|
2015-02-13 20:03:50 +00:00
|
|
|
|
2015-02-13 Doug Evans <dje@google.com>
|
|
|
|
|
|
|
|
|
|
* cp-namespace.c (cp_basic_lookup_symbol): Rename parameter
|
|
|
|
|
anonymous_namespace to is_in_anonymous for consistency with the rest
|
|
|
|
|
of the file.
|
|
|
|
|
(cp_lookup_bare_symbol): Fix typo in comment.
|
|
|
|
|
(cp_search_static_and_baseclasses): Ditto.
|
|
|
|
|
(search_symbol_list): Use vertical space in comment better.
|
|
|
|
|
(reset_directive_searched): Ditto. Fix typo.
|
|
|
|
|
(cp_lookup_nested_symbol_1): Clarify contents of NESTED_NAME parameter.
|
|
|
|
|
|
2015-02-13 10:23:16 +00:00
|
|
|
|
2015-02-13 Yao Qi <yao.qi@arm.com>
|
|
|
|
|
|
|
|
|
|
* MAINTAINERS: Update my email address.
|
|
|
|
|
|
2015-02-12 21:32:36 +00:00
|
|
|
|
2015-02-12 Doug Evans <dje@google.com>
|
|
|
|
|
|
2015-02-23 21:39:45 +00:00
|
|
|
|
* symtab.c (completion_list_add_name): Fix memory leak.
|
2015-02-12 21:32:36 +00:00
|
|
|
|
|
2015-02-12 20:19:31 +00:00
|
|
|
|
2015-02-12 Doug Evans <dje@google.com>
|
|
|
|
|
|
|
|
|
|
* completer.c (complete_line): Remove incorrect comment.
|
|
|
|
|
|
2015-02-11 13:50:09 +00:00
|
|
|
|
2015-02-11 Jan Kratochvil <jan.kratochvil@redhat.com>
|
|
|
|
|
|
|
|
|
|
* python/py-framefilter.c (py_print_single_arg, enumerate_locals)
|
|
|
|
|
(py_print_frame): Use RETURN_MASK_ERROR.
|
|
|
|
|
|
2015-02-11 13:44:00 +00:00
|
|
|
|
2015-02-11 Jan Kratochvil <jan.kratochvil@redhat.com>
|
|
|
|
|
|
|
|
|
|
* python/py-framefilter.c (py_print_frame): Mention RETURN_QUIT in
|
|
|
|
|
function comment. Wrap all function that can throw in cleanups.
|
|
|
|
|
(gdbpy_apply_frame_filter): Wrap all function that can throw in
|
|
|
|
|
cleanups.
|
|
|
|
|
|
2015-02-11 13:40:14 +00:00
|
|
|
|
2015-02-11 Jan Kratochvil <jan.kratochvil@redhat.com>
|
|
|
|
|
|
|
|
|
|
* python/py-framefilter.c (py_print_frame): Substitute goto error.
|
|
|
|
|
Remove the error label.
|
|
|
|
|
|
2015-02-11 13:37:40 +00:00
|
|
|
|
2015-02-11 Jan Kratochvil <jan.kratochvil@redhat.com>
|
|
|
|
|
|
|
|
|
|
* python/py-framefilter.c (py_print_frame): Put conditional code paths
|
|
|
|
|
with goto first, indent the former else codepath left. Put variable
|
|
|
|
|
'elided' to a new inner block.
|
|
|
|
|
|
2015-02-11 13:33:48 +00:00
|
|
|
|
2015-02-11 Jan Kratochvil <jan.kratochvil@redhat.com>
|
|
|
|
|
|
|
|
|
|
* python/py-framefilter.c (py_print_frame): Whitespacing fixes.
|
|
|
|
|
|
2015-02-10 11:01:21 +00:00
|
|
|
|
2015-02-11 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* xcoffread.c (within_function): Delete.
|
|
|
|
|
|
Fix redefinition errors in C++ mode
In C, we can forward declare static structure instances. That doesn't
work in C++ though. C++ treats these as definitions. So then the
compiler complains about symbol redefinition, like:
src/gdb/elfread.c:1569:29: error: redefinition of ‘const sym_fns elf_sym_fns_lazy_psyms’
src/gdb/elfread.c:53:29: error: ‘const sym_fns elf_sym_fns_lazy_psyms’ previously declared here
The intent of static here is naturally to avoid making these objects
visible outside the compilation unit. The equivalent in C++ would be
to instead define the objects in the anonymous namespace. But given
that it's desirable to leave the codebase compiling as both C and C++
for a while, this just makes the objects extern.
(base_breakpoint_ops is already declared in breakpoint.h, so we can
just remove the forward declare from breakpoint.c)
gdb/ChangeLog:
2015-02-11 Tom Tromey <tromey@redhat.com>
Pedro Alves <palves@redhat.com>
* breakpoint.c (base_breakpoint_ops): Delete.
* dwarf2loc.c (dwarf_expr_ctx_funcs): Make extern.
* elfread.c (elf_sym_fns_gdb_index, elf_sym_fns_lazy_psyms): Make extern.
* guile/guile.c (guile_extension_script_ops, guile_extension_ops): Make extern.
* ppcnbsd-tdep.c (ppcnbsd2_sigtramp): Make extern.
* python/py-arch.c (arch_object_type): Make extern.
* python/py-block.c (block_syms_iterator_object_type): Make extern.
* python/py-bpevent.c (breakpoint_event_object_type): Make extern.
* python/py-cmd.c (cmdpy_object_type): Make extern.
* python/py-continueevent.c (continue_event_object_type)
* python/py-event.h (GDBPY_NEW_EVENT_TYPE): Remove 'qual'
parameter. Update all callers.
* python/py-evtregistry.c (eventregistry_object_type): Make extern.
* python/py-exitedevent.c (exited_event_object_type): Make extern.
* python/py-finishbreakpoint.c (finish_breakpoint_object_type): Make extern.
* python/py-function.c (fnpy_object_type): Make extern.
* python/py-inferior.c (inferior_object_type, membuf_object_type): Make extern.
* python/py-infevents.c (call_pre_event_object_type)
(inferior_call_post_event_object_type).
(memory_changed_event_object_type): Make extern.
* python/py-infthread.c (thread_object_type): Make extern.
* python/py-lazy-string.c (lazy_string_object_type): Make extern.
* python/py-linetable.c (linetable_entry_object_type)
(linetable_object_type, ltpy_iterator_object_type): Make extern.
* python/py-newobjfileevent.c (new_objfile_event_object_type)
(clear_objfiles_event_object_type): Make extern.
* python/py-objfile.c (objfile_object_type): Make extern.
* python/py-param.c (parmpy_object_type): Make extern.
* python/py-progspace.c (pspace_object_type): Make extern.
* python/py-signalevent.c (signal_event_object_type): Make extern.
* python/py-symtab.c (symtab_object_type, sal_object_type): Make extern.
* python/py-type.c (type_object_type, field_object_type)
(type_iterator_object_type): Make extern.
* python/python.c (python_extension_script_ops)
(python_extension_ops): Make extern.
* stap-probe.c (stap_probe_ops): Make extern.
2015-02-11 11:20:21 +00:00
|
|
|
|
2015-02-11 Tom Tromey <tromey@redhat.com>
|
|
|
|
|
Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* breakpoint.c (base_breakpoint_ops): Delete.
|
|
|
|
|
* dwarf2loc.c (dwarf_expr_ctx_funcs): Make extern.
|
|
|
|
|
* elfread.c (elf_sym_fns_gdb_index, elf_sym_fns_lazy_psyms): Make extern.
|
|
|
|
|
* guile/guile.c (guile_extension_script_ops, guile_extension_ops): Make extern.
|
|
|
|
|
* ppcnbsd-tdep.c (ppcnbsd2_sigtramp): Make extern.
|
|
|
|
|
* python/py-arch.c (arch_object_type): Make extern.
|
|
|
|
|
* python/py-block.c (block_syms_iterator_object_type): Make extern.
|
|
|
|
|
* python/py-bpevent.c (breakpoint_event_object_type): Make extern.
|
|
|
|
|
* python/py-cmd.c (cmdpy_object_type): Make extern.
|
|
|
|
|
* python/py-continueevent.c (continue_event_object_type)
|
|
|
|
|
* python/py-event.h (GDBPY_NEW_EVENT_TYPE): Remove 'qual'
|
|
|
|
|
parameter. Update all callers.
|
|
|
|
|
* python/py-evtregistry.c (eventregistry_object_type): Make extern.
|
|
|
|
|
* python/py-exitedevent.c (exited_event_object_type): Make extern.
|
|
|
|
|
* python/py-finishbreakpoint.c (finish_breakpoint_object_type): Make extern.
|
|
|
|
|
* python/py-function.c (fnpy_object_type): Make extern.
|
|
|
|
|
* python/py-inferior.c (inferior_object_type, membuf_object_type): Make extern.
|
|
|
|
|
* python/py-infevents.c (call_pre_event_object_type)
|
|
|
|
|
(inferior_call_post_event_object_type).
|
|
|
|
|
(memory_changed_event_object_type): Make extern.
|
|
|
|
|
* python/py-infthread.c (thread_object_type): Make extern.
|
|
|
|
|
* python/py-lazy-string.c (lazy_string_object_type): Make extern.
|
|
|
|
|
* python/py-linetable.c (linetable_entry_object_type)
|
|
|
|
|
(linetable_object_type, ltpy_iterator_object_type): Make extern.
|
|
|
|
|
* python/py-newobjfileevent.c (new_objfile_event_object_type)
|
|
|
|
|
(clear_objfiles_event_object_type): Make extern.
|
|
|
|
|
* python/py-objfile.c (objfile_object_type): Make extern.
|
|
|
|
|
* python/py-param.c (parmpy_object_type): Make extern.
|
|
|
|
|
* python/py-progspace.c (pspace_object_type): Make extern.
|
|
|
|
|
* python/py-signalevent.c (signal_event_object_type): Make extern.
|
|
|
|
|
* python/py-symtab.c (symtab_object_type, sal_object_type): Make extern.
|
|
|
|
|
* python/py-type.c (type_object_type, field_object_type)
|
|
|
|
|
(type_iterator_object_type): Make extern.
|
|
|
|
|
* python/python.c (python_extension_script_ops)
|
|
|
|
|
(python_extension_ops): Make extern.
|
|
|
|
|
* stap-probe.c (stap_probe_ops): Make extern.
|
|
|
|
|
|
Fix adjust_pc_after_break, remove still current thread check
On decr_pc_after_break targets, GDB adjusts the PC incorrectly if a
background single-step stops somewhere where PC-$decr_pc has a
breakpoint, and the thread that finishes the step is not the current
thread, like:
ADDR1 nop <-- breakpoint here
ADDR2 jmp PC
IOW, say thread A is stepping ADDR2's line in the background (an
infinite loop), and the user switches focus to thread B. GDB's
adjust_pc_after_break logic confuses the single-step stop of thread A
for a hit of the breakpoint at ADDR1, and thus adjusts thread A's PC
to point at ADDR1 when it should not, and reports a breakpoint hit,
when thread A did not execute the instruction at ADDR1 at all.
The test added by this patch exercises exactly that.
I can't find any reason we'd need the "thread to be examined is still
the current thread" condition in adjust_pc_after_break, at least
nowadays; it might have made sense in the past. Best just remove it,
and rely on currently_stepping().
Here's the test's log of a run with an unpatched GDB:
35 while (1);
(gdb) PASS: gdb.threads/step-bg-decr-pc-switch-thread.exp: next over nop
next&
(gdb) PASS: gdb.threads/step-bg-decr-pc-switch-thread.exp: next& over inf loop
thread 1
[Switching to thread 1 (Thread 0x7ffff7fc2740 (LWP 29027))](running)
(gdb)
PASS: gdb.threads/step-bg-decr-pc-switch-thread.exp: switch to main thread
Breakpoint 2, thread_function (arg=0x0) at ...src/gdb/testsuite/gdb.threads/step-bg-decr-pc-switch-thread.c:34
34 NOP; /* set breakpoint here */
FAIL: gdb.threads/step-bg-decr-pc-switch-thread.exp: no output while stepping
gdb/ChangeLog:
2015-02-11 Pedro Alves <pedro@codesourcery.com>
* infrun.c (adjust_pc_after_break): Don't adjust the PC just
because the event thread is not the current thread.
gdb/testsuite/ChangeLog:
2015-02-11 Pedro Alves <pedro@codesourcery.com>
* gdb.threads/step-bg-decr-pc-switch-thread.c: New file.
* gdb.threads/step-bg-decr-pc-switch-thread.exp: New file.
2015-02-11 09:45:41 +00:00
|
|
|
|
2015-02-11 Pedro Alves <pedro@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* infrun.c (adjust_pc_after_break): Don't adjust the PC just
|
|
|
|
|
because the event thread is not the current thread.
|
|
|
|
|
|
2015-02-11 05:18:59 +00:00
|
|
|
|
2015-02-11 Doug Evans <xdje42@gmail.com>
|
|
|
|
|
|
|
|
|
|
* gdbtypes.c (internal_type_self_type): If TYPE_SPECIFIC_FIELD hasn't
|
|
|
|
|
been initialized yet, return NULL.
|
|
|
|
|
|
2015-02-11 01:01:37 +00:00
|
|
|
|
2015-02-11 Doug Evans <dje@google.com>
|
|
|
|
|
|
|
|
|
|
* symfile.h (new_symfile_objfile): Delete.
|
|
|
|
|
* symfile.c (finish_new_objfile): Renamed from new_symfile_objfile.
|
|
|
|
|
All callers updated.
|
|
|
|
|
|
2015-02-10 23:45:10 +00:00
|
|
|
|
2015-02-11 Patrick Palka <patrick@parcs.ath.cx>
|
|
|
|
|
|
|
|
|
|
* tui/tui-io.c (tui_handle_resize_during_io): Call
|
|
|
|
|
tui_update_gdb_sizes() after resizing the screen.
|
|
|
|
|
* tui/tui.c (tui_enable): Resize the terminal before
|
|
|
|
|
calling tui_update_gdb_sizes().
|
|
|
|
|
|
2015-02-10 23:44:56 +00:00
|
|
|
|
2015-02-11 Patrick Palka <patrick@parcs.ath.cx>
|
|
|
|
|
|
|
|
|
|
* tui/tui-io.c (tui_getc): Move cursor to the end of the command
|
|
|
|
|
line before printing a newline.
|
|
|
|
|
|
2015-02-10 23:45:31 +00:00
|
|
|
|
2015-02-11 Mark Wielaard <mjw@redhat.com>
|
|
|
|
|
|
|
|
|
|
* utils.c (producer_is_gcc): Return true or false.
|
|
|
|
|
|
2015-02-10 23:44:56 +00:00
|
|
|
|
2015-02-10 Mark Wielaard <mjw@redhat.com>
|
2015-02-04 17:14:33 +00:00
|
|
|
|
|
|
|
|
|
* utils.h (producer_is_gcc): Change return type to bool. Add major
|
|
|
|
|
argument.
|
|
|
|
|
* utils.c (producer_is_gcc): Likewise.
|
|
|
|
|
(producer_is_gcc_ge_4): Adjust producer_is_gcc call.
|
|
|
|
|
* dwarf2read.c (check_producer): Likewise.
|
|
|
|
|
|
2015-02-10 19:13:31 +00:00
|
|
|
|
2015-02-10 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* infrun.c (displaced_step_fixup): Switch to the event thread
|
|
|
|
|
before calling gdbarch_displaced_step_fixup.
|
|
|
|
|
|
2015-02-10 18:29:36 +00:00
|
|
|
|
2015-02-10 Antoine Tremblay <antoine.tremblay@ericsson.com>
|
|
|
|
|
|
|
|
|
|
* MAINTAINERS (Write After Approval): Add Antoine Tremblay.
|
|
|
|
|
|
2015-02-10 15:46:12 +00:00
|
|
|
|
2015-02-10 Simon Marchi <simon.marchi@ericsson.com>
|
|
|
|
|
|
|
|
|
|
* ada-varobj.c (ada_name_of_child): Constify parent.
|
|
|
|
|
(ada_path_expr_of_child): Same.
|
|
|
|
|
(ada_value_of_child): Same.
|
|
|
|
|
(ada_type_of_child): Same.
|
|
|
|
|
* c-varobj.c (c_is_path_expr_parent): Same.
|
|
|
|
|
(c_describe_child): Same.
|
|
|
|
|
(c_name_of_child): Same.
|
|
|
|
|
(c_value_of_child): Same.
|
|
|
|
|
(c_type_of_child): Same.
|
|
|
|
|
(cplus_number_of_children): Same.
|
|
|
|
|
(cplus_describe_child): Constify var.
|
|
|
|
|
(cplus_name_of_child): Constify parent.
|
|
|
|
|
(cplus_value_of_child): Same.
|
|
|
|
|
(cplus_type_of_child): Same.
|
|
|
|
|
* jv-varobj.c (java_name_of_child): Same.
|
|
|
|
|
(java_value_of_child): Same.
|
|
|
|
|
(java_type_of_child): Same.
|
|
|
|
|
* varobj.c (value_of_child): Same.
|
|
|
|
|
(varobj_default_is_path_expr_parent): Constify var, parent and return
|
|
|
|
|
value.
|
|
|
|
|
(varobj_get_path_expr): Constify var, modify path_expr through
|
|
|
|
|
mutable_var.
|
|
|
|
|
(install_new_value): Constify parent.
|
|
|
|
|
(value_of_child): Constify parent.
|
|
|
|
|
* varobj.h (struct varobj): Constify parent.
|
|
|
|
|
(struct lang_varobj_ops): Constify name_of_child, value_of_child and
|
|
|
|
|
type_of_child.
|
|
|
|
|
(varobj_get_path_expr): Constify var.
|
|
|
|
|
(varobj_get_path_expr_parent): Constify var and return value.
|
|
|
|
|
|
2015-02-10 11:46:11 +00:00
|
|
|
|
2015-02-10 Luis Machado <lgustavo@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* arm-tdep.c (arm_prologue_unwind_stop_reason): New function.
|
|
|
|
|
(arm_prologue_this_id): Move PC and SP limit checks to
|
|
|
|
|
arm_prologue_unwind_stop_reason.
|
|
|
|
|
(arm_prologue_unwind) <stop_reason> : Set to
|
|
|
|
|
arm_prologue_unwind_stop_reason.
|
|
|
|
|
|
2015-02-09 22:14:38 +00:00
|
|
|
|
2015-02-09 Mark Wielaard <mjw@redhat.com>
|
|
|
|
|
|
|
|
|
|
* dwarf2read.c (set_cu_language): Recognize DW_LANG_Fortran03 and
|
|
|
|
|
DW_LANG_Fortran08 as language_fortran.
|
|
|
|
|
|
2015-02-09 23:58:12 +00:00
|
|
|
|
2015-02-09 Sergio Durigan Junior <sergiodj@redhat.com>
|
|
|
|
|
|
|
|
|
|
PR remote/17946
|
|
|
|
|
* gdb/remote.c (remote_parse_stop_reply): Fix wrong comparison
|
|
|
|
|
of pointer against char.
|
|
|
|
|
|
2015-02-09 13:58:25 +00:00
|
|
|
|
2015-02-09 Mark Wielaard <mjw@redhat.com>
|
|
|
|
|
|
|
|
|
|
* c-typeprint.c (cp_type_print_method_args): Handle '_Atomic'.
|
|
|
|
|
(c_type_print_modifier): Likewise.
|
|
|
|
|
* dwarf2read.c (read_tag_atomic_type): New function.
|
|
|
|
|
(read_type_die_1): Handle DW_TAG_atomic_type.
|
|
|
|
|
* gdbtypes.c (make_atomic_type): New function.
|
|
|
|
|
(recursive_dump_type): Handle TYPE_ATOMIC.
|
|
|
|
|
* gdbtypes.h (enum type_flag_values): Renumber.
|
|
|
|
|
(enum type_instance_flag_value): Add TYPE_INSTANCE_FLAG_ATOMIC.
|
|
|
|
|
(TYPE_ATOMIC): New macro.
|
|
|
|
|
(make_atomic_type): Declare.
|
|
|
|
|
|
record-btrace: indicate gaps
Indicate gaps in the trace due to decode errors. Internally, a gap is
represented as a btrace function segment without instructions and with a
non-zero format-specific error code.
Show the gap when traversing the instruction or function call history.
Also indicate gaps in "info record".
It looks like this:
(gdb) info record
Active record target: record-btrace
Recording format: Branch Trace Store.
Buffer size: 64KB.
Recorded 32 instructions in 5 functions (1 gaps) for thread 1 (process 7182).
(gdb) record function-call-history /cli
1 fib inst 1,9 at src/fib.c:9,14
2 fib inst 10,20 at src/fib.c:6,14
3 [decode error (1): instruction overflow]
4 fib inst 21,28 at src/fib.c:11,14
5 fib inst 29,33 at src/fib.c:6,9
(gdb) record instruction-history 20,22
20 0x000000000040062f <fib+47>: sub $0x1,%rax
[decode error (1): instruction overflow]
21 0x0000000000400613 <fib+19>: add $0x1,%rax
22 0x0000000000400617 <fib+23>: mov %rax,0x200a3a(%rip)
(gdb)
Gaps are ignored during reverse execution and replay.
2015-02-09 Markus Metzger <markus.t.metzger@intel.com>
* btrace.c (ftrace_find_call): Skip gaps.
(ftrace_new_function): Initialize level.
(ftrace_new_call, ftrace_new_tailcall, ftrace_new_return)
(ftrace_new_switch): Update
level computation.
(ftrace_new_gap): New.
(ftrace_update_function): Create new function after gap.
(btrace_compute_ftrace_bts): Create gap on error.
(btrace_stitch_bts): Update parameters. Clear trace if it
becomes empty.
(btrace_stitch_trace): Update parameters. Update callers.
(btrace_clear): Reset the number of gaps.
(btrace_insn_get): Return NULL if the iterator points to a gap.
(btrace_insn_number): Return zero if the iterator points to a gap.
(btrace_insn_end): Allow gaps at the end.
(btrace_insn_next, btrace_insn_prev, btrace_insn_cmp): Handle gaps.
(btrace_find_insn_by_number): Assert that the found iterator does
not point to a gap.
(btrace_call_next, btrace_call_prev): Assert that the last function
is not a gap.
* btrace.h (btrace_bts_error): New.
(btrace_function): Update comment.
(btrace_function) <insn, insn_offset, number>: Update comment.
(btrace_function) <errcode>: New.
(btrace_thread_info) <ngaps>: New.
(btrace_thread_info) <replay>: Update comment.
(btrace_insn_get): Update comment.
* record-btrace.c (btrace_ui_out_decode_error): New.
(record_btrace_info): Print number of gaps.
(btrace_insn_history, btrace_call_history): Call
btrace_ui_out_decode_error for gaps.
(record_btrace_step_thread, record_btrace_start_replaying): Skip gaps.
testsuite/
* gdb.btrace/buffer-size.exp: Update "info record" output.
* gdb.btrace/delta.exp: Update "info record" output.
* gdb.btrace/enable.exp: Update "info record" output.
* gdb.btrace/finish.exp: Update "info record" output.
* gdb.btrace/instruction_history.exp: Update "info record" output.
* gdb.btrace/next.exp: Update "info record" output.
* gdb.btrace/nexti.exp: Update "info record" output.
* gdb.btrace/step.exp: Update "info record" output.
* gdb.btrace/stepi.exp: Update "info record" output.
* gdb.btrace/nohist.exp: Update "info record" output.
2014-01-30 08:51:10 +00:00
|
|
|
|
2015-02-09 Markus Metzger <markus.t.metzger@intel.com>
|
|
|
|
|
|
|
|
|
|
* btrace.c (ftrace_find_call): Skip gaps.
|
|
|
|
|
(ftrace_new_function): Initialize level.
|
|
|
|
|
(ftrace_new_call, ftrace_new_tailcall, ftrace_new_return)
|
|
|
|
|
(ftrace_new_switch): Update
|
|
|
|
|
level computation.
|
|
|
|
|
(ftrace_new_gap): New.
|
|
|
|
|
(ftrace_update_function): Create new function after gap.
|
|
|
|
|
(btrace_compute_ftrace_bts): Create gap on error.
|
|
|
|
|
(btrace_stitch_bts): Update parameters. Clear trace if it
|
|
|
|
|
becomes empty.
|
|
|
|
|
(btrace_stitch_trace): Update parameters. Update callers.
|
|
|
|
|
(btrace_clear): Reset the number of gaps.
|
|
|
|
|
(btrace_insn_get): Return NULL if the iterator points to a gap.
|
|
|
|
|
(btrace_insn_number): Return zero if the iterator points to a gap.
|
|
|
|
|
(btrace_insn_end): Allow gaps at the end.
|
|
|
|
|
(btrace_insn_next, btrace_insn_prev, btrace_insn_cmp): Handle gaps.
|
|
|
|
|
(btrace_find_insn_by_number): Assert that the found iterator does
|
|
|
|
|
not point to a gap.
|
|
|
|
|
(btrace_call_next, btrace_call_prev): Assert that the last function
|
|
|
|
|
is not a gap.
|
|
|
|
|
* btrace.h (btrace_bts_error): New.
|
|
|
|
|
(btrace_function): Update comment.
|
|
|
|
|
(btrace_function) <insn, insn_offset, number>: Update comment.
|
|
|
|
|
(btrace_function) <errcode>: New.
|
|
|
|
|
(btrace_thread_info) <ngaps>: New.
|
|
|
|
|
(btrace_thread_info) <replay>: Update comment.
|
|
|
|
|
(btrace_insn_get): Update comment.
|
|
|
|
|
* record-btrace.c (btrace_ui_out_decode_error): New.
|
|
|
|
|
(record_btrace_info): Print number of gaps.
|
|
|
|
|
(btrace_insn_history, btrace_call_history): Call
|
|
|
|
|
btrace_ui_out_decode_error for gaps.
|
|
|
|
|
(record_btrace_step_thread, record_btrace_start_replaying): Skip gaps.
|
|
|
|
|
|
2014-02-14 08:25:40 +00:00
|
|
|
|
2015-02-09 Markus Metzger <markus.t.metzger@intel.com>
|
|
|
|
|
|
|
|
|
|
* common/btrace-common.h (btrace_cpu_vendor, btrace_cpu): New.
|
|
|
|
|
* nat/linux-btrace.c: (btrace_this_cpu): New.
|
|
|
|
|
(cpu_supports_bts): Call btrace_this_cpu.
|
|
|
|
|
(intel_supports_bts): Add cpu parameter.
|
|
|
|
|
|
2014-01-29 11:56:09 +00:00
|
|
|
|
2015-02-09 Markus Metzger <markus.t.metzger@intel.com>
|
|
|
|
|
|
|
|
|
|
* btrace.h (btrace_insn_class): New.
|
|
|
|
|
(btrace_insn) <size, iclass>: New.
|
|
|
|
|
* btrace.c (ftrace_find_call): Update parameters. Update users.
|
|
|
|
|
Use instruction classification.
|
|
|
|
|
(ftrace_new_return): Update parameters. Update users.
|
|
|
|
|
(ftrace_update_function): Update parameters. Update users. Use
|
|
|
|
|
instruction classification.
|
|
|
|
|
(ftrace_update_insns): Update parameters. Update users.
|
|
|
|
|
(ftrace_classify_insn): New.
|
|
|
|
|
(btrace_compute_ftrace_bts): Fill in new btrace_insn fields. Add
|
|
|
|
|
TRY_CATCH around call to gdb_insn_length.
|
|
|
|
|
|
2014-01-29 10:12:06 +00:00
|
|
|
|
2015-02-09 Markus Metzger <markus.t.metzger@intel.com>
|
|
|
|
|
|
|
|
|
|
* btrace.c (btrace_compute_ftrace_bts, btrace_compute_ftrace):
|
|
|
|
|
Update parameters. Update users.
|
|
|
|
|
|
2013-11-28 15:39:12 +00:00
|
|
|
|
2015-02-09 Markus Metzger <markus.t.metzger@intel.com>
|
|
|
|
|
|
|
|
|
|
* btrace.c (parse_xml_btrace_conf_bts): Add size.
|
|
|
|
|
(btrace_conf_bts_attributes): New.
|
|
|
|
|
(btrace_conf_children): Add attributes.
|
|
|
|
|
* common/btrace-common.h (btrace_config_bts): New.
|
|
|
|
|
(btrace_config)<bts>: New.
|
|
|
|
|
(btrace_config): Update comment.
|
|
|
|
|
* nat/linux-btrace.c (linux_enable_btrace, linux_enable_bts):
|
|
|
|
|
Use config.
|
|
|
|
|
* features/btrace-conf.dtd: Increment version. Add size
|
|
|
|
|
attribute to bts element.
|
|
|
|
|
* record-btrace.c (set_record_btrace_bts_cmdlist,
|
|
|
|
|
show_record_btrace_bts_cmdlist): New.
|
|
|
|
|
(record_btrace_adjust_size, record_btrace_print_bts_conf,
|
|
|
|
|
record_btrace_print_conf, cmd_set_record_btrace_bts,
|
|
|
|
|
cmd_show_record_btrace_bts): New.
|
|
|
|
|
(record_btrace_info): Call record_btrace_print_conf.
|
|
|
|
|
(_initialize_record_btrace): Add commands.
|
|
|
|
|
* remote.c: Add PACKET_Qbtrace_conf_bts_size enum.
|
|
|
|
|
(remote_protocol_features): Add Qbtrace-conf:bts:size packet.
|
|
|
|
|
(btrace_sync_conf): Synchronize bts size.
|
|
|
|
|
(_initialize_remote): Add Qbtrace-conf:bts:size packet.
|
|
|
|
|
* NEWS: Announce new commands and new packets.
|
|
|
|
|
|
2013-11-28 14:44:13 +00:00
|
|
|
|
2015-02-09 Markus Metzger <markus.t.metzger@intel.com>
|
|
|
|
|
|
|
|
|
|
* Makefile.in (XMLFILES): Add btrace-conf.dtd.
|
|
|
|
|
* x86-linux-nat.c (x86_linux_enable_btrace): Update parameters.
|
|
|
|
|
(x86_linux_btrace_conf): New.
|
|
|
|
|
(x86_linux_create_target): Initialize to_btrace_conf.
|
|
|
|
|
* nat/linux-btrace.c (linux_enable_btrace): Update parameters.
|
|
|
|
|
Check format. Split into this and ...
|
|
|
|
|
(linux_enable_bts): ... this.
|
|
|
|
|
(linux_btrace_conf): New.
|
|
|
|
|
(perf_event_skip_record): Renamed into ...
|
|
|
|
|
(perf_event_skip_bts_record): ... this. Updated users.
|
|
|
|
|
(linux_disable_btrace): Split into this and ...
|
|
|
|
|
(linux_disable_bts): ... this.
|
|
|
|
|
(linux_read_btrace): Check format.
|
|
|
|
|
* nat/linux-btrace.h (linux_enable_btrace): Update parameters.
|
|
|
|
|
(linux_btrace_conf): New.
|
|
|
|
|
(btrace_target_info)<ptid>: Moved.
|
|
|
|
|
(btrace_target_info)<conf>: New.
|
|
|
|
|
(btrace_target_info): Split into this and ...
|
|
|
|
|
(btrace_tinfo_bts): ... this. Updated users.
|
|
|
|
|
* btrace.c (btrace_enable): Update parameters.
|
|
|
|
|
(btrace_conf, parse_xml_btrace_conf_bts, parse_xml_btrace_conf)
|
|
|
|
|
(btrace_conf_children, btrace_conf_attributes)
|
|
|
|
|
(btrace_conf_elements): New.
|
|
|
|
|
* btrace.h (btrace_enable): Update parameters.
|
|
|
|
|
(btrace_conf, parse_xml_btrace_conf): New.
|
|
|
|
|
* common/btrace-common.h (btrace_config): New.
|
|
|
|
|
* feature/btrace-conf.dtd: New.
|
|
|
|
|
* record-btrace.c (record_btrace_conf): New.
|
|
|
|
|
(record_btrace_cmdlist): New.
|
|
|
|
|
(record_btrace_enable_warn, record_btrace_open): Pass
|
|
|
|
|
&record_btrace_conf.
|
|
|
|
|
(record_btrace_info): Print recording format.
|
|
|
|
|
(cmd_record_btrace_bts_start): New.
|
|
|
|
|
(cmd_record_btrace_start): Call cmd_record_btrace_bts_start.
|
|
|
|
|
(_initialize_record_btrace): Add "record btrace bts" subcommand.
|
|
|
|
|
Add "record bts" alias command.
|
|
|
|
|
* remote.c (remote_state)<btrace_config>: New.
|
|
|
|
|
(remote_btrace_reset, PACKET_qXfer_btrace_conf): New.
|
|
|
|
|
(remote_protocol_features): Add qXfer:btrace-conf:read.
|
|
|
|
|
(remote_open_1): Call remote_btrace_reset.
|
|
|
|
|
(remote_xfer_partial): Handle TARGET_OBJECT_BTRACE_CONF.
|
|
|
|
|
(btrace_target_info)<conf>: New.
|
|
|
|
|
(btrace_sync_conf, btrace_read_config): New.
|
|
|
|
|
(remote_enable_btrace): Update parameters. Call btrace_sync_conf and
|
|
|
|
|
btrace_read_conf.
|
|
|
|
|
(remote_btrace_conf): New.
|
|
|
|
|
(init_remote_ops): Initialize to_btrace_conf.
|
|
|
|
|
(_initialize_remote): Add qXfer:btrace-conf packet.
|
|
|
|
|
* target.c (target_enable_btrace): Update parameters.
|
|
|
|
|
(target_btrace_conf): New.
|
|
|
|
|
* target.h (target_enable_btrace): Update parameters.
|
|
|
|
|
(target_btrace_conf): New.
|
|
|
|
|
(target_object)<TARGET_OBJECT_BTRACE_CONF>: New.
|
|
|
|
|
(target_ops)<to_enable_btrace>: Update parameters and comment.
|
|
|
|
|
(target_ops)<to_btrace_conf>: New.
|
|
|
|
|
* target-delegates: Regenerate.
|
|
|
|
|
* target-debug.h (target_debug_print_const_struct_btrace_config_p)
|
|
|
|
|
(target_debug_print_const_struct_btrace_target_info_p): New.
|
|
|
|
|
* NEWS: Announce new command and new packet.
|
|
|
|
|
|
2014-01-17 13:40:02 +00:00
|
|
|
|
2015-02-09 Markus Metzger <markus.t.metzger@intel.com>
|
|
|
|
|
|
|
|
|
|
* nat/linux-btrace.h (perf_event_buffer): New.
|
|
|
|
|
(btrace_target_info) <buffer, size, data_head>: Replace with ...
|
|
|
|
|
<bts>: ... this.
|
|
|
|
|
* nat/linux-btrace.c (perf_event_header, perf_event_mmap_size)
|
|
|
|
|
(perf_event_buffer_size, perf_event_buffer_begin)
|
|
|
|
|
(perf_event_buffer_end, linux_btrace_has_changed): Removed.
|
|
|
|
|
Updated users.
|
|
|
|
|
(perf_event_new_data): New.
|
|
|
|
|
|
2014-01-17 12:29:19 +00:00
|
|
|
|
2015-02-09 Markus Metzger <markus.t.metzger@intel.com>
|
|
|
|
|
|
|
|
|
|
* btrace.c (btrace_enable): Pass BTRACE_FORMAT_BTS.
|
|
|
|
|
* record-btrace.c (record_btrace_open): Remove call to
|
|
|
|
|
target_supports_btrace.
|
|
|
|
|
* remote.c (remote_supports_btrace): Update parameters.
|
|
|
|
|
* target.c (target_supports_btrace): Update parameters.
|
|
|
|
|
* target.h (to_supports_btrace, target_supports_btrace): Update
|
|
|
|
|
parameters.
|
|
|
|
|
* target-delegates.c: Regenerate.
|
|
|
|
|
* target-debug.h (target_debug_print_enum_btrace_format): New.
|
|
|
|
|
* nat/linux-btrace.c
|
|
|
|
|
(kernel_supports_btrace): Rename into ...
|
|
|
|
|
(kernel_supports_bts): ... this. Update users. Update warning text.
|
|
|
|
|
(intel_supports_btrace): Rename into ...
|
|
|
|
|
(intel_supports_bts): ... this. Update users.
|
|
|
|
|
(cpu_supports_btrace): Rename into ...
|
|
|
|
|
(cpu_supports_bts): ... this. Update users.
|
|
|
|
|
(linux_supports_btrace): Update parameters. Split into this and ...
|
|
|
|
|
(linux_supports_bts): ... this.
|
|
|
|
|
* nat/linux-btrace.h (linux_supports_btrace): Update parameters.
|
|
|
|
|
|
2013-11-13 14:31:07 +00:00
|
|
|
|
2015-02-09 Markus Metzger <markus.t.metzger@intel.com>
|
|
|
|
|
|
|
|
|
|
* Makefile.in (SFILES): Add common/btrace-common.c.
|
|
|
|
|
(COMMON_OBS): Add common/btrace-common.o.
|
|
|
|
|
(btrace-common.o): Add build rules.
|
|
|
|
|
* btrace.c (parse_xml_btrace): Update parameters.
|
|
|
|
|
(parse_xml_btrace_block): Set format field.
|
|
|
|
|
(btrace_add_pc, btrace_fetch): Use struct btrace_data.
|
|
|
|
|
(do_btrace_data_cleanup, make_cleanup_btrace_data): New.
|
|
|
|
|
(btrace_compute_ftrace): Split into this and...
|
|
|
|
|
(btrace_compute_ftrace_bts): ...this.
|
|
|
|
|
(btrace_stitch_trace): Split into this and...
|
|
|
|
|
(btrace_stitch_bts): ...this.
|
|
|
|
|
* btrace.h (parse_xml_btrace): Update parameters.
|
|
|
|
|
(make_cleanup_btrace_data): New.
|
|
|
|
|
* common/btrace-common.c: New.
|
|
|
|
|
* common/btrace-common.h: Include common-defs.h.
|
|
|
|
|
(btrace_block_s): Update comment.
|
|
|
|
|
(btrace_format): New.
|
|
|
|
|
(btrace_format_string): New.
|
|
|
|
|
(btrace_data_bts): New.
|
|
|
|
|
(btrace_data): New.
|
|
|
|
|
(btrace_data_init, btrace_data_fini, btrace_data_empty): New.
|
|
|
|
|
* remote.c (remote_read_btrace): Update parameters.
|
|
|
|
|
* target.c (target_read_btrace): Update parameters.
|
|
|
|
|
* target.h (target_read_btrace): Update parameters.
|
|
|
|
|
(target_ops)<to_read_btrace>: Update parameters.
|
|
|
|
|
* x86-linux-nat.c (x86_linux_read_btrace): Update parameters.
|
|
|
|
|
* target-delegates.c: Regenerate.
|
|
|
|
|
* target-debug (target_debug_print_struct_btrace_data_p): New.
|
|
|
|
|
* nat/linux-btrace.c (linux_read_btrace): Split into this and...
|
|
|
|
|
(linux_read_bts): ...this.
|
|
|
|
|
* nat/linux-btrace.h (linux_read_btrace): Update parameters.
|
|
|
|
|
|
2015-02-06 20:17:21 +00:00
|
|
|
|
2015-02-06 Doug Evans <dje@google.com>
|
|
|
|
|
|
|
|
|
|
* remote-m32r-sdi.c: Include symfile.h.
|
|
|
|
|
|
2015-02-06 19:32:01 +00:00
|
|
|
|
2015-02-06 Doug Evans <dje@google.com>
|
|
|
|
|
|
|
|
|
|
* symtab.h (clear_symtab_users, deduce_language_from_filename): Move
|
|
|
|
|
* symfile.h (clear_symtab_users, deduce_language_from_filename): ...
|
|
|
|
|
to here.
|
|
|
|
|
|
2015-01-26 17:52:25 +00:00
|
|
|
|
2015-02-06 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* linux-thread-db.c (find_new_threads_callback): Add debug output.
|
|
|
|
|
|
2015-02-02 19:57:31 +00:00
|
|
|
|
2015-02-06 Simon Marchi <simon.marchi@ericsson.com>
|
|
|
|
|
|
|
|
|
|
PR gdb/15678
|
|
|
|
|
* breakpoint.c (map_breakpoint_numbers): Check for empty args string.
|
|
|
|
|
(enable_count_command): Check args for NULL value.
|
|
|
|
|
|
2015-02-06 07:31:05 +00:00
|
|
|
|
2015-02-05 Doug Evans <xdje42@gmail.com>
|
|
|
|
|
|
|
|
|
|
* guile/scm-frame.c: Fix spelling errors in a comment.
|
|
|
|
|
|
2015-02-04 19:31:17 +00:00
|
|
|
|
2015-02-04 Jan Kratochvil <jan.kratochvil@redhat.com>
|
|
|
|
|
|
|
|
|
|
* python/python-internal.h (Py_hash_t): Define it for Python <3.2.
|
|
|
|
|
* python/py-value.c (valpy_fetch_lazy): Use it. Remove cast to the
|
|
|
|
|
return type.
|
|
|
|
|
|
2015-02-04 18:13:28 +00:00
|
|
|
|
2015-02-04 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* linux-nat.c (handle_extended_wait): Don't resume LWPs here.
|
|
|
|
|
(wait_lwp): Don't call wait_lwp if linux_handle_extended_wait
|
|
|
|
|
returns true.
|
|
|
|
|
(resume_stopped_resumed_lwps): Don't check whether the thread is
|
|
|
|
|
marked as executing.
|
|
|
|
|
(linux_nat_wait_1): Use resume_stopped_resumed_lwps.
|
|
|
|
|
|
2015-01-15 10:20:45 +00:00
|
|
|
|
2015-02-04 Andreas Arnez <arnez@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
* regset.h (struct regset): Add flags field.
|
|
|
|
|
(REGSET_VARIABLE_SIZE): New value for a regset's flags field.
|
|
|
|
|
* corelow.c (get_core_register_section): Add warning if the size
|
|
|
|
|
exceeds the requested size and the regset does not have the
|
|
|
|
|
REGSET_VARIABLE_SIZE flag set.
|
|
|
|
|
* alphanbsd-tdep.c (alphanbsd_gregset): Add REGSET_VARIABLE_SIZE
|
|
|
|
|
flag.
|
|
|
|
|
* armbsd-tdep.c (armbsd_gregset): Likewise.
|
|
|
|
|
* hppa-hpux-tdep.c (hppa_hpux_regset): Likewise.
|
|
|
|
|
* hppaobsd-tdep.c (hppaobsd_gregset): Likewise.
|
|
|
|
|
* m68kbsd-tdep.c (m68kbsd_gregset): Likewise.
|
|
|
|
|
* mipsnbsd-tdep.c (mipsnbsd_gregset): Likewise.
|
|
|
|
|
|
2015-01-14 17:53:23 +00:00
|
|
|
|
2015-02-04 Andreas Arnez <arnez@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
* amd64-linux-tdep.c (amd64_linux_iterate_over_regset_sections):
|
|
|
|
|
For ".reg-xstate", explicitly specify the requested section size
|
|
|
|
|
via X86_XSTATE_SIZE instead of just 0 on input and
|
|
|
|
|
X86_XSTATE_MAX_SIZE on output.
|
|
|
|
|
* i386-linux-tdep.c (i386_linux_iterate_over_regset_sections):
|
|
|
|
|
Likewise.
|
|
|
|
|
|
2015-01-14 12:01:38 +00:00
|
|
|
|
2015-02-04 Andreas Arnez <arnez@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
PR corefiles/17808:
|
|
|
|
|
* gdbarch.sh (iterate_over_regset_sections_cb): Document this
|
|
|
|
|
function type, particularly its SIZE parameter.
|
|
|
|
|
* gdbarch.h: Regenerate.
|
|
|
|
|
* amd64-tdep.c (amd64_supply_fpregset): In gdb_assert, compare
|
|
|
|
|
actual against required size using ">=" instead of "==".
|
|
|
|
|
(amd64_collect_fpregset): Likewise.
|
|
|
|
|
* i386-tdep.c (i386_supply_gregset): Likewise.
|
|
|
|
|
(i386_collect_gregset): Likewise.
|
|
|
|
|
(i386_supply_fpregset): Likewise.
|
|
|
|
|
(i386_collect_fpregset): Likewise.
|
|
|
|
|
* mips-linux-tdep.c (mips_supply_gregset_wrapper): Likewise.
|
|
|
|
|
(mips_fill_gregset_wrapper): Likewise.
|
|
|
|
|
(mips_supply_fpregset_wrapper): Likewise.
|
|
|
|
|
(mips_fill_fpregset_wrapper): Likewise.
|
|
|
|
|
(mips64_supply_gregset_wrapper): Likewise.
|
|
|
|
|
(mips64_fill_gregset_wrapper): Likewise.
|
|
|
|
|
(mips64_supply_fpregset_wrapper): Likewise.
|
|
|
|
|
(mips64_fill_fpregset_wrapper): Likewise.
|
|
|
|
|
* mn10300-linux-tdep.c (am33_supply_gregset_method): Likewise.
|
|
|
|
|
(am33_supply_fpregset_method): Likewise.
|
|
|
|
|
(am33_collect_gregset_method): Likewise.
|
|
|
|
|
(am33_collect_fpregset_method): Likewise.
|
|
|
|
|
|
2015-02-04 11:27:28 +00:00
|
|
|
|
2015-02-04 Doug Evans <dje@google.com>
|
|
|
|
|
Pedro Alves <palves@redhat.com>
|
|
|
|
|
Eli Zaretskii <eliz@gnu.org>
|
|
|
|
|
|
|
|
|
|
PR tui/17810
|
|
|
|
|
* tui/tui-command.c (tui_refresh_cmd_win): New function.
|
|
|
|
|
* tui/tui-command.c (tui_refresh_cmd_win): Declare.
|
|
|
|
|
* tui/tui-file.c: #include tui/tui-command.h.
|
|
|
|
|
(tui_file_fputs): Refresh command window if stream is not gdb_stdout.
|
|
|
|
|
(tui_file_flush): Refresh command window if stream is gdb_stdout.
|
|
|
|
|
* tui/tui-io.c (tui_puts): Remove calls to wrefresh, fflush.
|
|
|
|
|
|
2015-02-04 10:05:58 +00:00
|
|
|
|
2015-02-04 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
Fix build breakage.
|
|
|
|
|
* event-loop.c (gdb_do_one_event): Add default switch case.
|
|
|
|
|
|
2015-02-03 17:17:02 +00:00
|
|
|
|
2015-02-03 Jan Kratochvil <jan.kratochvil@redhat.com>
|
|
|
|
|
|
|
|
|
|
Filter out inferior gcc option -fpreprocessed.
|
|
|
|
|
* compile/compile.c (filter_args): New function.
|
|
|
|
|
(get_args): Use it.
|
|
|
|
|
|
Simplify event-loop core, remove two-step event processing
Even with the previous patch installed, we'll still see
sigall-reverse.exp occasionally fail. The problem is that the event
loop's event handling processing is done in two steps:
#1 - poll all event sources, and push new event objects to the event
queue, until all event sources are drained.
#2 - go through the event queue, processing each event object at a
time. For each event, call the associated callback, and deletes the
event object from the queue.
and then bad things happen if between #1 and #2 something decides that
events from an event source that has already queued events shouldn't
be processed yet. To do that, we either remove the event source from
the list of event sources, or clear its "have events" flag. However,
if an event for that source has meanwhile already been pushed in the
event queue, #2 will still process it and call the associated
callback...
One way to fix it that I considered was to do something to the event
objects already in the event queue when an event source is no longer
interesting. But then I couldn't find any good reason for the
two-step process in the first place. It's much simpler (and less
code) to call the event source callbacks as we poll the sources and
find events.
Tested on x86-64 Fedora 20, native and gdbserver.
gdb/
2015-02-03 Pedro Alves <palves@redhat.com>
* event-loop.c: Don't declare nor define a queue type for
gdb_event_p.
(event_queue): Delete.
(create_event, create_file_event, gdb_event_xfree)
(initialize_event_loop, process_event): Delete.
(gdb_do_one_event): Return as soon as one event is handled.
(handle_file_event): Change prototype. Used the passed in
file_handler pointer and ready_mask instead of looping over all
file handlers.
(gdb_wait_for_event): Update the poll/select timeouts before
blocking. Run event handlers directly instead of queueing events.
Return as soon as one event is handled.
(struct async_event_handler_data): Delete.
(invoke_async_event_handler): Delete.
(check_async_event_handlers): Change return type to int. Run
event handlers directly instead of queueing events. Return as
soon as one event is handled.
(handle_timer_event): Delete.
(update_wait_timeout): New function, factored out from
poll_timers.
(poll_timers): Reimplement.
* event-loop.h (initialize_event_loop): Delete declaration.
* top.c (gdb_init): Don't call initialize_event_loop.
2015-02-03 15:07:54 +00:00
|
|
|
|
2015-02-03 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* event-loop.c: Don't declare nor define a queue type for
|
|
|
|
|
gdb_event_p.
|
|
|
|
|
(event_queue): Delete.
|
|
|
|
|
(create_event, create_file_event, gdb_event_xfree)
|
|
|
|
|
(initialize_event_loop, process_event): Delete.
|
|
|
|
|
(gdb_do_one_event): Return as soon as one event is handled.
|
|
|
|
|
(handle_file_event): Change prototype. Used the passed in
|
|
|
|
|
file_handler pointer and ready_mask instead of looping over all
|
|
|
|
|
file handlers.
|
|
|
|
|
(gdb_wait_for_event): Update the poll/select timeouts before
|
|
|
|
|
blocking. Run event handlers directly instead of queueing events.
|
|
|
|
|
Return as soon as one event is handled.
|
|
|
|
|
(struct async_event_handler_data): Delete.
|
|
|
|
|
(invoke_async_event_handler): Delete.
|
|
|
|
|
(check_async_event_handlers): Change return type to int. Run
|
|
|
|
|
event handlers directly instead of queueing events. Return as
|
|
|
|
|
soon as one event is handled.
|
|
|
|
|
(handle_timer_event): Delete.
|
|
|
|
|
(update_wait_timeout): New function, factored out from
|
|
|
|
|
poll_timers.
|
|
|
|
|
(poll_timers): Reimplement.
|
|
|
|
|
* event-loop.h (initialize_event_loop): Delete declaration.
|
|
|
|
|
* top.c (gdb_init): Don't call initialize_event_loop.
|
|
|
|
|
|
When disabling target async, remove all target event sources from the event loop
The sigall-reverse.exp test occasionally fails with something like this:
(gdb) PASS: gdb.reverse/sigall-reverse.exp: send signal TERM
continue
Continuing.
The next instruction is syscall exit_group. It will make the program exit. Do you want to stop the program?([y] or n) FAIL: gdb.reverse/sigall-reverse.exp: continue to signal exit (timeout)
FAIL: gdb.reverse/sigall-reverse.exp: reverse to handler of TERM (timeout)
FAIL: gdb.reverse/sigall-reverse.exp: reverse to gen_TERM (timeout)
This is another event-loop/async related problem exposed by the patch
that made 'query' use gdb_readline_wrapper (588dcc3edbde19f9).
The problem is that even though gdb_readline_wrapper disables
target-async while the secondary prompt is in progress, the record
target's async event source is left marked. So when
gdb_readline_wrapper nests an event loop to process input, it may
happen that that event loop ends up processing a target event while
GDB is not really ready for it. Here's the relevant part of the
backtrace showing the root issue in action:
...
#14 0x000000000061cb48 in fetch_inferior_event (client_data=0x0) at src/gdb/infrun.c:4158
#15 0x0000000000642917 in inferior_event_handler (event_type=INF_REG_EVENT, client_data=0x0) at src/gdb/inf-loop.c:57
#16 0x000000000077ca5c in record_full_async_inferior_event_handler (data=0x0) at src/gdb/record-full.c:791
#17 0x0000000000640fdf in invoke_async_event_handler (data=...) at src/gdb/event-loop.c:1067
#18 0x000000000063fb01 in process_event () at src/gdb/event-loop.c:339
#19 0x000000000063fb2a in gdb_do_one_event () at src/gdb/event-loop.c:360
#20 0x000000000074d607 in gdb_readline_wrapper (prompt=0x3588f40 "The next instruction is syscall exit_group. It will make the program exit. Do you want to stop the program?([y] or n) ") at src/gdb/top.c:842
#21 0x0000000000750bd9 in defaulted_query (ctlstr=0x8c6588 "The next instruction is syscall exit_group. It will make the program exit. Do you want to stop the program?", defchar=121 'y', args=0x7fff70524410) at src/gdb/utils.c:1279
#22 0x0000000000750e4c in yquery (ctlstr=0x8c6588 "The next instruction is syscall exit_group. It will make the program exit. Do you want to stop the program?") at src/gdb/utils.c:1358
#23 0x00000000004b020e in record_linux_system_call (syscall=gdb_sys_exit_group, regcache=0x3529450, tdep=0xd6c840 <amd64_linux_record_tdep>) at src/gdb/linux-record.c:1933
With my all-stop-on-top-of-non-stop series, I'm also seeing
gdb.server/ext-attach.exp fail occasionally due to the same issue.
The first part of the fix is for target_async implementations to make
sure to remove/unmark all target-related event sources from the event
loop.
Tested on x86_64 Fedora 20, native and gdbserver.
gdb/
2015-02-03 Pedro Alves <palves@redhat.com>
* event-loop.c (clear_async_event_handler): New function.
* event-loop.h (clear_async_event_handler): New declaration.
* record-btrace.c (record_btrace_async): New function.
(init_record_btrace_ops): Install record_btrace_async.
* record-full.c (record_full_async): New function.
(record_full_resume): Don't mark the async event source here.
(init_record_full_ops): Install record_full_async.
(record_full_core_resume): Don't mark the async event source here.
(init_record_full_core_ops): Install record_full_async.
* remote.c (remote_async): Mark and clear the async stop reply
queue event-loop token as appropriate.
2015-02-03 15:07:54 +00:00
|
|
|
|
2015-02-03 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* event-loop.c (clear_async_event_handler): New function.
|
|
|
|
|
* event-loop.h (clear_async_event_handler): New declaration.
|
|
|
|
|
* record-btrace.c (record_btrace_async): New function.
|
|
|
|
|
(init_record_btrace_ops): Install record_btrace_async.
|
|
|
|
|
* record-full.c (record_full_async): New function.
|
|
|
|
|
(record_full_resume): Don't mark the async event source here.
|
|
|
|
|
(init_record_full_ops): Install record_full_async.
|
|
|
|
|
(record_full_core_resume): Don't mark the async event source here.
|
|
|
|
|
(init_record_full_core_ops): Install record_full_async.
|
|
|
|
|
* remote.c (remote_async): Mark and clear the async stop reply
|
|
|
|
|
queue event-loop token as appropriate.
|
|
|
|
|
|
2015-02-03 15:07:53 +00:00
|
|
|
|
2015-02-03 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* linux-nat.c (linux_child_follow_fork, linux_nat_wait_1): Use
|
|
|
|
|
target_is_async_p instead of target_can_async.
|
|
|
|
|
(linux_nat_wait): Use target_is_async_p instead of
|
|
|
|
|
target_can_async. Don't enable async here.
|
|
|
|
|
* remote.c (interrupt_query, remote_wait, putpkt_binary): Use
|
|
|
|
|
target_is_async_p instead of target_can_async.
|
|
|
|
|
|
2015-02-02 18:17:08 +00:00
|
|
|
|
2015-02-02 Simon Marchi <simon.marchi@ericsson.com>
|
|
|
|
|
|
|
|
|
|
* varobj.h (lang_varobj_ops): Mention which return values need
|
|
|
|
|
to be freed.
|
|
|
|
|
|
2015-02-02 03:54:02 +00:00
|
|
|
|
2015-02-02 Joel Brobecker <brobecker@adacore.com>
|
|
|
|
|
|
|
|
|
|
* dwarf2loc.c (dwarf2_evaluate_property): Add i18n marker.
|
|
|
|
|
|
2015-02-02 03:28:12 +00:00
|
|
|
|
2015-02-02 Joel Brobecker <brobecker@adacore.com>
|
|
|
|
|
|
|
|
|
|
PR gdb/17856:
|
|
|
|
|
* ada-lang.c (ada_lookup_symbol_list_worker): Do not re-cache
|
|
|
|
|
results found in the cache.
|
|
|
|
|
|
2015-02-02 03:20:58 +00:00
|
|
|
|
2015-02-02 Joel Brobecker <brobecker@adacore.com>
|
|
|
|
|
|
|
|
|
|
PR gdb/17854:
|
|
|
|
|
* ada-lang.c (ada_get_symbol_cache): Set pspace_data->sym_cache
|
|
|
|
|
when allocating a new one.
|
|
|
|
|
|
2015-02-01 18:59:27 +00:00
|
|
|
|
2015-02-01 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* MAINTAINERS: Remove myself.
|
|
|
|
|
|
Move vptr_{fieldno,basetype} out of main_type, and update everything accordingly.
Every type has to pay the price in memory usage for their presence.
The proper place for them is in the type_specific field which exists
for this purpose.
gdb/ChangeLog:
* dwarf2read.c (process_structure_scope): Update setting of
TYPE_VPTR_BASETYPE, TYPE_VPTR_FIELDNO.
* gdbtypes.c (internal_type_vptr_fieldno): New function.
(set_type_vptr_fieldno): New function.
(internal_type_vptr_basetype): New function.
(set_type_vptr_basetype): New function.
(get_vptr_fieldno): Update setting of TYPE_VPTR_FIELDNO,
TYPE_VPTR_BASETYPE.
(allocate_cplus_struct_type): Initialize vptr_fieldno.
(recursive_dump_type): Printing of vptr_fieldno, vptr_basetype ...
(print_cplus_stuff): ... moved here.
(copy_type_recursive): Don't copy TYPE_VPTR_BASETYPE.
* gdbtypes.h (struct main_type): Members vptr_fieldno, vptr_basetype
moved to ...
(struct cplus_struct_type): ... here. All uses updated.
(TYPE_VPTR_FIELDNO, TYPE_VPTR_BASETYPE): Rewrite.
(internal_type_vptr_fieldno, set_type_vptr_fieldno): Declare.
(internal_type_vptr_basetype, set_type_vptr_basetype): Declare.
* stabsread.c (read_tilde_fields): Update setting of
TYPE_VPTR_FIELDNO, TYPE_VPTR_BASETYPE.
gdb/testsuite/ChangeLog:
* gdb.base/maint.exp <maint print type argc>: Update expected output.
2015-02-01 05:40:57 +00:00
|
|
|
|
2015-01-31 Doug Evans <xdje42@gmail.com>
|
|
|
|
|
|
|
|
|
|
* dwarf2read.c (process_structure_scope): Update setting of
|
|
|
|
|
TYPE_VPTR_BASETYPE, TYPE_VPTR_FIELDNO.
|
|
|
|
|
* gdbtypes.c (internal_type_vptr_fieldno): New function.
|
|
|
|
|
(set_type_vptr_fieldno): New function.
|
|
|
|
|
(internal_type_vptr_basetype): New function.
|
|
|
|
|
(set_type_vptr_basetype): New function.
|
|
|
|
|
(get_vptr_fieldno): Update setting of TYPE_VPTR_FIELDNO,
|
|
|
|
|
TYPE_VPTR_BASETYPE.
|
|
|
|
|
(allocate_cplus_struct_type): Initialize vptr_fieldno.
|
|
|
|
|
(recursive_dump_type): Printing of vptr_fieldno, vptr_basetype ...
|
|
|
|
|
(print_cplus_stuff): ... moved here.
|
|
|
|
|
(copy_type_recursive): Don't copy TYPE_VPTR_BASETYPE.
|
|
|
|
|
* gdbtypes.h (struct main_type): Members vptr_fieldno, vptr_basetype
|
|
|
|
|
moved to ...
|
|
|
|
|
(struct cplus_struct_type): ... here. All uses updated.
|
|
|
|
|
(TYPE_VPTR_FIELDNO, TYPE_VPTR_BASETYPE): Rewrite.
|
|
|
|
|
(internal_type_vptr_fieldno, set_type_vptr_fieldno): Declare.
|
|
|
|
|
(internal_type_vptr_basetype, set_type_vptr_basetype): Declare.
|
|
|
|
|
* stabsread.c (read_tilde_fields): Update setting of
|
|
|
|
|
TYPE_VPTR_FIELDNO, TYPE_VPTR_BASETYPE.
|
|
|
|
|
|
Move TYPE_SELF_TYPE into new field type_specific.
This patch moves TYPE_SELF_TYPE into new field type_specific.self_type
for MEMBERPTR,METHODPTR types, and into type_specific.func_stuff
for METHODs, and then updates everything to use that.
TYPE_CODE_METHOD could share some things with TYPE_CODE_FUNC
(e.g. TYPE_NO_RETURN) and it seemed simplest to keep them together.
Moving TYPE_SELF_TYPE into type_specific.func_stuff for TYPE_CODE_METHOD
is also nice because when we allocate space for function types we assume
they're TYPE_CODE_FUNCs. If TYPE_CODE_METHODs don't need or use that
space then that space would be wasted, and cleaning that up would involve
more invasive changes.
In order to catch errant uses I've added accessor functions
that do some checking.
One can no longer assign to TYPE_SELF_TYPE like this:
TYPE_SELF_TYPE (foo) = bar;
One instead has to do:
set_type_self_type (foo, bar);
But I've left reading of the type to the macro:
bar = TYPE_SELF_TYPE (foo);
In order to discourage bypassing the TYPE_SELF_TYPE macro
I've named the underlying function that implements it
internal_type_self_type.
While testing this I found the stabs reader leaving methods
as TYPE_CODE_FUNCs, hitting my newly added asserts.
Since the dwarf reader smashes functions to methods (via
smash_to_method) I've done a similar thing for stabs.
gdb/ChangeLog:
* cp-valprint.c (cp_find_class_member): Rename parameter domain_p
to self_p.
(cp_print_class_member): Rename local domain to self_type.
* dwarf2read.c (quirk_gcc_member_function_pointer): Rename local
domain_type to self_type.
(set_die_type) <need_gnat_info>: Handle
TYPE_CODE_METHODPTR, TYPE_CODE_MEMBERPTR, TYPE_CODE_METHOD.
* gdb-gdb.py (StructMainTypePrettyPrinter): Handle
TYPE_SPECIFIC_SELF_TYPE.
* gdbtypes.c (internal_type_self_type): New function.
(set_type_self_type): New function.
(smash_to_memberptr_type): Rename parameter domain to self_type.
Update setting of TYPE_SELF_TYPE.
(smash_to_methodptr_type): Update setting of TYPE_SELF_TYPE.
(smash_to_method_type): Rename parameter domain to self_type.
Update setting of TYPE_SELF_TYPE.
(check_stub_method): Call smash_to_method_type.
(recursive_dump_type): Handle TYPE_SPECIFIC_SELF_TYPE.
(copy_type_recursive): Ditto.
* gdbtypes.h (enum type_specific_kind): New value
TYPE_SPECIFIC_SELF_TYPE.
(struct main_type) <type_specific>: New member self_type.
(struct cplus_struct_type) <fn_field.type>: Update comment.
(TYPE_SELF_TYPE): Rewrite.
(internal_type_self_type, set_type_self_type): Declare.
* gnu-v3-abi.c (gnuv3_print_method_ptr): Rename local domain to
self_type.
(gnuv3_method_ptr_to_value): Rename local domain_type to self_type.
* m2-typeprint.c (m2_range): Replace TYPE_SELF_TYPE with
TYPE_TARGET_TYPE.
* stabsread.c (read_member_functions): Mark methods with
TYPE_CODE_METHOD, not TYPE_CODE_FUNC. Update setting of
TYPE_SELF_TYPE.
2015-02-01 05:21:01 +00:00
|
|
|
|
2015-01-31 Doug Evans <xdje42@gmail.com>
|
|
|
|
|
|
|
|
|
|
* cp-valprint.c (cp_find_class_member): Rename parameter domain_p
|
|
|
|
|
to self_p.
|
|
|
|
|
(cp_print_class_member): Rename local domain to self_type.
|
|
|
|
|
* dwarf2read.c (quirk_gcc_member_function_pointer): Rename local
|
|
|
|
|
domain_type to self_type.
|
|
|
|
|
(set_die_type) <need_gnat_info>: Handle
|
|
|
|
|
TYPE_CODE_METHODPTR, TYPE_CODE_MEMBERPTR, TYPE_CODE_METHOD.
|
|
|
|
|
* gdb-gdb.py (StructMainTypePrettyPrinter): Handle
|
|
|
|
|
TYPE_SPECIFIC_SELF_TYPE.
|
|
|
|
|
* gdbtypes.c (internal_type_self_type): New function.
|
|
|
|
|
(set_type_self_type): New function.
|
|
|
|
|
(smash_to_memberptr_type): Rename parameter domain to self_type.
|
|
|
|
|
Update setting of TYPE_SELF_TYPE.
|
|
|
|
|
(smash_to_methodptr_type): Update setting of TYPE_SELF_TYPE.
|
|
|
|
|
(smash_to_method_type): Rename parameter domain to self_type.
|
|
|
|
|
Update setting of TYPE_SELF_TYPE.
|
|
|
|
|
(check_stub_method): Call smash_to_method_type.
|
|
|
|
|
(recursive_dump_type): Handle TYPE_SPECIFIC_SELF_TYPE.
|
|
|
|
|
(copy_type_recursive): Ditto.
|
|
|
|
|
* gdbtypes.h (enum type_specific_kind): New value
|
|
|
|
|
TYPE_SPECIFIC_SELF_TYPE.
|
|
|
|
|
(struct main_type) <type_specific>: New member self_type.
|
|
|
|
|
(struct cplus_struct_type) <fn_field.type>: Update comment.
|
|
|
|
|
(TYPE_SELF_TYPE): Rewrite.
|
|
|
|
|
(internal_type_self_type, set_type_self_type): Declare.
|
|
|
|
|
* gnu-v3-abi.c (gnuv3_print_method_ptr): Rename local domain to
|
|
|
|
|
self_type.
|
|
|
|
|
(gnuv3_method_ptr_to_value): Rename local domain_type to self_type.
|
|
|
|
|
* m2-typeprint.c (m2_range): Replace TYPE_SELF_TYPE with
|
|
|
|
|
TYPE_TARGET_TYPE.
|
|
|
|
|
* stabsread.c (read_member_functions): Mark methods with
|
|
|
|
|
TYPE_CODE_METHOD, not TYPE_CODE_FUNC. Update setting of
|
|
|
|
|
TYPE_SELF_TYPE.
|
|
|
|
|
|
2015-02-01 05:17:05 +00:00
|
|
|
|
2015-01-31 Doug Evans <xdje42@gmail.com>
|
|
|
|
|
|
|
|
|
|
* gdbtypes.h (TYPE_SELF_TYPE): Renamed from TYPE_DOMAIN_TYPE.
|
|
|
|
|
All uses updated.
|
|
|
|
|
|
2015-02-01 05:14:17 +00:00
|
|
|
|
2015-01-31 Doug Evans <xdje42@gmail.com>
|
|
|
|
|
|
|
|
|
|
* gnu-v3-abi.c (gnuv3_dynamic_class): Assert only passed structs
|
|
|
|
|
or unions. Return zero if union.
|
|
|
|
|
(gnuv3_get_vtable): Call check_typedef. Assert only passed structs.
|
|
|
|
|
(gnuv3_rtti_type): Pass already-check_typedef'd value to
|
|
|
|
|
gnuv3_get_vtable.
|
|
|
|
|
(compute_vtable_size): Assert only passed structs.
|
|
|
|
|
(gnuv3_print_vtable): Don't call gnuv3_get_vtable for non-structs.
|
|
|
|
|
|
2015-02-01 05:13:02 +00:00
|
|
|
|
2015-01-31 Doug Evans <xdje42@gmail.com>
|
|
|
|
|
|
|
|
|
|
* gdbtypes.c (copy_type_recursive): Handle all TYPE_SPECIFIC_FIELD
|
|
|
|
|
kinds.
|
|
|
|
|
|
2015-01-31 23:24:26 +00:00
|
|
|
|
2015-01-31 Gary Benson <gbenson@redhat.com>
|
|
|
|
|
Doug Evans <dje@google.com>
|
|
|
|
|
|
|
|
|
|
PR cli/9007
|
|
|
|
|
PR cli/11920
|
|
|
|
|
PR cli/15548
|
|
|
|
|
* cli/cli-cmds.c (complete_command): Notify user if max-completions
|
|
|
|
|
reached.
|
|
|
|
|
* common/common-exceptions.h (enum errors)
|
|
|
|
|
<MAX_COMPLETIONS_REACHED_ERROR>: New value.
|
|
|
|
|
* completer.h (get_max_completions_reached_message): New declaration.
|
|
|
|
|
(max_completions): Likewise.
|
|
|
|
|
(completion_tracker_t): New typedef.
|
|
|
|
|
(new_completion_tracker): New declaration.
|
|
|
|
|
(make_cleanup_free_completion_tracker): Likewise.
|
|
|
|
|
(maybe_add_completion_enum): New enum.
|
|
|
|
|
(maybe_add_completion): New declaration.
|
|
|
|
|
(throw_max_completions_reached_error): Likewise.
|
|
|
|
|
* completer.c (max_completions): New global variable.
|
|
|
|
|
(new_completion_tracker): New function.
|
|
|
|
|
(free_completion_tracker): Likewise.
|
|
|
|
|
(make_cleanup_free_completion_tracker): Likewise.
|
|
|
|
|
(maybe_add_completions): Likewise.
|
|
|
|
|
(throw_max_completions_reached_error): Likewise.
|
|
|
|
|
(complete_line): Remove duplicates and limit result to max_completions
|
|
|
|
|
entries.
|
|
|
|
|
(get_max_completions_reached_message): New function.
|
|
|
|
|
(gdb_display_match_list): Handle max_completions.
|
|
|
|
|
(_initialize_completer): New declaration and function.
|
|
|
|
|
* symtab.c: Include completer.h.
|
|
|
|
|
(completion_tracker): New static variable.
|
|
|
|
|
(completion_list_add_name): Call maybe_add_completion.
|
|
|
|
|
(default_make_symbol_completion_list_break_on_1): Renamed from
|
|
|
|
|
default_make_symbol_completion_list_break_on. Maintain
|
|
|
|
|
completion_tracker across calls to completion_list_add_name.
|
|
|
|
|
(default_make_symbol_completion_list_break_on): New function.
|
|
|
|
|
* top.c (init_main): Set rl_completion_display_matches_hook.
|
|
|
|
|
* tui/tui-io.c: Include completer.h.
|
|
|
|
|
(tui_old_rl_display_matches_hook): New static global.
|
|
|
|
|
(tui_rl_display_match_list): Notify user if max-completions reached.
|
|
|
|
|
(tui_setup_io): Save/restore rl_completion_display_matches_hook.
|
|
|
|
|
* NEWS (New Options): Mention set/show max-completions.
|
|
|
|
|
|
2015-01-31 22:48:29 +00:00
|
|
|
|
2015-01-31 Gary Benson <gbenson@redhat.com>
|
|
|
|
|
|
|
|
|
|
* symtab.c (struct add_name_data) <code>: New field.
|
|
|
|
|
Updated comments.
|
|
|
|
|
(add_symtab_completions): New function.
|
|
|
|
|
(symtab_expansion_callback): Likewise.
|
|
|
|
|
(default_make_symbol_completion_list_break_on): Set datum.code.
|
|
|
|
|
Move minimal symbol scan before calling expand_symtabs_matching.
|
|
|
|
|
Scan known primary symtabs for externs and statics before calling
|
|
|
|
|
expand_symtabs_matching. Pass symtab_expansion_callback as
|
|
|
|
|
expansion_notify argument to expand_symtabs_matching. Do not scan
|
|
|
|
|
primary symtabs for externs and statics after calling
|
|
|
|
|
expand_symtabs_matching.
|
|
|
|
|
|
2015-01-31 22:45:26 +00:00
|
|
|
|
2015-01-31 Gary Benson <gbenson@redhat.com>
|
|
|
|
|
|
|
|
|
|
* symfile.h (expand_symtabs_exp_notify_ftype): New typedef.
|
|
|
|
|
(struct quick_symbol_functions) <expand_symtabs_matching>:
|
|
|
|
|
New argument expansion_notify. All uses updated.
|
|
|
|
|
(expand_symtabs_matching): New argument expansion_notify.
|
|
|
|
|
All uses updated.
|
|
|
|
|
* symfile-debug.c (debug_qf_expand_symtabs_matching):
|
|
|
|
|
Also print expansion notify.
|
|
|
|
|
* symtab.c (expand_symtabs_matching_via_partial): Call
|
|
|
|
|
expansion_notify whenever a partial symbol table is expanded.
|
|
|
|
|
* dwarf2read.c (dw2_expand_symtabs_matching): Call
|
|
|
|
|
expansion_notify whenever a symbol table is instantiated.
|
|
|
|
|
|
Unify CLI/TUI interface to readline tab completion.
This copies a lot of code from readline, but this is temporary.
Readline currently doesn't export what we need.
The plan is to have something that has been working for awhile,
and then we'll have a complete story to present to the readline
maintainers.
gdb/ChangeLog:
* cli-out.c: #include completer.h, readline/readline.h.
(cli_mld_crlf, cli_mld_putch, cli_mld_puts): New functions.
(cli_mld_flush, cld_mld_erase_entire_line): Ditto.
(cli_mld_beep, cli_mld_read_key, cli_display_match_list): Ditto.
* cli-out.h (cli_display_match_list): Declare.
* completer.c (MB_INVALIDCH, MB_NULLWCH): New macros.
(ELLIPSIS_LEN): Ditto.
(gdb_get_y_or_n, gdb_display_match_list_pager): New functions.
(gdb_path_isdir, gdb_printable_part, gdb_fnwidth): Ditto.
(gdb_fnprint, gdb_print_filename): Ditto.
(gdb_complete_get_screenwidth, gdb_display_match_list_1): Ditto.
(gdb_display_match_list): Ditto.
* completer.h (mld_crlf_ftype, mld_putch_ftype): New typedefs.
(mld_puts_ftype, mld_flush_ftype, mld_erase_entire_line_ftype): Ditto.
(mld_beep_ftype, mld_read_key_ftype): Ditto.
(match_list_displayer): New struct.
(gdb_display_match_list): Declare.
* top.c (init_main): Set rl_completion_display_matches_hook.
* tui/tui-io.c: #include completer.h.
(printable_part, PUTX, print_filename, get_y_or_n): Delete.
(tui_mld_crlf, tui_mld_putch, tui_mld_puts): New functions.
(tui_mld_flush, tui_mld_erase_entire_line, tui_mld_beep): Ditto.
(tui_mld_getc, tui_mld_read_key): Ditto.
(tui_rl_display_match_list): Rewrite.
(tui_handle_resize_during_io): New arg for_completion. All callers
updated.
2015-01-31 22:11:54 +00:00
|
|
|
|
2015-01-31 Doug Evans <xdje42@gmail.com>
|
|
|
|
|
|
|
|
|
|
* cli-out.c: #include completer.h, readline/readline.h.
|
|
|
|
|
(cli_mld_crlf, cli_mld_putch, cli_mld_puts): New functions.
|
|
|
|
|
(cli_mld_flush, cld_mld_erase_entire_line): Ditto.
|
|
|
|
|
(cli_mld_beep, cli_mld_read_key, cli_display_match_list): Ditto.
|
|
|
|
|
* cli-out.h (cli_display_match_list): Declare.
|
|
|
|
|
* completer.c (MB_INVALIDCH, MB_NULLWCH): New macros.
|
|
|
|
|
(ELLIPSIS_LEN): Ditto.
|
|
|
|
|
(gdb_get_y_or_n, gdb_display_match_list_pager): New functions.
|
|
|
|
|
(gdb_path_isdir, gdb_printable_part, gdb_fnwidth): Ditto.
|
|
|
|
|
(gdb_fnprint, gdb_print_filename): Ditto.
|
|
|
|
|
(gdb_complete_get_screenwidth, gdb_display_match_list_1): Ditto.
|
|
|
|
|
(gdb_display_match_list): Ditto.
|
|
|
|
|
* completer.h (mld_crlf_ftype, mld_putch_ftype): New typedefs.
|
|
|
|
|
(mld_puts_ftype, mld_flush_ftype, mld_erase_entire_line_ftype): Ditto.
|
|
|
|
|
(mld_beep_ftype, mld_read_key_ftype): Ditto.
|
|
|
|
|
(match_list_displayer): New struct.
|
|
|
|
|
(gdb_display_match_list): Declare.
|
|
|
|
|
* top.c (init_main): Set rl_completion_display_matches_hook.
|
|
|
|
|
* tui/tui-io.c: #include completer.h.
|
|
|
|
|
(printable_part, PUTX, print_filename, get_y_or_n): Delete.
|
|
|
|
|
(tui_mld_crlf, tui_mld_putch, tui_mld_puts): New functions.
|
|
|
|
|
(tui_mld_flush, tui_mld_erase_entire_line, tui_mld_beep): Ditto.
|
|
|
|
|
(tui_mld_getc, tui_mld_read_key): Ditto.
|
|
|
|
|
(tui_rl_display_match_list): Rewrite.
|
|
|
|
|
(tui_handle_resize_during_io): New arg for_completion. All callers
|
|
|
|
|
updated.
|
|
|
|
|
|
Add symbol lookup cache.
gdb/ChangeLog:
Add symbol lookup cache.
* NEWS: Document new options and commands.
* symtab.c (symbol_cache_key): New static global.
(DEFAULT_SYMBOL_CACHE_SIZE, MAX_SYMBOL_CACHE_SIZE): New macros.
(SYMBOL_LOOKUP_FAILED): New macro.
(symbol_cache_slot_state): New enum.
(block_symbol_cache): New struct.
(symbol_cache): New struct.
(new_symbol_cache_size, symbol_cache_size): New static globals.
(hash_symbol_entry, eq_symbol_entry): New functions.
(symbol_cache_byte_size, resize_symbol_cache): New functions.
(make_symbol_cache, free_symbol_cache): New functions.
(get_symbol_cache, symbol_cache_cleanup): New function.
(set_symbol_cache_size, set_symbol_cache_size_handler): New functions.
(symbol_cache_lookup, symbol_cache_clear_slot): New function.
(symbol_cache_mark_found, symbol_cache_mark_not_found): New functions.
(symbol_cache_flush, symbol_cache_dump): New functions.
(maintenance_print_symbol_cache): New function.
(maintenance_flush_symbol_cache): New function.
(symbol_cache_stats): New function.
(maintenance_print_symbol_cache_statistics): New function.
(symtab_new_objfile_observer): New function.
(symtab_free_objfile_observer): New function.
(lookup_static_symbol, lookup_global_symbol): Use symbol cache.
(_initialize_symtab): Init symbol_cache_key. New parameter
maint symbol-cache-size. New maint commands print symbol-cache,
print symbol-cache-statistics, flush-symbol-cache.
Install new_objfile, free_objfile observers.
gdb/doc/ChangeLog:
* gdb.texinfo (Symbols): Document new commands
"maint print symbol-cache", "maint print symbol-cache-statistics",
"maint flush-symbol-cache". Document new option
"maint set symbol-cache-size".
2015-01-31 21:29:33 +00:00
|
|
|
|
2015-01-31 Doug Evans <xdje42@gmail.com>
|
|
|
|
|
|
|
|
|
|
Add symbol lookup cache.
|
|
|
|
|
* NEWS: Document new options and commands.
|
|
|
|
|
* symtab.c (symbol_cache_key): New static global.
|
|
|
|
|
(DEFAULT_SYMBOL_CACHE_SIZE, MAX_SYMBOL_CACHE_SIZE): New macros.
|
|
|
|
|
(SYMBOL_LOOKUP_FAILED): New macro.
|
|
|
|
|
(symbol_cache_slot_state): New enum.
|
|
|
|
|
(block_symbol_cache): New struct.
|
|
|
|
|
(symbol_cache): New struct.
|
|
|
|
|
(new_symbol_cache_size, symbol_cache_size): New static globals.
|
|
|
|
|
(hash_symbol_entry, eq_symbol_entry): New functions.
|
|
|
|
|
(symbol_cache_byte_size, resize_symbol_cache): New functions.
|
|
|
|
|
(make_symbol_cache, free_symbol_cache): New functions.
|
|
|
|
|
(get_symbol_cache, symbol_cache_cleanup): New function.
|
|
|
|
|
(set_symbol_cache_size, set_symbol_cache_size_handler): New functions.
|
|
|
|
|
(symbol_cache_lookup, symbol_cache_clear_slot): New function.
|
|
|
|
|
(symbol_cache_mark_found, symbol_cache_mark_not_found): New functions.
|
|
|
|
|
(symbol_cache_flush, symbol_cache_dump): New functions.
|
|
|
|
|
(maintenance_print_symbol_cache): New function.
|
|
|
|
|
(maintenance_flush_symbol_cache): New function.
|
|
|
|
|
(symbol_cache_stats): New function.
|
|
|
|
|
(maintenance_print_symbol_cache_statistics): New function.
|
|
|
|
|
(symtab_new_objfile_observer): New function.
|
|
|
|
|
(symtab_free_objfile_observer): New function.
|
|
|
|
|
(lookup_static_symbol, lookup_global_symbol): Use symbol cache.
|
|
|
|
|
(_initialize_symtab): Init symbol_cache_key. New parameter
|
|
|
|
|
maint symbol-cache-size. New maint commands print symbol-cache,
|
|
|
|
|
print symbol-cache-statistics, flush-symbol-cache.
|
|
|
|
|
Install new_objfile, free_objfile observers.
|
|
|
|
|
|
2015-01-31 20:43:02 +00:00
|
|
|
|
2015-01-31 Joel Brobecker <brobecker@adacore.com>
|
|
|
|
|
|
|
|
|
|
PR symtab/17855
|
|
|
|
|
* symfile.c (clear_symtab_users): Move call to breakpoint_re_set
|
|
|
|
|
to end.
|
|
|
|
|
|
2015-01-31 20:01:13 +00:00
|
|
|
|
2015-01-31 Doug Evans <xdje42@gmail.com>
|
|
|
|
|
|
|
|
|
|
* NEWS: Mention inlined scripts in .debug_gdb_scripts section.
|
|
|
|
|
* auto-load.c: #include ctype.h.
|
|
|
|
|
(struct auto_load_pspace_info): Replace member loaded_scripts with
|
|
|
|
|
new members loaded_script_files, loaded_script_texts.
|
|
|
|
|
(auto_load_pspace_data_cleanup): Update.
|
|
|
|
|
(init_loaded_scripts_info): Update.
|
|
|
|
|
(get_auto_load_pspace_data_for_loading): Update.
|
|
|
|
|
(maybe_add_script_file): Renamed from maybe_add_script. All callers
|
|
|
|
|
updated.
|
|
|
|
|
(maybe_add_script_text): New function.
|
|
|
|
|
(clear_section_scripts): Update.
|
|
|
|
|
(source_script_file, execute_script_contents): New functions.
|
|
|
|
|
(source_section_scripts): Add support for
|
|
|
|
|
SECTION_SCRIPT_ID_PYTHON_TEXT, SECTION_SCRIPT_ID_GUILE_TEXT.
|
|
|
|
|
(print_scripts): New function.
|
|
|
|
|
(auto_load_info_scripts): Also print inlined scripts.
|
|
|
|
|
(maybe_print_unsupported_script_warning): Renamed from
|
|
|
|
|
unsupported_script_warning_print. All callers updated.
|
|
|
|
|
(maybe_print_script_not_found_warning): Renamed from
|
|
|
|
|
script_not_found_warning_print. All callers updated.
|
|
|
|
|
* extension-priv.h (struct extension_language_script_ops): New member
|
|
|
|
|
objfile_script_executor.
|
|
|
|
|
* extension.c (ext_lang_objfile_script_executor): New function.
|
|
|
|
|
* extension.h (objfile_script_executor_func): New typedef.
|
|
|
|
|
(ext_lang_objfile_script_executor): Declare.
|
|
|
|
|
* guile/guile-internal.h (gdbscm_execute_objfile_script): Declare.
|
|
|
|
|
* guile/guile.c (guile_extension_script_ops): Update.
|
|
|
|
|
* guile/scm-objfile.c (gdbscm_execute_objfile_script): New function.
|
|
|
|
|
* python/python.c (python_extension_script_ops): Update.
|
|
|
|
|
(gdbpy_execute_objfile_script): New function.
|
|
|
|
|
|
2015-01-31 08:47:14 +00:00
|
|
|
|
2015-01-31 Eli Zaretskii <eliz@gnu.org>
|
|
|
|
|
|
|
|
|
|
* tui/tui-io.c (tui_expand_tabs): New function.
|
|
|
|
|
(tui_puts, tui_redisplay_readline): Expand TABs into the
|
|
|
|
|
appropriate number of spaces.
|
|
|
|
|
* tui/tui-regs.c: Include tui-io.h.
|
|
|
|
|
(tui_register_format): Call tui_expand_tabs to expand TABs into
|
|
|
|
|
the appropriate number of spaces.
|
|
|
|
|
* tui/tui-io.h: Add prototype for tui_expand_tabs.
|
|
|
|
|
|
2015-01-31 04:49:51 +00:00
|
|
|
|
2015-01-30 Doug Evans <dje@google.com>
|
|
|
|
|
|
|
|
|
|
* NEWS: "info source" command now display producer string if present.
|
|
|
|
|
* source.c (source_info): Print producer string if present.
|
|
|
|
|
|
2015-01-30 20:16:43 +00:00
|
|
|
|
2015-01-30 Simon Marchi <simon.marchi@ericsson.com>
|
|
|
|
|
|
|
|
|
|
* varobj.c (varobj_delete): Fix comment.
|
|
|
|
|
|
2015-01-30 20:14:46 +00:00
|
|
|
|
2015-01-30 Simon Marchi <simon.marchi@ericsson.com>
|
|
|
|
|
|
|
|
|
|
* varobj.c (create_child): Modify comment.
|
|
|
|
|
|
2015-01-30 20:07:15 +00:00
|
|
|
|
2015-01-30 Simon Marchi <simon.marchi@ericsson.com>
|
|
|
|
|
|
|
|
|
|
* ada-varobj.c (ada_number_of_children): Constify struct varobj *
|
|
|
|
|
parameter.
|
|
|
|
|
(ada_name_of_variable): Same.
|
|
|
|
|
(ada_path_expr_of_child): Same.
|
|
|
|
|
(ada_value_of_variable): Same.
|
|
|
|
|
(ada_value_is_changeable_p): Same.
|
|
|
|
|
(ada_value_has_mutated): Same.
|
|
|
|
|
* c-varobj.c (varobj_is_anonymous_child): Same.
|
|
|
|
|
(c_is_path_expr_parent): Same.
|
|
|
|
|
(c_number_of_children): Same.
|
|
|
|
|
(c_name_of_variable): Same.
|
|
|
|
|
(c_path_expr_of_child): Same.
|
|
|
|
|
(get_type): Same.
|
|
|
|
|
(c_value_of_variable): Same.
|
|
|
|
|
(cplus_number_of_children): Same.
|
|
|
|
|
(cplus_name_of_variable): Same.
|
|
|
|
|
(cplus_path_expr_of_child): Same.
|
|
|
|
|
(cplus_value_of_variable): Same.
|
|
|
|
|
* jv-varobj.c (java_number_of_children): Same.
|
|
|
|
|
(java_name_of_variable): Same.
|
|
|
|
|
(java_path_expr_of_child): Same.
|
|
|
|
|
(java_value_of_variable): Same.
|
|
|
|
|
* varobj.c (number_of_children): Same.
|
|
|
|
|
(name_of_variable): Same.
|
|
|
|
|
(is_root_p): Same.
|
|
|
|
|
(varobj_ensure_python_env): Same.
|
|
|
|
|
(varobj_get_objname): Same.
|
|
|
|
|
(varobj_get_expression): Same.
|
|
|
|
|
(varobj_get_display_format): Same.
|
|
|
|
|
(varobj_get_display_hint): Same.
|
|
|
|
|
(varobj_has_more): Same.
|
|
|
|
|
(varobj_get_thread_id): Same.
|
|
|
|
|
(varobj_get_frozen): Same.
|
|
|
|
|
(dynamic_varobj_has_child_method): Same.
|
|
|
|
|
(varobj_get_gdb_type): Same.
|
|
|
|
|
(is_path_expr_parent): Same.
|
|
|
|
|
(varobj_default_is_path_expr_parent): Same.
|
|
|
|
|
(varobj_get_language): Same.
|
|
|
|
|
(varobj_get_attributes): Same.
|
|
|
|
|
(varobj_is_dynamic_p): Same.
|
|
|
|
|
(varobj_get_child_range): Same.
|
|
|
|
|
(varobj_value_has_mutated): Same.
|
|
|
|
|
(varobj_get_value_type): Same.
|
|
|
|
|
(number_of_children): Same.
|
|
|
|
|
(name_of_variable): Same.
|
|
|
|
|
(check_scope): Same.
|
|
|
|
|
(varobj_editable_p): Same.
|
|
|
|
|
(varobj_value_is_changeable_p): Same.
|
|
|
|
|
(varobj_floating_p): Same.
|
|
|
|
|
(varobj_default_value_is_changeable_p): Same.
|
|
|
|
|
|
2015-01-30 19:43:59 +00:00
|
|
|
|
2015-01-30 Simon Marchi <simon.marchi@ericsson.com>
|
|
|
|
|
|
|
|
|
|
* varobj.c (varobj_get_path_expr): Set var->path_expr.
|
|
|
|
|
* c-varobj.c (c_path_expr_of_child): Set local var instead of
|
|
|
|
|
child->path_expr.
|
|
|
|
|
(cplus_path_expr_of_child): Same.
|
|
|
|
|
|
2015-01-30 18:56:56 +00:00
|
|
|
|
2015-01-30 Simon Marchi <simon.marchi@ericsson.com>
|
|
|
|
|
|
|
|
|
|
* mi-cmd-var.c (print_varobj): Free varobj_get_expression
|
|
|
|
|
result.
|
|
|
|
|
(mi_cmd_var_info_expression): Same.
|
|
|
|
|
* varobj.c (varobj_get_expression): Mention in the comment that
|
|
|
|
|
the result must by freed by the caller.
|
|
|
|
|
|
2015-01-30 18:54:50 +00:00
|
|
|
|
2015-01-30 Simon Marchi <simon.marchi@ericsson.com>
|
|
|
|
|
|
|
|
|
|
* mi/mi-cmd-var.c (mi_cmd_var_info_type): Free result of
|
|
|
|
|
varobj_get_type.
|
|
|
|
|
(varobj_update_one): Same.
|
|
|
|
|
* varobj.c (update_type_if_necessary): Free curr_type_str and
|
|
|
|
|
new_type_str.
|
|
|
|
|
(varobj_get_type): Specify in comment that the result needs to be
|
|
|
|
|
freed by the caller.
|
|
|
|
|
|
2015-01-29 18:26:38 +00:00
|
|
|
|
2015-01-29 Doug Evans <dje@google.com>
|
|
|
|
|
|
|
|
|
|
PR symtab/17890
|
|
|
|
|
* dwarf2read.c (dwarf_decode_line_header): Punt if version > 4.
|
|
|
|
|
|
2015-01-25 10:20:39 +00:00
|
|
|
|
2015-01-25 Mark Wielaard <mjw@redhat.com>
|
|
|
|
|
|
|
|
|
|
* dwarf2read.c (checkproducer): Call producer_is_gcc.
|
|
|
|
|
* utils.c (producer_is_gcc_ge_4): Likewise.
|
|
|
|
|
(producer_is_gcc): New function.
|
|
|
|
|
* utils.h (producer_is_gcc): New declaration.
|
|
|
|
|
|
gdb/DWARF: Support for arrays whose bound is a discriminant.
Consider the following declarations:
type Array_Type is array (Integer range <>) of Integer;
type Record_Type (N : Integer) is record
A : Array_Type (1 .. N);
end record;
R : Record_Type := Get (10);
It defines what Ada programers call a "discriminated record", where
"N" is a component of that record called a "discriminant", and where
"A" is a component defined as an array type whose upper bound is
equal to the value of the discriminant.
So far, we rely on a number of fairly complex GNAT-specific encodings
to handle this situation. This patch is to enhance GDB to be able to
print this record in the case where the compiler has been modified
to replace those encodings by pure DWARF constructs.
In particular, the debugging information generated for the record above
looks like the following. "R" is a record..
.uleb128 0x10 # (DIE (0x13e) DW_TAG_structure_type)
.long .LASF17 # DW_AT_name: "foo__record_type"
... whose is is of course dynamic (not our concern here)...
.uleb128 0xd # DW_AT_byte_size
.byte 0x97 # DW_OP_push_object_address
.byte 0x94 # DW_OP_deref_size
.byte 0x4
.byte 0x99 # DW_OP_call4
.long 0x19b
.byte 0x23 # DW_OP_plus_uconst
.uleb128 0x7
.byte 0x9 # DW_OP_const1s
.byte 0xfc
.byte 0x1a # DW_OP_and
.byte 0x1 # DW_AT_decl_file (foo.adb)
.byte 0x6 # DW_AT_decl_line
... and then has 2 members, fist "n" (our discriminant);
.uleb128 0x11 # (DIE (0x153) DW_TAG_member)
.ascii "n\0" # DW_AT_name
.byte 0x1 # DW_AT_decl_file (foo.adb)
.byte 0x6 # DW_AT_decl_line
.long 0x194 # DW_AT_type
.byte 0 # DW_AT_data_member_location
... and "A"...
.uleb128 0x11 # (DIE (0x181) DW_TAG_member)
.ascii "a\0" # DW_AT_name
.long 0x15d # DW_AT_type
.byte 0x4 # DW_AT_data_member_location
... which is an array ...
.uleb128 0x12 # (DIE (0x15d) DW_TAG_array_type)
.long .LASF18 # DW_AT_name: "foo__record_type__T4b"
.long 0x194 # DW_AT_type
... whose lower bound is implicitly 1, and the upper bound
a reference to DIE 0x153 = "N":
.uleb128 0x13 # (DIE (0x16a) DW_TAG_subrange_type)
.long 0x174 # DW_AT_type
.long 0x153 # DW_AT_upper_bound
This patch enhanced GDB to understand references to other DIEs
where the DIE's address is at an offset of its enclosing type.
The difficulty was that the address used to resolve the array's
type (R's address + 4 bytes) is different from the address used
as the base to compute N's address (an offset to R's address).
We're solving this issue by using a stack of addresses rather
than a single address when trying to resolve a type. Each address
in the stack corresponds to each containing level. For instance,
if resolving the field of a struct, the stack should contain
the address of the field at the top, and then the address of
the struct. That way, if the field makes a reference to an object
of the struct, we can retrieve the address of that struct, and
properly resolve the dynamic property references that struct.
gdb/ChangeLog:
* gdbtypes.h (struct dynamic_prop): New PROP_ADDR_OFFSET enum
kind.
* gdbtypes.c (resolve_dynamic_type_internal): Replace "addr"
parameter by "addr_stack" parameter.
(resolve_dynamic_range): Replace "addr" parameter by
"stack_addr" parameter. Update function documentation.
Update code accordingly.
(resolve_dynamic_array, resolve_dynamic_union)
(resolve_dynamic_struct, resolve_dynamic_type_internal): Likewise.
(resolve_dynamic_type): Update code, following the changes made
to resolve_dynamic_type_internal's interface.
* dwarf2loc.h (struct property_addr_info): New.
(dwarf2_evaluate_property): Replace "address" parameter
by "addr_stack" parameter. Adjust function documentation.
(struct dwarf2_offset_baton): New.
(struct dwarf2_property_baton): Update documentation of
field "referenced_type" to be more general. New field
"offset_info" in union data field.
* dwarf2loc.c (dwarf2_evaluate_property): Replace "address"
parameter by "addr_stack" parameter. Adjust code accordingly.
Add support for PROP_ADDR_OFFSET properties.
* dwarf2read.c (attr_to_dynamic_prop): Add support for
DW_AT_data_member_location attributes as well. Use case
statements instead of if/else condition.
gdb/testsuite/ChangeLog:
* gdb.ada/disc_arr_bound: New testcase.
Tested on x86_64-linux, no regression.
2015-01-05 10:32:36 +00:00
|
|
|
|
2015-01-29 Joel Brobecker <brobecker@adacore.com>
|
|
|
|
|
|
|
|
|
|
* gdbtypes.h (struct dynamic_prop): New PROP_ADDR_OFFSET enum
|
|
|
|
|
kind.
|
|
|
|
|
* gdbtypes.c (resolve_dynamic_type_internal): Replace "addr"
|
|
|
|
|
parameter by "addr_stack" parameter.
|
|
|
|
|
(resolve_dynamic_range): Replace "addr" parameter by
|
|
|
|
|
"stack_addr" parameter. Update function documentation.
|
|
|
|
|
Update code accordingly.
|
|
|
|
|
(resolve_dynamic_array, resolve_dynamic_union)
|
|
|
|
|
(resolve_dynamic_struct, resolve_dynamic_type_internal): Likewise.
|
|
|
|
|
(resolve_dynamic_type): Update code, following the changes made
|
|
|
|
|
to resolve_dynamic_type_internal's interface.
|
|
|
|
|
* dwarf2loc.h (struct property_addr_info): New.
|
|
|
|
|
(dwarf2_evaluate_property): Replace "address" parameter
|
|
|
|
|
by "addr_stack" parameter. Adjust function documentation.
|
|
|
|
|
(struct dwarf2_offset_baton): New.
|
|
|
|
|
(struct dwarf2_property_baton): Update documentation of
|
|
|
|
|
field "referenced_type" to be more general. New field
|
|
|
|
|
"offset_info" in union data field.
|
|
|
|
|
* dwarf2loc.c (dwarf2_evaluate_property): Replace "address"
|
|
|
|
|
parameter by "addr_stack" parameter. Adjust code accordingly.
|
|
|
|
|
Add support for PROP_ADDR_OFFSET properties.
|
|
|
|
|
* dwarf2read.c (attr_to_dynamic_prop): Add support for
|
|
|
|
|
DW_AT_data_member_location attributes as well. Use case
|
|
|
|
|
statements instead of if/else condition.
|
|
|
|
|
|
[Ada/varobj] number of children of null pointer to dynamic array.
This is preparation work to avoid a regression in the Ada/varobj.
An upcoming patch is going to add support for types in DWARF
which have dynamic properties whose value is a reference to another
DIE.
Consider for instance the following declaration:
type Variant_Type (N : Int := 0) is record
F : String(1 .. N) := (others => 'x');
end record;
type Variant_Type_Access is access all Variant_Type;
VTA : Variant_Type_Access := null;
This declares a variable "VTA" which is an access (=pointer)
to a variant record Variant_Type. This record contains two
components, the first being "N" (the discriminant), and the
second being "F", an array whose lower bound is 1, and whose
upper bound depends on the value of "N" (the discriminant).
Of interest to us, here, is that second component ("F"), and
in particular its bounds. The debugging info, and in particular
the info for the array looks like the following...
.uleb128 0x9 # (DIE (0x91) DW_TAG_array_type)
.long .LASF16 # DW_AT_name: "bar__variant_type__T2b"
.long 0xac # DW_AT_GNAT_descriptive_type
.long 0x2cb # DW_AT_type
.long 0xac # DW_AT_sibling
.uleb128 0xa # (DIE (0xa2) DW_TAG_subrange_type)
.long 0xc4 # DW_AT_type
.long 0x87 # DW_AT_upper_bound
.byte 0 # end of children of DIE 0x91
... where the upper bound of the array's subrange type is a reference
to "n"'s DIE (0x87):
.uleb128 0x8 # (DIE (0x87) DW_TAG_member)
.ascii "n\0" # DW_AT_name
[...]
Once the patch to handle this dynamic property gets applied,
this is what happens when creating a varobj for variable "VTA"
(whose value is null), and then trying to list its children:
(gdb)
-var-create vta * vta
^done,name="vta",numchild="2",value="0x0",
type="bar.variant_type_access",has_more="0"
(gdb)
-var-list-children 1 vta
^done,numchild="2",
children=[child={name="vta.n",[...]},
child={name="vta.f",exp="f",
numchild="43877616", <<<<-----
value="[43877616]", <<<<-----
type="array (1 .. n) of character"}],
has_more="0"
It has an odd number of children.
In this case, we cannot really determine the number of children,
since that number depends on the value of a field in a record
for which we do not have a value. Up to now, the value we've been
displaying is zero - meaning we have an empty array.
What happens in this case, is that, because the VTA is a null pointer,
we're not able to resolve the pointer's target type, and therefore
end up asking ada_varobj_get_array_number_of_children to return
the number of elements in that array; for that, it relies blindly
on get_array_bounds, which assumes the type is no longer dynamic,
and therefore the reads the bound without seeing that it's value
is actually a reference rather than a resolved constant.
This patch prevents the issue by explicitly handling the case of
dynamic arrays, and returning zero child in that case.
gdb/ChangeLog:
* ada-varobj.c (ada_varobj_get_array_number_of_children):
Return zero if PARENT_VALUE is NULL and parent_type's
range type is dynamic.
gdb/testsuite/ChangeLog:
* gdb.ada/mi_var_array: New testcase.
Tested on x86_64-linux.
2015-01-14 14:39:24 +00:00
|
|
|
|
2015-01-29 Joel Brobecker <brobecker@adacore.com>
|
|
|
|
|
|
|
|
|
|
* ada-varobj.c (ada_varobj_get_array_number_of_children):
|
|
|
|
|
Return zero if PARENT_VALUE is NULL and parent_type's
|
|
|
|
|
range type is dynamic.
|
|
|
|
|
|
gdb/DWARF: dynamic subrange type of dynamic subrange type.
Consider the following code:
type Record_Type (N : Integer) is record
A : Array_Type (1 .. N);
end record;
[...]
R : Record_Type := Get (10);
Trying to print the bounds of the array R.A yielded:
(gdb) p r.a'last
$4 = cannot find reference address for offset property
A slightly different example, but from the same cause:
(gdb) ptype r
type = <ref> record
n: integer;
a: array (cannot find reference address for offset property
Looking at the debugging info, "A" is described as...
.uleb128 0x11 # (DIE (0x181) DW_TAG_member)
.ascii "a\0" # DW_AT_name
.long 0x15d # DW_AT_type
[...]
... which is an array...
.uleb128 0x12 # (DIE (0x15d) DW_TAG_array_type)
.long .LASF18 # DW_AT_name: "foo__record_type__T4b"
.long 0x194 # DW_AT_type
.long 0x174 # DW_AT_sibling
... whose bounds are described as:
.uleb128 0x13 # (DIE (0x16a) DW_TAG_subrange_type)
.long 0x174 # DW_AT_type
.long 0x153 # DW_AT_upper_bound
.byte 0 # end of children of DIE 0x15d
We can see above that the range has an implict lower value of
1, and an upper value which is a reference 0x153="n". All Good.
But looking at the array's subrange subtype, we see...
.uleb128 0x14 # (DIE (0x174) DW_TAG_subrange_type)
.long 0x153 # DW_AT_upper_bound
.long .LASF19 # DW_AT_name: "foo__record_type__T3b"
.long 0x18d # DW_AT_type
... another subrange type whose bounds are exactly described
the same way. So we have a subrange of a subrange, both with
one bound that's dynamic.
What happens in the case above is that GDB's resolution of "R.A"
yields a array whose index type has static bounds. However, the
subtype of the array's index type was left untouched, so, when
taking the subtype of the array's subrange type, we were left
with the unresolved subrange type, triggering the error above.
gdb/ChangeLog:
* gdbtypes.c (is_dynamic_type_internal) <TYPE_CODE_RANGE>: Return
nonzero if the type's subtype is dynamic.
(resolve_dynamic_range): Also resolve the range's subtype.
Tested on x86_64-linux, no regression.
2015-01-05 14:39:02 +00:00
|
|
|
|
2015-01-29 Joel Brobecker <brobecker@adacore.com>
|
|
|
|
|
|
|
|
|
|
* gdbtypes.c (is_dynamic_type_internal) <TYPE_CODE_RANGE>: Return
|
|
|
|
|
nonzero if the type's subtype is dynamic.
|
|
|
|
|
(resolve_dynamic_range): Also resolve the range's subtype.
|
|
|
|
|
|
2015-01-29 08:10:12 +00:00
|
|
|
|
2015-01-29 Alexander Klimov <alserkli@inbox.ru> (tiny patch)
|
2015-01-27 17:56:45 +00:00
|
|
|
|
|
2015-01-29 08:10:12 +00:00
|
|
|
|
Pushed by Joel Brobecker <brobecker@adacore.com>.
|
2015-01-27 17:56:45 +00:00
|
|
|
|
* symfile.c (unmap_overlay_command): Initialize sec to NULL.
|
|
|
|
|
|
2015-01-27 18:13:52 +00:00
|
|
|
|
2015-01-27 Doug Evans <dje@google.com>
|
|
|
|
|
|
|
|
|
|
* NEWS: Mention gdb.Objfile.username.
|
|
|
|
|
* python/py-objfile.c (objfpy_get_username): New function.
|
|
|
|
|
(objfile_getset): Add "username".
|
|
|
|
|
|
2015-01-24 14:08:32 +00:00
|
|
|
|
2015-01-24 Mark Wielaard <mjw@redhat.com>
|
|
|
|
|
|
|
|
|
|
* stack.c (return_command): Markup warning message with _.
|
|
|
|
|
|
2015-01-24 19:17:08 +00:00
|
|
|
|
2015-01-24 Doug Evans <xdje42@gmail.com>
|
|
|
|
|
|
|
|
|
|
* gdbtypes.h (TYPE_TYPE_SPECIFIC): Delete.
|
|
|
|
|
|
Fix 100x slowdown regression on DWZ files
Since Fedora started to use DWZ DWARF compressor:
http://fedoraproject.org/wiki/Features/DwarfCompressor
GDB has slowed down a lot. To make it clear - DWZ is DWARF structure
rearrangement, "compressor" does not mean any zlib style data compression.
This patch reduces LibreOffice backtrace from 5 minutes to 3 seconds (100x)
and it also reduces memory consumption 20x.
[ benchmark is at the bottom of this mail ]
Example of DWZ output:
------------------------------------------------------------------------------
Compilation Unit @ offset 0xc4:
<0><cf>: Abbrev Number: 17 (DW_TAG_partial_unit)
<d0> DW_AT_stmt_list : 0x0
<d4> DW_AT_comp_dir : (indirect string, offset: 0x6f): /usr/src/debug/gdb-7.7.1/build-x86_64-redhat-linux-gnu/gdb
<1><d8>: Abbrev Number: 9 (DW_TAG_typedef)
<d9> DW_AT_name : (indirect string, offset: 0x827dc): size_t
<dd> DW_AT_decl_file : 4
<de> DW_AT_decl_line : 212
<df> DW_AT_type : <0xae>
Compilation Unit @ offset 0xe4:
<0><ef>: Abbrev Number: 13 (DW_TAG_partial_unit)
<f0> DW_AT_stmt_list : 0x0
<f4> DW_AT_comp_dir : (indirect string, offset: 0x6f): /usr/src/debug/gdb-7.7.1/build-x86_64-redhat-linux-gnu/gdb
<1><f8>: Abbrev Number: 45 (DW_TAG_typedef)
<f9> DW_AT_name : (indirect string, offset: 0x251): __off_t
<fd> DW_AT_decl_file : 3
<fe> DW_AT_decl_line : 131
<ff> DW_AT_type : <0x68>
Compilation Unit @ offset 0x62d9f9:
<0><62da04>: Abbrev Number: 20 (DW_TAG_compile_unit)
[...]
<62da12> DW_AT_low_pc : 0x807e10
<62da1a> DW_AT_high_pc : 134
<62da1c> DW_AT_stmt_list : 0xf557e
<1><62da20>: Abbrev Number: 7 (DW_TAG_imported_unit)
<62da21> DW_AT_import : <0xcf> [Abbrev Number: 17]
------------------------------------------------------------------------------
One can see all DW_TAG_partial_unit have DW_AT_stmt_list 0x0 which causes
repeated decoding of that .debug_line unit on each DW_TAG_imported_unit.
This was OK before as each DW_TAG_compile_unit has its own .debug_line unit.
But since the introduction of DW_TAG_partial_unit by DWZ one should cache
read-in DW_AT_stmt_list .debug_line units.
Fortunately one does not need to cache whole
struct linetable *symtab->linetable
and other data from .debug_line mapping PC<->lines
------------------------------------------------------------------------------
Line Number Statements:
Extended opcode 2: set Address to 0x45c880
Advance Line by 25 to 26
Copy
------------------------------------------------------------------------------
as the only part of .debug_line which GDB needs for DW_TAG_partial_unit is:
------------------------------------------------------------------------------
The Directory Table:
../../gdb
/usr/include/bits
[...]
The File Name Table:
Entry Dir Time Size Name
1 1 0 0 gdb.c
2 2 0 0 string3.h
[...]
------------------------------------------------------------------------------
specifically referenced in GDB for DW_AT_decl_file at a single place:
------------------------------------------------------------------------------
fe = &cu->line_header->file_names[file_index - 1];
SYMBOL_SYMTAB (sym) = fe->symtab;
------------------------------------------------------------------------------
This is because for some reason DW_TAG_partial_unit never contains PC-related
DWARF information. I do not know exactly why, the compression ratio is a bit
lower due to it but thanksfully currently it is that way:
dwz.c:
------------------------------------------------------------------------------
/* These attributes reference code, prevent moving
DIEs with them. */
case DW_AT_low_pc:
case DW_AT_high_pc:
case DW_AT_entry_pc:
case DW_AT_ranges:
die->die_ck_state = CK_BAD;
+
/* State of checksum computation. Not computed yet, computed and
suitable for moving into partial units, currently being computed
and finally determined unsuitable for moving into partial units. */
enum { CK_UNKNOWN, CK_KNOWN, CK_BEING_COMPUTED, CK_BAD } die_ck_state : 2;
------------------------------------------------------------------------------
I have also verified also real-world Fedora debuginfo files really comply with
that assumption with dwgrep
https://github.com/pmachata/dwgrep
using:
------------------------------------------------------------------------------
dwgrep -e 'entry ?DW_TAG_partial_unit child* ( ?DW_AT_low_pc , ?DW_AT_high_pc , ?DW_AT_ranges )' /usr/lib/debug/**
------------------------------------------------------------------------------
BTW I think GDB already does not support the whole DW_TAG_imported_unit and
DW_TAG_partial_unit usage possibilities as specified by the DWARF standard.
I think GDB would not work if DW_TAG_imported_unit was used in some inner
level and not at the CU level (readelf -wi level <1>) - this is how DWZ is
using DW_TAG_imported_unit. Therefore I do not think further assumptions
about DW_TAG_imported_unit and DW_TAG_partial_unit usage by DWZ are a problem
for GDB.
One could save the whole .debug_line decoded PC<->lines mapping (and not just
the DW_AT_decl_file table) but:
* there are some problematic corner cases so one could do it incorrectly
* there are no real world data to really test such patch extension
* such extension could be done perfectly incrementally on top of this patch
------------------------------------------------------------------------------
benchmark - on Fedora 20 x86_64 and FSF GDB HEAD:
echo -e 'thread apply all bt\nset confirm no\nq'|./gdb -p `pidof soffice.bin` -ex 'set pagination off' -ex 'maintenance set per-command
space' -ex 'maintenance set per-command symtab' -ex 'maintenance set per-command time'
FSF GDB HEAD ("thread apply all bt"):
Command execution time: 333.693000 (cpu), 335.587539 (wall)
---sec
Space used: 1736404992 (+1477189632 for this command)
----MB
vs.
THIS PATCH ("thread apply all bt"):
Command execution time: 2.595000 (cpu), 2.607573 (wall)
-sec
Space used: 340058112 (+85917696 for this command)
--MB
FSF GDB HEAD ("thread apply all bt full"):
Command execution time: 466.751000 (cpu), 468.345837 (wall)
---sec
Space used: 2330132480 (+2070974464 for this command)
----MB
vs.
THIS PATCH ("thread apply all bt full"):
Command execution time: 18.907000 (cpu), 18.964125 (wall)
--sec
Space used: 364462080 (+110325760 for this command)
---MB
------------------------------------------------------------------------------
gdb/ChangeLog
2015-01-24 Jan Kratochvil <jan.kratochvil@redhat.com>
Fix 100x slowdown regression on DWZ files.
* dwarf2read.c (struct dwarf2_per_objfile): Add line_header_hash.
(struct line_header): Add offset and offset_in_dwz.
(dwarf_decode_lines): Add parameter decode_mapping to the declaration.
(free_line_header_voidp): New declaration.
(line_header_hash, line_header_hash_voidp, line_header_eq_voidp): New
functions.
(dwarf2_build_include_psymtabs): Update dwarf_decode_lines caller.
(handle_DW_AT_stmt_list): Use line_header_hash.
(free_line_header_voidp): New function.
(dwarf_decode_line_header): Initialize offset and offset_in_dwz.
(dwarf_decode_lines): New parameter decode_mapping, use it.
(dwarf2_free_objfile): Free line_header_hash.
2015-01-24 14:44:52 +00:00
|
|
|
|
2015-01-24 Jan Kratochvil <jan.kratochvil@redhat.com>
|
|
|
|
|
|
|
|
|
|
Fix 100x slowdown regression on DWZ files.
|
|
|
|
|
* dwarf2read.c (struct dwarf2_per_objfile): Add line_header_hash.
|
|
|
|
|
(struct line_header): Add offset and offset_in_dwz.
|
|
|
|
|
(dwarf_decode_lines): Add parameter decode_mapping to the declaration.
|
|
|
|
|
(free_line_header_voidp): New declaration.
|
|
|
|
|
(line_header_hash, line_header_hash_voidp, line_header_eq_voidp): New
|
|
|
|
|
functions.
|
|
|
|
|
(dwarf2_build_include_psymtabs): Update dwarf_decode_lines caller.
|
|
|
|
|
(handle_DW_AT_stmt_list): Use line_header_hash.
|
|
|
|
|
(free_line_header_voidp): New function.
|
|
|
|
|
(dwarf_decode_line_header): Initialize offset and offset_in_dwz.
|
|
|
|
|
(dwarf_decode_lines): New parameter decode_mapping, use it.
|
|
|
|
|
(dwarf2_free_objfile): Free line_header_hash.
|
|
|
|
|
|
2015-01-23 17:59:24 +00:00
|
|
|
|
2015-01-23 Simon Marchi <simon.marchi@ericsson.com>
|
|
|
|
|
|
|
|
|
|
PR gdb/17416
|
|
|
|
|
* valops.c (value_rtti_indirect_type): Catch exception thrown by
|
|
|
|
|
value_ind.
|
|
|
|
|
|
2014-12-09 10:45:41 +00:00
|
|
|
|
2015-01-15 Mark Wielaard <mjw@redhat.com>
|
|
|
|
|
|
|
|
|
|
* dwarf2read.c (read_subroutine_type): Set TYPE_NO_RETURN from
|
|
|
|
|
DW_AT_noreturn.
|
|
|
|
|
* gdbtypes.h (struct func_type): Add is_noreturn field flag. Make
|
|
|
|
|
calling_convention an 8 bit bit field.
|
|
|
|
|
(TYPE_NO_RETURN): New macro.
|
|
|
|
|
* infcmd.c (finish_command): Query if function does not return
|
|
|
|
|
normally.
|
|
|
|
|
* stack.c (return_command): Likewise.
|
|
|
|
|
|
2015-01-23 11:12:39 +00:00
|
|
|
|
2015-01-23 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* linux-nat.c (linux_is_async_p): New macro.
|
|
|
|
|
(linux_nat_is_async_p):
|
|
|
|
|
(linux_nat_terminal_inferior): Check whether the target can async
|
|
|
|
|
instead of whether it is already async.
|
|
|
|
|
(linux_nat_terminal_ours): Don't check whether the target is
|
|
|
|
|
async.
|
|
|
|
|
(linux_async_pipe): Use linux_is_async_p.
|
|
|
|
|
|
2015-01-22 20:04:53 +00:00
|
|
|
|
2015-01-22 Jan Kratochvil <jan.kratochvil@redhat.com>
|
|
|
|
|
|
|
|
|
|
* NEWS (Changes since GDB 7.9): Add 'thread apply all' option
|
|
|
|
|
'-ascending'.
|
|
|
|
|
* thread.c (tp_array_compar_ascending, tp_array_compar): New.
|
|
|
|
|
(thread_apply_all_command): Parse CMD for tp_array_compar_ascending.
|
|
|
|
|
Sort tp_array using tp_array_compar.
|
|
|
|
|
(_initialize_thread): Extend thread_apply_all_command help.
|
|
|
|
|
|
2015-01-22 20:02:24 +00:00
|
|
|
|
2015-01-22 Jan Kratochvil <jan.kratochvil@redhat.com>
|
|
|
|
|
|
|
|
|
|
* corelow.c (core_open): Call also thread_command.
|
|
|
|
|
* gdbthread.h (thread_command): New prototype moved from ...
|
|
|
|
|
* thread.c (thread_command): ... here.
|
|
|
|
|
(thread_command): Make it global.
|
|
|
|
|
|
2015-01-22 18:30:01 +00:00
|
|
|
|
2015-01-22 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* configure.ac [*mingw32*]: Check $curses_found instead of
|
|
|
|
|
$prefer_curses.
|
|
|
|
|
* configure: Regenerate.
|
|
|
|
|
* windows-termcap.c: Remove HAVE_CURSES_H, HAVE_NCURSES_H and
|
|
|
|
|
HAVE_NCURSES_NCURSES_H checks.
|
|
|
|
|
|
2015-01-22 18:23:12 +00:00
|
|
|
|
2015-01-22 Eli Zaretskii <eliz@gnu.org>
|
|
|
|
|
|
2015-01-23 07:13:49 +00:00
|
|
|
|
* tui/tui.c (tui_enable) [__MINGW32__]: If the call to 'newterm'
|
2015-01-22 18:23:12 +00:00
|
|
|
|
fails with the 1st arg NULL, try again with "unknown". Don't test
|
|
|
|
|
the "cup" capability: it isn't supported by the Windows port of
|
|
|
|
|
ncurses, but the Windows console driver is still capable of
|
|
|
|
|
supporting TUI.
|
|
|
|
|
|
2015-01-22 18:18:16 +00:00
|
|
|
|
2015-01-22 Jan Kratochvil <jan.kratochvil@redhat.com>
|
|
|
|
|
|
|
|
|
|
* compile/compile.c (_initialize_compile): Use -fPIE for compile_args.
|
|
|
|
|
|
2015-01-22 18:05:59 +00:00
|
|
|
|
2015-01-22 Eli Zaretskii <eliz@gnu.org>
|
|
|
|
|
|
|
|
|
|
* Makefile.in (HFILES_NO_SRCDIR): Remove ada-varobj.h.
|
|
|
|
|
(ALLDEPFILES): Remove irix5-nat.c. These two are part of the
|
|
|
|
|
reason that "make TAGS" is broken.
|
|
|
|
|
|
2015-01-22 12:47:10 +00:00
|
|
|
|
2015-01-22 Chen Gang <gang.chen.5i5j@gmail.com>
|
|
|
|
|
|
|
|
|
|
* hppa-tdep.c (inst_saves_gr): Fix logical working flow issues
|
|
|
|
|
and check additional store instructions.
|
|
|
|
|
|
2015-01-20 16:07:50 +00:00
|
|
|
|
2015-01-21 Wei-cheng Wang <cole945@gmail.com>
|
|
|
|
|
|
|
|
|
|
* MAINTAINERS (Write After Approval): Add "Wei-cheng Wang".
|
|
|
|
|
|
Add missing comments in rs6000-tdep.c, ppc64-tdep.c and ppc-linux-tdep.c.
gdb/ChangeLog:
* ppc-linux-tdep.c (ppc_skip_trampoline_code,
ppc_canonicalize_syscall, ppc_linux_syscall_record,
ppc_linux_record_signal, ppc_init_linux_record_tdep): Add comments.
* ppc64-tdep.c (ppc64_skip_trampoline_code): Likewise.
* rs6000-tdep.c (rs6000_epilogue_frame_cache,
rs6000_epilogue_frame_this_id, rs6000_epilogue_frame_prev_register,
rs6000_epilogue_frame_sniffer, ppc_record_vsr, ppc_process_record_op4,
ppc_process_record_op19, ppc_process_record_op31,
ppc_process_record_op59, ppc_process_record_op60,
ppc_process_record_op63): Likewise.
2015-01-19 15:34:07 +00:00
|
|
|
|
2015-01-21 Wei-cheng Wang <cole945@gmail.com>
|
|
|
|
|
|
|
|
|
|
* ppc-linux-tdep.c (ppc_skip_trampoline_code,
|
|
|
|
|
ppc_canonicalize_syscall, ppc_linux_syscall_record,
|
|
|
|
|
ppc_linux_record_signal, ppc_init_linux_record_tdep): Add comments.
|
|
|
|
|
* ppc64-tdep.c (ppc64_skip_trampoline_code): Likewise.
|
|
|
|
|
* rs6000-tdep.c (rs6000_epilogue_frame_cache,
|
|
|
|
|
rs6000_epilogue_frame_this_id, rs6000_epilogue_frame_prev_register,
|
|
|
|
|
rs6000_epilogue_frame_sniffer, ppc_record_vsr, ppc_process_record_op4,
|
|
|
|
|
ppc_process_record_op19, ppc_process_record_op31,
|
|
|
|
|
ppc_process_record_op59, ppc_process_record_op60,
|
|
|
|
|
ppc_process_record_op63): Likewise.
|
|
|
|
|
|
2015-01-20 17:38:23 +00:00
|
|
|
|
2015-01-20 Joel Brobecker <brobecker@adacore.com>
|
|
|
|
|
|
|
|
|
|
* nat/linux-ptrace.c (linux_ptrace_attach_fail_reason_string)
|
|
|
|
|
(linux_ptrace_test_ret_to_nx): Use safe_strerror instead of
|
|
|
|
|
strerror.
|
|
|
|
|
|
2015-01-20 18:04:26 +00:00
|
|
|
|
2015-01-20 Wei-cheng Wang <cole945@gmail.com>
|
2015-01-18 07:20:46 +00:00
|
|
|
|
|
|
|
|
|
* rs6000-tdep.c (ppc_process_record_op4, ppc_process_record_op19,
|
|
|
|
|
ppc_process_record_op31, ppc_process_record_op59,
|
|
|
|
|
ppc_process_record_op60, ppc_process_record_op63,
|
|
|
|
|
ppc_process_record): Fix -Wformat warning.
|
|
|
|
|
* rs6000-tdep.c (rs6000_epilogue_frame_cache, ppc_process_record_op60):
|
|
|
|
|
Remove unused variables.
|
|
|
|
|
|
2015-01-20 14:17:09 +00:00
|
|
|
|
2015-01-20 Chen Gang <gang.chen.5i5j@gmail.com>
|
|
|
|
|
|
|
|
|
|
* MAINTAINERS (Write After Approval): Add "Chen Gang".
|
|
|
|
|
|
2015-01-19 15:34:29 +00:00
|
|
|
|
2015-01-19 Eli Zaretskii <eliz@gnu.org>
|
|
|
|
|
|
|
|
|
|
* configure.ac [*mingw32*]: Only add windows-termcap.o to
|
|
|
|
|
CONFIG_OBS if not building with a curses library.
|
|
|
|
|
* configure: Regenerate.
|
|
|
|
|
|
|
|
|
|
* windows-termcap.c: Include defs.h. Make the whole body empty if
|
|
|
|
|
either one of HAVE_CURSES_H or HAVE_NCURSES_H or
|
|
|
|
|
HAVE_NCURSES_NCURSES_H is defined.
|
|
|
|
|
|
2015-01-19 07:51:05 +00:00
|
|
|
|
2015-01-19 Joel Brobecker <brobecker@adacore.com>
|
|
|
|
|
|
|
|
|
|
* rs6000-tdep.c (rs6000_gdbarch_init): Move divide operator
|
|
|
|
|
from end of line to start of next line.
|
|
|
|
|
|
2015-01-17 06:30:59 +00:00
|
|
|
|
2015-01-17 Wei-cheng Wang <cole945@gmail.com>
|
|
|
|
|
|
|
|
|
|
* ppc-linux-tdep.c (ppc_skip_trampoline_code):
|
|
|
|
|
Scan PLT stub backward for reverse debugging.
|
|
|
|
|
* ppc64-tdep.c (ppc64_skip_trampoline_code): Likewise.
|
|
|
|
|
|
2015-01-17 06:30:33 +00:00
|
|
|
|
2015-01-17 Wei-cheng Wang <cole945@gmail.com>
|
|
|
|
|
Ulrich Weigand <uweigand@de.ibm.com>
|
|
|
|
|
|
|
|
|
|
* configure.tgt (powerpc*-*-linux): Add linux-record.o to
|
|
|
|
|
gdb_target_obs.
|
|
|
|
|
(ppc_linux_record_tdep, ppc64_linux_record_tdep): New for linux syscall
|
|
|
|
|
record.
|
|
|
|
|
(ppc_canonicalize_syscall, ppc_linux_syscall_record,
|
|
|
|
|
ppc_linux_record_signal, ppc_init_linux_record_tdep): New functions.
|
|
|
|
|
(ppc_linux_init_abi): Set process_record, process_record_signal.
|
|
|
|
|
* ppc-tdep.h (struct gdbarch_tdep): Add ppc_syscall_record and
|
|
|
|
|
ppc_linux_record_tdep to gdbarch_tdep.
|
|
|
|
|
(ppc_process_record): New declaration.
|
|
|
|
|
* rs6000-tdep.c (ppc_record_vsr, ppc_process_record_op4,
|
|
|
|
|
ppc_process_record_op19, ppc_process_record_op31,
|
|
|
|
|
ppc_process_record_op59, ppc_process_record_op60,
|
|
|
|
|
ppc_process_record_op63, ppc_process_record): New functions.
|
|
|
|
|
|
2015-01-17 06:29:16 +00:00
|
|
|
|
2015-01-17 Wei-cheng Wang <cole945@gmail.com>
|
|
|
|
|
|
|
|
|
|
* rs6000-tdep.c (rs6000_in_function_epilogue_p): Rename to
|
|
|
|
|
rs6000_in_function_epilogue_frame_p and add an argument
|
|
|
|
|
for frame_info.
|
|
|
|
|
(rs6000_epilogue_frame_cache, rs6000_epilogue_frame_this_id,
|
|
|
|
|
rs6000_epilogue_frame_prev_register, rs6000_epilogue_frame_sniffer):
|
|
|
|
|
New functions.
|
|
|
|
|
(rs6000_epilogue_frame_unwind): New.
|
|
|
|
|
(rs6000_gdbarch_init): Append epilogue unwinder.
|
|
|
|
|
|
2015-01-16 16:42:28 +00:00
|
|
|
|
2015-01-16 Sergio Durigan Junior <sergiodj@redhat.com>
|
|
|
|
|
|
|
|
|
|
* nat/linux-personality.c: Replace "#ifndef
|
|
|
|
|
HAVE_DECL_ADDR_NO_RANDOMIZE" by "#if
|
|
|
|
|
!HAVE_DECL_ADDR_NO_RANDOMIZE", fixing a regression in RHEL-5
|
|
|
|
|
systems.
|
|
|
|
|
|
2015-01-16 11:24:20 +00:00
|
|
|
|
2015-01-16 Eli Zaretskii <eliz@gnu.org>
|
|
|
|
|
|
2015-01-16 16:24:16 +00:00
|
|
|
|
* tui/tui-win.c (tui_rehighlight_all, tui_set_var_cmd): New
|
|
|
|
|
functions.
|
|
|
|
|
(_initialize_tui_win) <border-kind, border-mode>:
|
|
|
|
|
<active-border-mode>: Use tui_set_var_cmd as the "set" function.
|
2015-01-16 16:32:42 +00:00
|
|
|
|
(tui_set_tab_width_command): Fix the commentary.
|
|
|
|
|
|
2015-01-16 16:24:16 +00:00
|
|
|
|
* tui/tui-win.h: Add prototype for tui_rehighlight_all.
|
|
|
|
|
|
2015-01-16 11:31:36 +00:00
|
|
|
|
* tui/tui-win.c (tui_scroll_left_command, tui_scroll_right_command):
|
|
|
|
|
Doc fix.
|
2015-01-16 15:46:12 +00:00
|
|
|
|
(tui_set_tab_width_command): Delete and recreate the source and
|
|
|
|
|
the disassembly windows, to show the effect of the changed tab
|
|
|
|
|
size immediately.
|
2015-01-16 11:31:36 +00:00
|
|
|
|
|
2015-01-16 11:24:20 +00:00
|
|
|
|
* tui/tui-data.h (LINE_PREFIX): Make shorter
|
|
|
|
|
(MAX_PID_WIDTH): Enlarge from 14 to 19, to leave enough space for
|
|
|
|
|
"Thread NNNNN.XXXX" thread ID notation on Windows.
|
|
|
|
|
|
2015-01-16 05:39:47 +00:00
|
|
|
|
2015-01-16 Jan Kratochvil <jan.kratochvil@redhat.com>
|
|
|
|
|
|
|
|
|
|
Fix gcc-5 compilation.
|
|
|
|
|
* hppa-tdep.c (inst_saves_gr): Fix parentheses typo.
|
|
|
|
|
|
2015-01-15 20:10:49 +00:00
|
|
|
|
2015-01-15 Sergio Durigan Junior <sergiodj@redhat.com>
|
|
|
|
|
|
|
|
|
|
* Makefile.in (HFILES_NO_SRCDIR): Add nat/linux-personality.h.
|
|
|
|
|
(linux-personality.o): New rule.
|
|
|
|
|
* common/common-defs.h: Include <stdint.h>.
|
|
|
|
|
* config/aarch64/linux.mh (NATDEPFILES): Include
|
|
|
|
|
linux-personality.o.
|
|
|
|
|
* config/alpha/alpha-linux.mh (NATDEPFILES): Likewise.
|
|
|
|
|
* config/arm/linux.mh (NATDEPFILES): Likewise.
|
|
|
|
|
* config/i386/linux64.mh (NATDEPFILES): Likewise.
|
|
|
|
|
* config/i386/linux.mh (NATDEPFILES): Likewise.
|
|
|
|
|
* config/ia64/linux.mh (NATDEPFILES): Likewise.
|
|
|
|
|
* config/m32r/linux.mh (NATDEPFILES): Likewise.
|
|
|
|
|
* config/m68k/linux.mh (NATDEPFILES): Likewise.
|
|
|
|
|
* config/mips/linux.mh (NATDEPFILES): Likewise.
|
|
|
|
|
* config/pa/linux.mh (NATDEPFILES): Likewise.
|
|
|
|
|
* config/powerpc/linux.mh (NATDEPFILES): Likewise.
|
|
|
|
|
* config/powerpc/ppc64-linux.mh (NATDEPFILES): Likewise.
|
|
|
|
|
* config/powerpc/spu-linux.mh (NATDEPFILES): Likewise.
|
|
|
|
|
* config/s390/linux.mh (NATDEPFILES): Likewise.
|
|
|
|
|
* config/sparc/linux64.mh (NATDEPFILES): Likewise.
|
|
|
|
|
* config/sparc/linux.mh (NATDEPFILES): Likewise.
|
|
|
|
|
* config/tilegx/linux.mh (NATDEPFILES): Likewise.
|
|
|
|
|
* config/xtensa/linux.mh (NATDEPFILES): Likewise.
|
|
|
|
|
* defs.h: Remove #include <stdint.h> (moved to
|
|
|
|
|
common/common-defs.h).
|
|
|
|
|
* linux-nat.c: Include nat/linux-personality.h. Remove #include
|
|
|
|
|
<sys/personality.h>; do not define ADDR_NO_RANDOMIZE (moved to
|
|
|
|
|
nat/linux-personality.c).
|
|
|
|
|
(linux_nat_create_inferior): Remove code to disable address space
|
|
|
|
|
randomization (moved to nat/linux-personality.c). Create cleanup
|
|
|
|
|
to disable address space randomization.
|
|
|
|
|
* nat/linux-personality.c: New file.
|
|
|
|
|
* nat/linux-personality.h: Likewise.
|
|
|
|
|
|
2015-01-15 20:09:15 +00:00
|
|
|
|
2015-01-15 Sergio Durigan Junior <sergiodj@redhat.com>
|
|
|
|
|
|
|
|
|
|
* Makefile.in (ALLDEPFILES): Including common/mingw-strerror.c and
|
|
|
|
|
common/posix-strerror.c.
|
|
|
|
|
(posix-strerror.o): New rule.
|
|
|
|
|
(mingw-strerror.o): Likewise.
|
|
|
|
|
* common/common-utils.h (safe_strerror): Move prototype to here,
|
|
|
|
|
from utils.h.
|
|
|
|
|
* common/common.host: New file.
|
|
|
|
|
* common/mingw-strerror.c: Likewise.
|
|
|
|
|
* common/posix-strerror.c: Likewise.
|
|
|
|
|
* configure: Regenerated.
|
|
|
|
|
* configure.ac: Source common/common.host. Add variable
|
|
|
|
|
common_host_obs to gdb_host_obs.
|
|
|
|
|
* contrib/ari/gdb_ari.sh: Mention gdb/common/mingw-strerror.c and
|
|
|
|
|
gdb/common/posix-strerror.c when warning about the use of
|
|
|
|
|
strerror.
|
|
|
|
|
* mingw-hdep.c (safe_strerror): Remove definition; move it to
|
|
|
|
|
common/mingw-strerror.c.
|
|
|
|
|
* posix-hdep.c (safe_strerror): Remove definition; move it to
|
|
|
|
|
common/posix-hdep.c.
|
|
|
|
|
* utils.h (safe_strerror): Remove prototype; move to
|
|
|
|
|
common/common-utils.h.
|
|
|
|
|
|
2015-01-15 11:10:36 +00:00
|
|
|
|
2015-01-15 Joel Brobecker <brobecker@adacore.com>
|
|
|
|
|
|
|
|
|
|
GDB 7.8.2 released.
|
|
|
|
|
|
[Ada] 'first/'last/'length of array whose bound is a discriminant
Consider the following code:
type Table is array (Positive range <>) of Integer;
type Object (N : Integer) is record
Data : Table (1 .. N);
end record;
My_Object : Object := (N => 3, Data => (3, 5, 8));
Trying to print the range and length of the My_Object.Data array yields:
(gdb) print my_object.data'first
$1 = 1
(gdb) print my_object.data'last
$2 = 0
(gdb) print my_object.data'length
$3 = 0
The first one is correct, and that is thanks to the fact that
the lower bound is statically known. However, for the upper
bound, and consequently the array's length, the values are incorrect.
It should be:
(gdb) print my_object.data'last
$2 = 3
(gdb) print my_object.data'length
$3 = 3
What happens here is that ada_array_bound_from_type sees that
our array has a parallel "___XA" type, and therefore tries to
use it. In particular, it described our array's index type as:
[...]___XDLU_1__n, which means lower bound = 1, and upper bound
is value of "n". Unfortunately, ada_array_bound_from_type does
not have access to the discriminant, and is therefore unable to
compute the bound correctly.
Fortunately, at this stage, the bound has already been computed
a while ago, and therefore doesn't need to be re-computed here.
This patch fixes the issue by ignoring that ___XA type if the array
is marked as already fixed.
This also fixes the same issue with packed arrays.
gdb/ChangeLog:
* ada-lang.c (ada_array_bound_from_type): Ignore array's parallel
___XA type if the array has already been fixed.
gdb/testsuite/ChangeLog:
* gdb.ada/var_arr_attrs: New testcase.
2015-01-15 06:09:32 +00:00
|
|
|
|
2015-01-15 Joel Brobecker <brobecker@adacore.com>
|
|
|
|
|
|
|
|
|
|
* ada-lang.c (ada_array_bound_from_type): Ignore array's parallel
|
|
|
|
|
___XA type if the array has already been fixed.
|
|
|
|
|
|
2014-11-28 01:18:26 +00:00
|
|
|
|
2015-01-14 Yao Qi <yao@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* Makefile.in (ppc-linux.o): New rule.
|
|
|
|
|
* config/powerpc/ppc64-linux.mh (NATDEPFILES): Add ppc-linux.o.
|
|
|
|
|
* configure.ac: AC_CHECK_FUNCS(getauxval).
|
|
|
|
|
* config.in: Re-generated.
|
|
|
|
|
* configure: Re-generated.
|
|
|
|
|
* nat/ppc-linux.h [__powerpc64__] (ppc64_64bit_inferior_p):
|
|
|
|
|
Declare.
|
|
|
|
|
* nat/ppc-linux.c: New file.
|
|
|
|
|
* ppc-linux-nat.c (ppc_linux_target_wordsize) [__powerpc64__]:
|
|
|
|
|
Call ppc64_64bit_inferior_p.
|
|
|
|
|
|
Move some ppc macros to nat/ppc-linux.h
When I use PPC_FEATURE_BOOKE in GDBserver, I find it is defined in GDB
but not in GDBserver. After taking a further look, I find some macros
are duplicated between ppc-linux-nat.c and linux-ppc-low.c, so this
patch is to move them into nat/ppc-linux.h.
gdb/gdbserver:
2015-01-14 Yao Qi <yao@codesourcery.com>
* linux-ppc-low.c: Include "nat/ppc-linux.h".
(PPC_FEATURE_HAS_VSX): Move to nat/ppc-linux.h.
(PPC_FEATURE_HAS_ALTIVEC, PPC_FEATURE_HAS_SPE): Likewise.
(PT_ORIG_R3, PT_TRAP): Likewise.
(PTRACE_GETVSXREGS, PTRACE_SETVSXREGS): Likewise.
(PTRACE_GETVRREGS, PTRACE_SETVRREGS): Likewise.
(PTRACE_GETEVRREGS, PTRACE_SETEVRREGS): Likewise.
gdb:
2015-01-14 Yao Qi <yao@codesourcery.com>
* ppc-linux-nat.c (PT_ORIG_R3, PT_TRAP): Move to
nat/ppc-linux.h.
(PPC_FEATURE_CELL, PPC_FEATURE_BOOKE): Likewise.
(PPC_FEATURE_HAS_DFP): Likewise.
(PTRACE_GETVRREGS, PTRACE_SETVRREGS): Likewise.
(PTRACE_GETVSXREGS, PTRACE_SETVSXREGS): Likewise.
(PTRACE_GETEVRREGS, PTRACE_SETEVRREGS): Likewise.
Include "nat/ppc-linux.h".
* nat/ppc-linux.h: New file.
* Makefile.in (HFILES_NO_SRCDIR): Add nat/ppc-linux.h.
2015-01-08 09:23:55 +00:00
|
|
|
|
2015-01-14 Yao Qi <yao@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* ppc-linux-nat.c (PT_ORIG_R3, PT_TRAP): Move to
|
|
|
|
|
nat/ppc-linux.h.
|
|
|
|
|
(PPC_FEATURE_CELL, PPC_FEATURE_BOOKE): Likewise.
|
|
|
|
|
(PPC_FEATURE_HAS_DFP): Likewise.
|
|
|
|
|
(PTRACE_GETVRREGS, PTRACE_SETVRREGS): Likewise.
|
|
|
|
|
(PTRACE_GETVSXREGS, PTRACE_SETVSXREGS): Likewise.
|
|
|
|
|
(PTRACE_GETEVRREGS, PTRACE_SETEVRREGS): Likewise.
|
|
|
|
|
Include "nat/ppc-linux.h".
|
|
|
|
|
* nat/ppc-linux.h: New file.
|
|
|
|
|
* Makefile.in (HFILES_NO_SRCDIR): Add nat/ppc-linux.h.
|
|
|
|
|
|
PR17525 - breakpoint commands not executed when program run from -x script
Executing a gdb script that runs the inferior (from the command line
with -x), and has it hit breakpoints with breakpoint commands that
themselves run the target, is currently broken on async targets
(Linux, remote).
While we're executing a command list or a script, we force the
interpreter to be sync, which results in some functions nesting an
event loop and waiting for the target to stop, instead of returning
immediately and having the top level event loop handle the stop.
The issue with this bug is simply that bpstat_do_actions misses
checking whether the interpreter is sync. When we get here, in the
case of executing a script (or, when the interpreter is sync), the
program has already advanced to the next breakpoint, through
maybe_wait_sync_command_done. We need to process its breakpoints
immediately, just like with a sync target.
Tested on x86_64 Fedora 20.
gdb/
2015-01-14 Pedro Alves <palves@redhat.com>
PR gdb/17525
* breakpoint.c: Include "interps.h".
(bpstat_do_actions_1): Also check whether the interpreter is
async.
gdb/testsuite/
2015-01-14 Pedro Alves <palves@redhat.com>
Joel Brobecker <brobecker@adacore.com>
PR gdb/17525
* gdb.base/bp-cmds-execution-x-script.c: New file.
* gdb.base/bp-cmds-execution-x-script.exp: New file.
* gdb.base/bp-cmds-execution-x-script.gdb: New file.
2015-01-12 19:30:08 +00:00
|
|
|
|
2015-01-14 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
PR gdb/17525
|
|
|
|
|
* breakpoint.c: Include "interps.h".
|
|
|
|
|
(bpstat_do_actions_1): Also check whether the interpreter is
|
|
|
|
|
async.
|
|
|
|
|
|
PR cli/17828: -batch -ex r breaks terminal
Commit d3d4baed (PR python/17372 - Python hangs when displaying
help()) had the side effect of causing 'gdb -batch' to leave the
terminal in the wrong state if the program was run. E.g,.
$ echo 'main(){*(int*)0=0;}' | gcc -x c -; ./gdb/gdb -batch -ex r ./a.out
Program received signal SIGSEGV, Segmentation fault.
0x00000000004004ff in main ()
$
If you start typing the next command, seemingly nothing happens - GDB
left the terminal with echo disabled.
The issue is that that "r" ends up in fetch_inferior_event, which
calls reinstall_readline_callback_handler_cleanup, which causes
readline to prep the terminal (raw, echo disabled). But "-batch"
causes GDB to exit before the top level event loop is first started,
and then nothing de-preps the terminal.
The reinstall_readline_callback_handler_cleanup function's intro
comment mentions:
"Need to do this as we go back to the event loop, ready to process
further input."
but the implementation forgets the case of when the interpreter is
sync, which indicates we won't return to the event loop yet, or as in
the case of -batch, we have not started it yet.
The fix is to not install the readline callback in that case.
For the test, in this case, checking that command echo still works is
sufficient. Comparing stty output before/after running GDB is even
better. Because stty may not be available, the test tries both ways.
In any case, since expect's spawn (what we use to start gdb) creates a
new pseudo tty, another expect spawn or tcl exec after GDB exits would
not see the wrong terminal settings. So instead, the test spawns a
shell and runs stty and GDB in it.
Tested on x86_64 Fedora 20.
gdb/
2015-01-14 Pedro Alves <palves@redhat.com>
PR cli/17828
* infrun.c (reinstall_readline_callback_handler_cleanup): Don't
reinstall if the interpreter is sync.
gdb/testsuite/
2015-01-14 Pedro Alves <palves@redhat.com>
PR cli/17828
* gdb.base/batch-preserve-term-settings.c: New file.
* gdb.base/batch-preserve-term-settings.exp: New file.
2015-01-14 11:51:06 +00:00
|
|
|
|
2015-01-14 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
PR cli/17828
|
|
|
|
|
* infrun.c (reinstall_readline_callback_handler_cleanup): Don't
|
|
|
|
|
reinstall if the interpreter is sync.
|
|
|
|
|
|
2015-01-14 01:00:31 +00:00
|
|
|
|
2015-01-13 Doug Evans <dje@google.com>
|
|
|
|
|
|
|
|
|
|
* objfiles.c (objfile_filename): New function.
|
|
|
|
|
* objfiles.h (objfile_filename): Declare it.
|
|
|
|
|
(objfile_name): Add function comment.
|
|
|
|
|
* python/py-objfile.c (objfpy_lookup_objfile_by_name): Try both the
|
|
|
|
|
bfd file name (which may be realpath'd), and the original name.
|
|
|
|
|
|
2015-01-13 12:24:45 +00:00
|
|
|
|
2015-01-13 Joel Brobecker <brobecker@adacore.com>
|
|
|
|
|
|
|
|
|
|
* NEWS: Create a new section for the next release branch.
|
|
|
|
|
Rename the section of the current branch, now that it has
|
|
|
|
|
been cut.
|
|
|
|
|
|
2015-01-13 12:16:07 +00:00
|
|
|
|
2015-01-13 Joel Brobecker <brobecker@adacore.com>
|
|
|
|
|
|
|
|
|
|
GDB 7.9 branch created (92fc2e6978d9a7c8324c7e851dbee59e22ec7a37):
|
|
|
|
|
* version.in: Bump version to 7.9.50.DATE-cvs.
|
|
|
|
|
|
2015-01-13 10:36:34 +00:00
|
|
|
|
2015-01-13 Joel Brobecker <brobecker@adacore.com>
|
|
|
|
|
|
|
|
|
|
* nat/linux-procfs.c (linux_proc_attach_tgid_threads):
|
|
|
|
|
Remove trailing new-line in argument of call to warning.
|
|
|
|
|
|
2015-01-13 10:35:49 +00:00
|
|
|
|
2015-01-13 Joel Brobecker <brobecker@adacore.com>
|
|
|
|
|
|
|
|
|
|
* linux-nat.c (attach_proc_task_lwp_callback): Remove trailing
|
|
|
|
|
new-line in argument of call to "warning".
|
|
|
|
|
|
2015-01-12 11:46:34 +00:00
|
|
|
|
2015-01-13 Joel Brobecker <brobecker@adacore.com>
|
|
|
|
|
|
|
|
|
|
* ada-lang.c (ada_lookup_symbol_nonlocal): If name not found
|
|
|
|
|
in static block, then try searching for primitive types.
|
|
|
|
|
|
2015-01-12 22:51:33 +00:00
|
|
|
|
2015-01-12 Patrick Palka <patrick@parcs.ath.cx>
|
|
|
|
|
|
|
|
|
|
* top.h (gdb_add_history): Declare.
|
|
|
|
|
* top.c (command_count): New variable.
|
|
|
|
|
(gdb_add_history): New function.
|
|
|
|
|
(gdb_safe_append_history): New static function.
|
|
|
|
|
(quit_force): Call it.
|
|
|
|
|
(command_line_input): Use gdb_add_history instead of
|
|
|
|
|
add_history.
|
|
|
|
|
* event-top.c (command_line_handler): Likewise.
|
|
|
|
|
|
2015-01-12 17:13:54 +00:00
|
|
|
|
2015-01-12 James Clarke <jrtc27@jrtc27.com> (tiny patch)
|
|
|
|
|
|
|
|
|
|
PR gdb/17046
|
|
|
|
|
* darwin-nat.c: Replace <machine/setjmp.h> #include by
|
|
|
|
|
<setjmp.h> #include.
|
|
|
|
|
|
2015-01-12 00:39:46 +00:00
|
|
|
|
2015-01-11 Doug Evans <xdje42@gmail.com>
|
|
|
|
|
|
|
|
|
|
* dwarf2read.c (compute_delayed_physnames): Use TYPE_FN_FIELD_PHYSNAME.
|
|
|
|
|
|
2015-01-11 22:06:34 +00:00
|
|
|
|
2015-01-11 Doug Evans <xdje42@gmail.com>
|
|
|
|
|
|
|
|
|
|
PR gdb/15830
|
|
|
|
|
* NEWS: The "maint demangle" command is renamed as "demangle".
|
|
|
|
|
* demangle.c: #include cli/cli-utils.h, language.h.
|
|
|
|
|
(demangle_command): New function.
|
|
|
|
|
(_initialize_demangle): Add new command "demangle".
|
|
|
|
|
* maint.c (maintenance_demangle): Stub out.
|
|
|
|
|
(_initialize_maint_cmds): Update help text for "maint demangle",
|
|
|
|
|
and mark as deprecated.
|
|
|
|
|
|
2015-01-11 21:16:11 +00:00
|
|
|
|
2015-01-11 Mark Kettenis <kettenis@gnu.org>
|
|
|
|
|
|
|
|
|
|
* inf-ptrace.c (inf_ptrace_follow_fork): Adjust now that
|
|
|
|
|
inferior_thread is a function.
|
|
|
|
|
|
2014-11-30 16:47:16 +00:00
|
|
|
|
2015-01-09 Patrick Palka <patrick@parcs.ath.cx>
|
|
|
|
|
|
|
|
|
|
* Makefile.in (.y.c): Don't munge yacc's #line
|
|
|
|
|
directives.
|
|
|
|
|
|
2015-01-09 18:27:56 +00:00
|
|
|
|
2015-01-09 Patrick Palka <patrick@parcs.ath.cx>
|
|
|
|
|
|
|
|
|
|
* utils.c (defaulted_query): Rewrite to use gdb_readline_wrapper
|
|
|
|
|
to prompt for input.
|
|
|
|
|
* tui/tui-hooks.c (tui_query_hook): Remove.
|
|
|
|
|
(tui_install_hooks): Don't set deprecated_query_hook.
|
|
|
|
|
* tui/tui-io.c (tui_redisplay_readline): Fix off-by-one error in
|
|
|
|
|
height calculation. Always update the command window's cur_line.
|
|
|
|
|
|
linux-nat.c: better starvation avoidance, handle non-stop mode too
Running the testsuite with a series that reimplements user-visible
all-stop behavior on top of a target running in non-stop mode revealed
problems related to event starvation avoidance.
For example, I see
gdb.threads/signal-while-stepping-over-bp-other-thread.exp failing.
What happens is that GDB core never gets to see the signal event. It
ends up processing the events for the same threads over an over,
because Linux's waitpid(-1, ...) returns that first task in the task
list that has an event, starving threads on the tail of the task list.
So I wrote a non-stop mode test originally inspired by
signal-while-stepping-over-bp-other-thread.exp, to stress this
independently of all-stop on top of non-stop. Fixing it required the
changes described below. The test will be added in a following
commit.
1) linux-nat.c has code in place that picks an event LWP at random out
of all that have had events. This is because on the kernel side,
"waitpid(-1, ...)" just walks the task list linearly looking for the
first that had an event. But, this code is currently only used in
all-stop mode. So with a multi-threaded program that has multiple
events triggering debug events in parallel, GDB ends up starving some
threads.
To make the event randomization work in non-stop mode too, the patch
makes us pull out all the already pending events on the kernel side,
with waitpid, before deciding which LWP to report to the core.
There's some code in linux_wait that takes care of leaving events
pending if they were for LWPs the caller is not interested in. The
patch moves that to linux_nat_filter_event, so that we only have one
place that leaves events pending. With that in place, conceptually,
the flow is simpler and more normalized:
#1 - walk the LWP list looking for an LWP with a pending event to report.
#2 - if no pending event, pull events out of the kernel, and store
them in the LWP structures as pending.
#3- goto #1.
2) Then, currently the event randomization code only considers SIGTRAP
(or trap-like) events. That means that if e.g., have have multiple
threads stepping in parallel that hit a breakpoint that needs stepping
over, and one gets a signal, the signal may end up never getting
processed, because GDB will always be giving priority to the SIGTRAPs.
The patch fixes this by making the randomization code consider all
kinds of pending events.
3) If multiple threads hit a breakpoint, we report one of those, and
"cancel" the others. Cancelling means decrementing the PC, and
discarding the event. If the next time the LWP is resumed the
breakpoint is still installed, the LWP should hit it again, and we'll
report the hit then. The problem I found is that this delays threads
from advancing too much, with the kernel potentially ending up
scheduling the same threads over and over, and others not advancing.
So the patch switches away from cancelling the breakpoints, and
instead remembering that the LWP had stopped for a breakpoint. If on
resume the breakpoint is still installed, we report it. If it's no
longer installed, we discard the pending event then. This is actually
how GDBserver used to handle this before d50171e4 (Teach linux
gdbserver to step-over-breakpoints), but with the difference that back
then we'd delay adjusting the PC until resuming, which made it so that
"info threads" could wrongly see threads with unadjusted PCs.
gdb/
2015-01-09 Pedro Alves <palves@redhat.com>
* breakpoint.c (hardware_breakpoint_inserted_here_p): New
function.
* breakpoint.h (hardware_breakpoint_inserted_here_p): New
declaration.
* linux-nat.c (linux_nat_status_is_event): Move higher up in file.
(linux_resume_one_lwp): Store the thread's PC. Adjust to clear
stop_reason.
(check_stopped_by_watchpoint): New function.
(save_sigtrap): Reimplement.
(linux_nat_stopped_by_watchpoint): Adjust.
(linux_nat_lp_status_is_event): Delete.
(stop_wait_callback): Only call save_sigtrap after storing the
pending status.
(status_callback): If the thread had been stopped for a breakpoint
that has since been removed, discard the event and resume the LWP.
(count_events_callback, select_event_lwp_callback): Use
lwp_status_pending_p instead of linux_nat_lp_status_is_event.
(cancel_breakpoint): Rename to ...
(check_stopped_by_breakpoint): ... this. Record whether the LWP
stopped for a software breakpoint or hardware breakpoint.
(select_event_lwp): Only give preference to the stepping LWP in
all-stop mode. Adjust comments.
(stop_and_resume_callback): Remove references to new_pending_p.
(linux_nat_filter_event): Likewise. Leave exit events of the
leader thread pending here. Handle signal short circuiting here.
Only call save_sigtrap after storing the pending waitstatus.
(linux_nat_wait_1): Remove 'retry' label. Remove references to
new_pending. Don't handle leaving events the caller is not
interested in pending here, nor handle signal short-circuiting
here. Also give equal priority to all LWPs that have had events
in non-stop mode. If reporting a software breakpoint event,
unadjust the LWP's PC.
* linux-nat.h (enum lwp_stop_reason): New.
(struct lwp_info) <stop_pc>: New field.
(struct lwp_info) <stopped_by_watchpoint>: Delete field.
(struct lwp_info) <stop_reason>: New field.
* x86-linux-nat.c (x86_linux_prepare_to_resume): Adjust.
2015-01-07 12:48:32 +00:00
|
|
|
|
2015-01-09 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* breakpoint.c (hardware_breakpoint_inserted_here_p): New
|
|
|
|
|
function.
|
|
|
|
|
* breakpoint.h (hardware_breakpoint_inserted_here_p): New
|
|
|
|
|
declaration.
|
|
|
|
|
* linux-nat.c (linux_nat_status_is_event): Move higher up in file.
|
|
|
|
|
(linux_resume_one_lwp): Store the thread's PC. Adjust to clear
|
|
|
|
|
stop_reason.
|
|
|
|
|
(check_stopped_by_watchpoint): New function.
|
|
|
|
|
(save_sigtrap): Reimplement.
|
|
|
|
|
(linux_nat_stopped_by_watchpoint): Adjust.
|
|
|
|
|
(linux_nat_lp_status_is_event): Delete.
|
|
|
|
|
(stop_wait_callback): Only call save_sigtrap after storing the
|
|
|
|
|
pending status.
|
|
|
|
|
(status_callback): If the thread had been stopped for a breakpoint
|
|
|
|
|
that has since been removed, discard the event and resume the LWP.
|
|
|
|
|
(count_events_callback, select_event_lwp_callback): Use
|
|
|
|
|
lwp_status_pending_p instead of linux_nat_lp_status_is_event.
|
|
|
|
|
(cancel_breakpoint): Rename to ...
|
|
|
|
|
(check_stopped_by_breakpoint): ... this. Record whether the LWP
|
|
|
|
|
stopped for a software breakpoint or hardware breakpoint.
|
|
|
|
|
(select_event_lwp): Only give preference to the stepping LWP in
|
|
|
|
|
all-stop mode. Adjust comments.
|
|
|
|
|
(stop_and_resume_callback): Remove references to new_pending_p.
|
|
|
|
|
(linux_nat_filter_event): Likewise. Leave exit events of the
|
|
|
|
|
leader thread pending here. Handle signal short circuiting here.
|
|
|
|
|
Only call save_sigtrap after storing the pending waitstatus.
|
|
|
|
|
(linux_nat_wait_1): Remove 'retry' label. Remove references to
|
|
|
|
|
new_pending. Don't handle leaving events the caller is not
|
|
|
|
|
interested in pending here, nor handle signal short-circuiting
|
|
|
|
|
here. Also give equal priority to all LWPs that have had events
|
|
|
|
|
in non-stop mode. If reporting a software breakpoint event,
|
|
|
|
|
unadjust the LWP's PC.
|
|
|
|
|
* linux-nat.h (enum lwp_stop_reason): New.
|
|
|
|
|
(struct lwp_info) <stop_pc>: New field.
|
|
|
|
|
(struct lwp_info) <stopped_by_watchpoint>: Delete field.
|
|
|
|
|
(struct lwp_info) <stop_reason>: New field.
|
|
|
|
|
* x86-linux-nat.c (x86_linux_prepare_to_resume): Adjust.
|
|
|
|
|
|
linux-nat.c: always mark execing LWP as resumed
A subsequent patch will make the Linux backend's target_wait method
pull all events out of the kernel (with waitpid) and store them as
pending status in the LWP structure if no pending status was already
available. Then, the backend goes over the pending statuses and pick
one to report to the core.
With that, the existing thread-execl.exp test exposes a bug, like:
(gdb) set scheduler-locking on
(gdb) PASS: gdb.threads/thread-execl.exp: schedlock on: set scheduler-locking on
next
FAIL: gdb.threads/thread-execl.exp: schedlock on: get to main in new image (timeout)
Recall that when the non-leader thread execs, all threads in the
process die, the execing thread changes its pid to the tgid, and then
waitpid returns an exec event to the tgid. If GDB didn't resume the
leader LWP, then GDB sees an event for an LWP that was supposedly
stopped, and thus not marked as resumed. Because the code that picks
a pending event to report to the core ignores not-resumed LWPs:
/* Return non-zero if LP has a wait status pending. */
static int
status_callback (struct lwp_info *lp, void *data)
{
/* Only report a pending wait status if we pretend that this has
indeed been resumed. */
if (!lp->resumed)
return 0;
the event ends up pending forever, thus the timeout.
gdb/
2015-01-09 Pedro Alves <palves@redhat.com>
* linux-nat.c (linux_handle_extended_wait) <PTRACE_EVENT_EXEC>:
Set the LWP's 'resumed' flag.
2014-12-29 19:41:06 +00:00
|
|
|
|
2015-01-09 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* linux-nat.c (linux_handle_extended_wait) <PTRACE_EVENT_EXEC>:
|
|
|
|
|
Set the LWP's 'resumed' flag.
|
|
|
|
|
|
2015-01-07 19:41:06 +00:00
|
|
|
|
2015-01-09 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* linux-nat.c (linux_resume_one_lwp): New function.
|
|
|
|
|
(resume_lwp): Use lwp_status_pending_p and linux_resume_one_lwp.
|
|
|
|
|
(linux_nat_resume): Use lwp_status_pending_p and
|
|
|
|
|
linux_resume_one_lwp.
|
|
|
|
|
(linux_handle_syscall_trap): Use linux_resume_one_lwp.
|
|
|
|
|
(linux_handle_extended_wait): Use linux_resume_one_lwp.
|
|
|
|
|
(status_callback, running_callback): Use lwp_status_pending_p.
|
|
|
|
|
(lwp_status_pending_p): New function.
|
|
|
|
|
(stop_and_resume_callback): Use lwp_status_pending_p.
|
|
|
|
|
(linux_nat_filter_event): Use linux_resume_one_lwp.
|
|
|
|
|
(linux_nat_wait_1): Always use status_callback to look for an LWP
|
|
|
|
|
with a pending status. Use linux_resume_one_lwp.
|
|
|
|
|
(resume_stopped_resumed_lwps): Use lwp_status_pending_p and
|
|
|
|
|
linux_resume_one_lwp.
|
|
|
|
|
|
2014-12-29 19:41:05 +00:00
|
|
|
|
2015-01-09 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* breakpoint.c (bp_location_inserted_here_p): New function,
|
|
|
|
|
factored out from ...
|
|
|
|
|
(breakpoint_inserted_here_p): ... here. Use
|
|
|
|
|
ALL_BP_LOCATIONS_AT_ADDR.
|
|
|
|
|
(software_breakpoint_inserted_here_p): Use
|
|
|
|
|
bp_location_inserted_here_p and ALL_BP_LOCATIONS_AT_ADDR.
|
|
|
|
|
|
Linux: Skip thread_db thread event reporting if PTRACE_EVENT_CLONE is supported
[A test I wrote stumbled on a libthread_db issue related to thread
event breakpoints. See glibc PR17705:
[nptl_db: stale thread create/death events if debugger detaches]
https://sourceware.org/bugzilla/show_bug.cgi?id=17705
This patch avoids that whole issue by making GDB stop using thread
event breakpoints in the first place, which is good for other reasons
as well, anyway.]
Before PTRACE_EVENT_CLONE (Linux 2.6), the only way to learn about new
threads in the inferior (to attach to them) or to learn about thread
exit was to coordinate with the inferior's glibc/runtime, using
libthread_db. That works by putting a breakpoint at a magic address
which is called when a new thread is spawned, or when a thread is
about to exit. When that breakpoint is hit, all threads are stopped,
and then GDB coordinates with libthread_db to read data structures out
of the inferior to learn about what happened. Then the breakpoint is
single-stepped, and then all threads are re-resumed. This isn't very
efficient (stops all threads) and is more fragile (inferior's thread
list in memory may be corrupt; libthread_db bugs, etc.) than ideal.
When the kernel supports PTRACE_EVENT_CLONE (which we already make use
of), there's really no need to use libthread_db's event reporting
mechanism to learn about new LWPs. And if the kernel supports that,
then we learn about LWP exits through regular WIFEXITED wait statuses,
so no need for the death event breakpoint either.
GDBserver has been likewise skipping the thread_db events for a long
while:
https://sourceware.org/ml/gdb-patches/2007-10/msg00547.html
There's one user-visible difference: we'll no longer print about
threads being created and exiting while the program is running, like:
[Thread 0x7ffff7dbb700 (LWP 30670) exited]
[New Thread 0x7ffff7db3700 (LWP 30671)]
[Thread 0x7ffff7dd3700 (LWP 30667) exited]
[New Thread 0x7ffff7dab700 (LWP 30672)]
[Thread 0x7ffff7db3700 (LWP 30671) exited]
[Thread 0x7ffff7dcb700 (LWP 30668) exited]
This is exactly the same behavior as when debugging against remote
targets / gdbserver. I actually think that's a good thing (and as
such have listed this in the local/remote parity wiki page a while
ago), as the printing slows down the inferior. It's also a
distraction to keep bothering the user about short-lived threads that
she won't be able to interact with anyway. Instead, the user (and
frontend) will be informed about new threads that currently exist in
the program when the program next stops:
(gdb) c
...
* ctrl-c *
[New Thread 0x7ffff7963700 (LWP 7797)]
[New Thread 0x7ffff796b700 (LWP 7796)]
Program received signal SIGINT, Interrupt.
[Switching to Thread 0x7ffff796b700 (LWP 7796)]
clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:81
81 testq %rax,%rax
(gdb) info threads
A couple of tests had assumptions on GDB thread numbers that no longer
hold.
Tested on x86_64 Fedora 20.
gdb/
2014-01-09 Pedro Alves <palves@redhat.com>
Skip enabling event reporting if the kernel supports
PTRACE_EVENT_CLONE.
* linux-thread-db.c: Include "nat/linux-ptrace.h".
(thread_db_use_events): New function.
(try_thread_db_load_1): Check thread_db_use_events before enabling
event reporting.
(update_thread_state): New function.
(attach_thread): Use it. Check thread_db_use_events before
enabling event reporting.
(thread_db_detach): Check thread_db_use_events before disabling
event reporting.
(find_new_threads_callback): Check thread_db_use_events before
enabling event reporting. Update the thread's state if not using
libthread_db events.
gdb/testsuite/
2014-01-09 Pedro Alves <palves@redhat.com>
* gdb.threads/fork-thread-pending.exp: Switch to the main thread
instead of to thread 2.
* gdb.threads/signal-command-multiple-signals-pending.c (main):
Add barrier around each pthread_create call instead of around all
calls.
* gdb.threads/signal-command-multiple-signals-pending.exp (test):
Set a break on thread_function and have the child threads hit it
one at at a time.
2014-12-16 16:12:25 +00:00
|
|
|
|
2014-01-09 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
Skip enabling event reporting if the kernel supports
|
|
|
|
|
PTRACE_EVENT_CLONE.
|
|
|
|
|
* linux-thread-db.c: Include "nat/linux-ptrace.h".
|
|
|
|
|
(thread_db_use_events): New function.
|
|
|
|
|
(try_thread_db_load_1): Check thread_db_use_events before enabling
|
|
|
|
|
event reporting.
|
|
|
|
|
(update_thread_state): New function.
|
|
|
|
|
(attach_thread): Use it. Check thread_db_use_events before
|
|
|
|
|
enabling event reporting.
|
|
|
|
|
(thread_db_detach): Check thread_db_use_events before disabling
|
|
|
|
|
event reporting.
|
|
|
|
|
(find_new_threads_callback): Check thread_db_use_events before
|
|
|
|
|
enabling event reporting. Update the thread's state if not using
|
|
|
|
|
libthread_db events.
|
|
|
|
|
|
libthread_db: Skip attaching to terminated and joined threads
I wrote a test that attaches to a program that constantly spawns
short-lived threads, which exposed several issues. This is one of
them.
On GNU/Linux, attaching to a multi-threaded program sometimes prints
out warnings like:
...
[New LWP 20700]
warning: unable to open /proc file '/proc/-1/status'
[New LWP 20850]
[New LWP 21019]
...
That happens because when a thread exits, and is joined, glibc does:
nptl/pthread_join.c:
pthread_join ()
{
...
if (__glibc_likely (result == 0))
{
/* We mark the thread as terminated and as joined. */
pd->tid = -1;
...
/* Free the TCB. */
__free_tcb (pd);
}
So if we attach or interrupt the program (which does an implicit "info
threads") at just the right (or rather, wrong) time, we can find and
return threads in the libthread_db/pthreads thread list with kernel
thread ID -1. I've filed glibc PR nptl/17707 for this. You'll find
more info there.
This patch handles this as a special case in GDB.
This is actually more than just a cosmetic issue. lin_lwp_attach_lwp
will think that this -1 is an LWP we're not attached to yet, and after
failing to attach will try to check we were already attached to the
process, using a waitpid call, which in this case ends up being
"waitpid (-1, ...", which obviously results in GDB potentially
discarding an event when it shouldn't...
Tested on x86_64 Fedora 20, native and gdbserver.
gdb/gdbserver/
2015-01-09 Pedro Alves <palves@redhat.com>
* thread-db.c (find_new_threads_callback): Ignore thread if the
kernel thread ID is -1.
gdb/
2015-01-09 Pedro Alves <palves@redhat.com>
* linux-nat.c (lin_lwp_attach_lwp): Assert that the lwp id we're
about to wait for is > 0.
* linux-thread-db.c (find_new_threads_callback): Ignore thread if
the kernel thread ID is -1.
2014-12-16 16:12:24 +00:00
|
|
|
|
2015-01-09 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* linux-nat.c (lin_lwp_attach_lwp): Assert that the lwp id we're
|
|
|
|
|
about to wait for is > 0.
|
|
|
|
|
* linux-thread-db.c (find_new_threads_callback): Ignore thread if
|
|
|
|
|
the kernel thread ID is -1.
|
|
|
|
|
|
Linux: on attach, attach to lwps listed under /proc/$pid/task/
... instead of relying on libthread_db.
I wrote a test that attaches to a program that constantly spawns
short-lived threads, which exposed several issues. This is one of
them.
On Linux, we need to attach to all threads of a process (thread group)
individually. We currently rely on libthread_db to list the threads,
but that is problematic, because libthread_db relies on reading data
structures out of the inferior (which may well be corrupted). If
threads are being created or exiting just while we try to attach, we
may trip on inconsistencies in the inferior's thread list. To work
around that, when we see a seemingly corrupt list, we currently retry
a few times:
static void
thread_db_find_new_threads_2 (ptid_t ptid, int until_no_new)
{
...
if (until_no_new)
{
/* Require 4 successive iterations which do not find any new threads.
The 4 is a heuristic: there is an inherent race here, and I have
seen that 2 iterations in a row are not always sufficient to
"capture" all threads. */
...
That heuristic may well fail, and when it does, we end up with threads
in the program that aren't under GDB's control. That's obviously bad
and results in quite mistifying failures, like e.g., the process dying
for seeminly no reason when a thread that wasn't attached trips on a
breakpoint.
There's really no reason to rely on libthread_db for this nowadays
when we have /proc mounted. In that case, which is the usual case, we
can list the LWPs from /proc/PID/task/. In fact, GDBserver is already
doing this. The patch factors out that code that knows to walk the
task/ directory out of GDBserver, and makes GDB use it too.
Like GDBserver, the patch makes GDB attach to LWPs and _not_ wait for
them to stop immediately. Instead, we just tag the LWP as having an
expected stop. Because we can only set the ptrace options when the
thread stops, we need a new flag in the lwp structure to keep track of
whether we've already set the ptrace options, just like in GDBserver.
Note that nothing issues any ptrace command to the threads between the
PTRACE_ATTACH and the stop, so this is safe (unlike one scenario
described in gdbserver's linux-low.c).
When we attach to a program that has threads exiting while we attach,
it's easy to race with a thread just exiting as we try to attach to
it, like:
#1 - get current list of threads
#2 - attach to each listed thread
#3 - ooops, attach failed, thread is already gone
As this is pretty normal, we shouldn't be issuing a scary warning in
step #3.
When #3 happens, PTRACE_ATTACH usually fails with ESRCH, but sometimes
we'll see EPERM as well. That happens when the kernel still has the
thread in its task list, but the thread is marked as dead.
Unfortunately, EPERM is ambiguous and we'll get it also on other
scenarios where the thread isn't dead, and in those cases, it's useful
to get a warning. To distiguish the cases, when we get an EPERM
failure, we open /proc/PID/status, and check the thread's state -- if
the /proc file no longer exists, or the state is "Z (Zombie)" or "X
(Dead)", we ignore the EPERM error silently; otherwise, we'll warn.
Unfortunately, there seems to be a kernel race here. Sometimes I get
EPERM, and then the /proc state still indicates "R (Running)"... If
we wait a bit and retry, we do end up seeing X or Z state, or get an
ESRCH. I thought of making GDB retry the attach a few times, but even
with a 500ms wait and 4 retries, I still see the warning sometimes. I
haven't been able to identify the kernel path that causes this yet,
but in any case, it looks like a kernel bug to me. As this just
results failure to suppress a warning that we've been printing since
about forever anyway, I'm just making the test cope with it, and issue
an XFAIL.
gdb/gdbserver/
2015-01-09 Pedro Alves <palves@redhat.com>
* linux-low.c (linux_attach_fail_reason_string): Move to
nat/linux-ptrace.c, and rename.
(linux_attach_lwp): Update comment.
(attach_proc_task_lwp_callback): New function.
(linux_attach): Adjust to rename and use
linux_proc_attach_tgid_threads.
(linux_attach_fail_reason_string): Delete declaration.
gdb/
2015-01-09 Pedro Alves <palves@redhat.com>
* linux-nat.c (attach_proc_task_lwp_callback): New function.
(linux_nat_attach): Use linux_proc_attach_tgid_threads.
(wait_lwp, linux_nat_filter_event): If not set yet, set the lwp's
ptrace option flags.
* linux-nat.h (struct lwp_info) <must_set_ptrace_flags>: New
field.
* nat/linux-procfs.c: Include <dirent.h>.
(linux_proc_get_int): New parameter "warn". Handle it.
(linux_proc_get_tgid): Adjust.
(linux_proc_get_tracerpid): Rename to ...
(linux_proc_get_tracerpid_nowarn): ... this.
(linux_proc_pid_get_state): New function, factored out from
(linux_proc_pid_has_state): ... this. Add new parameter "warn"
and handle it.
(linux_proc_pid_is_gone): New function.
(linux_proc_pid_is_stopped): Adjust.
(linux_proc_pid_is_zombie_maybe_warn)
(linux_proc_pid_is_zombie_nowarn): New functions.
(linux_proc_pid_is_zombie): Use
linux_proc_pid_is_zombie_maybe_warn.
(linux_proc_attach_tgid_threads): New function.
* nat/linux-procfs.h (linux_proc_get_tgid): Update comment.
(linux_proc_get_tracerpid): Rename to ...
(linux_proc_get_tracerpid_nowarn): ... this, and update comment.
(linux_proc_pid_is_gone): New declaration.
(linux_proc_pid_is_zombie): Update comment.
(linux_proc_pid_is_zombie_nowarn): New declaration.
(linux_proc_attach_lwp_func): New typedef.
(linux_proc_attach_tgid_threads): New declaration.
* nat/linux-ptrace.c (linux_ptrace_attach_fail_reason): Adjust to
use nowarn functions.
(linux_ptrace_attach_fail_reason_string): Move here from
gdbserver/linux-low.c and rename.
(ptrace_supports_feature): If the current ptrace options are not
known yet, check them now, instead of asserting.
* nat/linux-ptrace.h (linux_ptrace_attach_fail_reason_string):
Declare.
2014-12-16 16:12:24 +00:00
|
|
|
|
2015-01-09 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* linux-nat.c (attach_proc_task_lwp_callback): New function.
|
|
|
|
|
(linux_nat_attach): Use linux_proc_attach_tgid_threads.
|
|
|
|
|
(wait_lwp, linux_nat_filter_event): If not set yet, set the lwp's
|
|
|
|
|
ptrace option flags.
|
|
|
|
|
* linux-nat.h (struct lwp_info) <must_set_ptrace_flags>: New
|
|
|
|
|
field.
|
|
|
|
|
* nat/linux-procfs.c: Include <dirent.h>.
|
|
|
|
|
(linux_proc_get_int): New parameter "warn". Handle it.
|
|
|
|
|
(linux_proc_get_tgid): Adjust.
|
|
|
|
|
(linux_proc_get_tracerpid): Rename to ...
|
|
|
|
|
(linux_proc_get_tracerpid_nowarn): ... this.
|
|
|
|
|
(linux_proc_pid_get_state): New function, factored out from
|
|
|
|
|
(linux_proc_pid_has_state): ... this. Add new parameter "warn"
|
|
|
|
|
and handle it.
|
|
|
|
|
(linux_proc_pid_is_gone): New function.
|
|
|
|
|
(linux_proc_pid_is_stopped): Adjust.
|
|
|
|
|
(linux_proc_pid_is_zombie_maybe_warn)
|
|
|
|
|
(linux_proc_pid_is_zombie_nowarn): New functions.
|
|
|
|
|
(linux_proc_pid_is_zombie): Use
|
|
|
|
|
linux_proc_pid_is_zombie_maybe_warn.
|
|
|
|
|
(linux_proc_attach_tgid_threads): New function.
|
|
|
|
|
* nat/linux-procfs.h (linux_proc_get_tgid): Update comment.
|
|
|
|
|
(linux_proc_get_tracerpid): Rename to ...
|
|
|
|
|
(linux_proc_get_tracerpid_nowarn): ... this, and update comment.
|
|
|
|
|
(linux_proc_pid_is_gone): New declaration.
|
|
|
|
|
(linux_proc_pid_is_zombie): Update comment.
|
|
|
|
|
(linux_proc_pid_is_zombie_nowarn): New declaration.
|
|
|
|
|
(linux_proc_attach_lwp_func): New typedef.
|
|
|
|
|
(linux_proc_attach_tgid_threads): New declaration.
|
|
|
|
|
* nat/linux-ptrace.c (linux_ptrace_attach_fail_reason): Adjust to
|
|
|
|
|
use nowarn functions.
|
|
|
|
|
(linux_ptrace_attach_fail_reason_string): Move here from
|
|
|
|
|
gdbserver/linux-low.c and rename.
|
|
|
|
|
(ptrace_supports_feature): If the current ptrace options are not
|
|
|
|
|
known yet, check them now, instead of asserting.
|
|
|
|
|
* nat/linux-ptrace.h (linux_ptrace_attach_fail_reason_string):
|
|
|
|
|
Declare.
|
|
|
|
|
|
2014-12-16 16:12:23 +00:00
|
|
|
|
2015-01-09 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* linux-thread-db.c (thread_db_find_new_threads_silently)
|
|
|
|
|
(try_thread_db_load_1, try_thread_db_load, thread_db_load_search)
|
|
|
|
|
(find_new_threads_once): Print debug output on gdb_stdlog.
|
|
|
|
|
|
2015-01-09 10:09:03 +00:00
|
|
|
|
2015-01-09 Chen Gang <gang.chen.5i5j@gmail.com>
|
|
|
|
|
Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* compile/compile.c: Include "gdb_wait.h".
|
|
|
|
|
(do_rmdir): Check return value, and free 'zap'.
|
|
|
|
|
|
2014-12-28 08:12:53 +00:00
|
|
|
|
2015-01-08 Pedro Alves <palves@redhat.com>
|
|
|
|
|
Yao Qi <yao@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* dwarf2loc.c (indirect_pieced_value): Don't call
|
|
|
|
|
gdb_sign_extend. Call extract_signed_integer instead.
|
|
|
|
|
* utils.c (gdb_sign_extend): Remove.
|
|
|
|
|
* utils.h (gdb_sign_extend): Remove declaration.
|
|
|
|
|
|
2015-01-08 07:53:26 +00:00
|
|
|
|
2015-01-07 Pierre Muller <muller@sourceware.org>
|
|
|
|
|
|
|
|
|
|
PR symtab/17811
|
|
|
|
|
* stabsread.c (define_symbol): Set language for C++ special symbols.
|
|
|
|
|
|
2015-01-07 21:23:39 +00:00
|
|
|
|
2015-01-07 Patrick Palka <patrick@parcs.ath.cx>
|
|
|
|
|
|
|
|
|
|
* inflow.c (initial_gdb_ttystate): Tweak comment.
|
|
|
|
|
|
2015-01-07 14:49:49 +00:00
|
|
|
|
2015-01-07 Joel Brobecker <brobecker@adacore.com>
|
|
|
|
|
|
|
|
|
|
* inflow.c (set_initial_gdb_ttystate): Add empty line after
|
|
|
|
|
comment documenting function.
|
|
|
|
|
|
Don't propagate our current terminal state to the inferior
Currently when we start an inferior we have the inferior inherit our
terminal state. Under TUI, our terminal is highly modified by ncurses
and readline. So when starting an inferior under TUI, the inferior will
have a highly modified terminal state which will interfere with standard
I/O. For example,
$ gdb gdb
(gdb) break main
(gdb) run
(gdb) print puts ("a\nb")
a
b
$1 = 4
(gdb) [enter TUI mode]
(gdb) run
(gdb) [exit TUI mode]
(gdb) print puts ("a\nb")
a
b
$2 = 4
(gdb) print puts ("a\r\nb\r")
a
b
$3 = 6
As you can see, when we start the inferior under the regular interface,
puts() prints the text properly. But when we start the inferior under
TUI, puts() does not print the text properly. This is because when we
start the inferior under TUI it inherits our current terminal state
which has been modified by ncurses to, among other things, require an
explicit \r\n to print a new line. As a result the inferior performs
standard I/O in an unexpected way.
Because of this discrepancy, it doesn't seem like a good idea to have
the inferior inherit our _current_ terminal state for it may have been
modified by readline and/or ncurses. Instead, we should have the
inferior inherit a pristine snapshot of our terminal state taken before
readline or ncurses have had a chance to alter it. This enables the
inferior to run in a more accurate way, more closely mimicking the
program's behavior had it run standalone. And it fixes the above
mentioned issue.
Tested on x86_64-unknown-linux-gnu.
gdb/ChangeLog:
* terminal.h (set_initial_gdb_ttystate): Declare.
* inflow.c (initial_gdb_ttystate): New static variable.
(set_initial_gdb_ttystate): New setter.
(child_terminal_init_with_pgrp): Copy initial_gdb_ttystate
instead of our current terminal state.
* top.c (gdb_init): Call set_initial_gdb_ttystate.
2014-11-22 19:12:49 +00:00
|
|
|
|
2015-01-07 Patrick Palka <patrick@parcs.ath.cx>
|
|
|
|
|
|
|
|
|
|
* terminal.h (set_initial_gdb_ttystate): Declare.
|
|
|
|
|
* inflow.c (initial_gdb_ttystate): New static variable.
|
|
|
|
|
(set_initial_gdb_ttystate): New setter.
|
|
|
|
|
(child_terminal_init_with_pgrp): Copy initial_gdb_ttystate
|
|
|
|
|
instead of our current terminal state.
|
|
|
|
|
* top.c (gdb_init): Call set_initial_gdb_ttystate.
|
|
|
|
|
|
2015-01-07 03:34:29 +00:00
|
|
|
|
2015-01-07 Joel Brobecker <brobecker@adacore.com>
|
|
|
|
|
|
|
|
|
|
* guile/scm-type.c (tyscm_array_1): Add comment.
|
|
|
|
|
* python/py-type.c (typy_array_1): Add comment.
|
|
|
|
|
|
2015-01-06 14:37:53 +00:00
|
|
|
|
2015-01-06 Joel Brobecker <brobecker@adacore.com>
|
|
|
|
|
|
|
|
|
|
* guile/scm-type.c (tyscm_array_1): Do not raise out-of-range
|
|
|
|
|
error if N2 is equal to N1 - 1.
|
|
|
|
|
|
2015-01-06 14:30:53 +00:00
|
|
|
|
2015-01-06 Joel Brobecker <brobecker@adacore.com>
|
|
|
|
|
|
|
|
|
|
* python/py-type.c (typy_array_1): Do not raise negative-length
|
|
|
|
|
exception if N2 is equal to N1 - 1.
|
|
|
|
|
|
2015-01-03 20:01:29 +00:00
|
|
|
|
2015-01-03 Doug Evans <xdje42@gmail.com>
|
|
|
|
|
|
|
|
|
|
* c-exp.y: Whitespace cleanup.
|
|
|
|
|
(classify_inner_name): Remove extra ;.
|
|
|
|
|
|
2015-01-02 23:36:05 +00:00
|
|
|
|
2015-01-02 Maciej W. Rozycki <macro@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* mips-tdep.c (mips32_scan_prologue): Keep the extracted stack
|
|
|
|
|
offset signed.
|
|
|
|
|
|
2015-01-02 19:49:14 +00:00
|
|
|
|
2015-01-02 Doug Evans <dje@google.com>
|
|
|
|
|
|
|
|
|
|
* dwarf2read.c (setup_type_unit_groups): Remove outdated comment.
|
|
|
|
|
|
2015-01-02 19:02:31 +00:00
|
|
|
|
2015-01-02 Doug Evans <dje@google.com>
|
|
|
|
|
|
|
|
|
|
* symtab.h (struct symbol): Fix typo in comment.
|
|
|
|
|
|
2015-01-01 09:32:14 +00:00
|
|
|
|
2015-01-01 Joel Brobecker <brobecker@adacore.com>
|
|
|
|
|
|
|
|
|
|
Update year range in copyright notice of all files.
|
|
|
|
|
|
2015-01-01 09:24:41 +00:00
|
|
|
|
2015-01-01 Joel Brobecker <brobecker@adacore.com>
|
|
|
|
|
|
|
|
|
|
* top.c (print_gdb_version): Update copyright year to 2015.
|
|
|
|
|
|
2015-01-01 09:21:14 +00:00
|
|
|
|
2015-01-01 Joel Brobecker <brobecker@adacore.com>
|
2014-12-30 07:36:53 +00:00
|
|
|
|
|
2015-01-01 09:21:14 +00:00
|
|
|
|
* config/djgpp/fnchange.lst: Add entry for gdb/ChangeLog-2014.
|
2014-12-30 07:36:53 +00:00
|
|
|
|
|
2015-01-01 09:21:14 +00:00
|
|
|
|
For older changes see ChangeLog-2014.
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
|
|
|
|
Local Variables:
|
|
|
|
|
mode: change-log
|
|
|
|
|
left-margin: 8
|
|
|
|
|
fill-column: 74
|
|
|
|
|
version-control: never
|
2007-08-09 22:44:38 +00:00
|
|
|
|
coding: utf-8
|
1999-04-16 01:35:26 +00:00
|
|
|
|
End:
|