DWARF-5: call sites

this patch updates all call sites related DWARF-5 renames.

gdb/ChangeLog
2017-02-20  Jan Kratochvil  <jan.kratochvil@redhat.com>

	* block.c (call_site_for_pc): Rename DW_OP_GNU_*, DW_TAG_GNU_* and
	DW_AT_GNU_*.
	* common/common-exceptions.h (enum errors): Likewise.
	* dwarf2-frame.c (class dwarf_expr_executor): Likewise.
	* dwarf2expr.c (dwarf_block_to_dwarf_reg)
	(dwarf_expr_context::execute_stack_op): Likewise.
	* dwarf2expr.h (struct dwarf_expr_context, struct dwarf_expr_piece):
	Likewise.
	* dwarf2loc.c (dwarf_evaluate_loc_desc::get_base_type)
	(dwarf_evaluate_loc_desc::push_dwarf_reg_entry_value)
	(show_entry_values_debug, call_site_to_target_addr)
	(func_addr_to_tail_call_list, func_verify_no_selftailcall)
	(dwarf_expr_reg_to_entry_parameter, dwarf_entry_parameter_to_value)
	(entry_data_value_free_closure, value_of_dwarf_reg_entry)
	(value_of_dwarf_block_entry, indirect_pieced_value)
	(symbol_needs_eval_context::push_dwarf_reg_entry_value):
	(disassemble_dwarf_expression): Likewise.
	* dwarf2read.c (process_die, inherit_abstract_dies)
	(read_call_site_scope): Likewise.
	* gdbtypes.h (struct func_type, struct call_site_parameter)
	(struct call_site): Likewise.
	* stack.c (read_frame_arg): Likewise.
	* std-operator.def (OP_VAR_ENTRY_VALUE): Likewise.

gdb/doc/ChangeLog
2017-02-20  Jan Kratochvil  <jan.kratochvil@redhat.com>

	* gdb.texinfo (Print Settings, Tail Call Frames): Rename DW_OP_GNU_*,
	DW_TAG_GNU_* and DW_AT_GNU_*.

gdb/testsuite/ChangeLog
2017-02-20  Jan Kratochvil  <jan.kratochvil@redhat.com>

	* gdb.arch/amd64-entry-value-param-dwarf5.S: New file.
	* gdb.arch/amd64-entry-value-param-dwarf5.c: New file.
	* gdb.arch/amd64-entry-value-param-dwarf5.exp: New file.
	* gdb.arch/amd64-entry-value.exp: Rename DW_OP_GNU_*, DW_TAG_GNU_* and
	DW_AT_GNU_*.
This commit is contained in:
Jan Kratochvil 2017-02-20 20:53:21 +01:00
parent 43988095a5
commit 216f72a1ed
18 changed files with 965 additions and 100 deletions

View file

@ -1,3 +1,29 @@
2017-02-20 Jan Kratochvil <jan.kratochvil@redhat.com>
* block.c (call_site_for_pc): Rename DW_OP_GNU_*, DW_TAG_GNU_* and
DW_AT_GNU_*.
* common/common-exceptions.h (enum errors): Likewise.
* dwarf2-frame.c (class dwarf_expr_executor): Likewise.
* dwarf2expr.c (dwarf_block_to_dwarf_reg)
(dwarf_expr_context::execute_stack_op): Likewise.
* dwarf2expr.h (struct dwarf_expr_context, struct dwarf_expr_piece):
Likewise.
* dwarf2loc.c (dwarf_evaluate_loc_desc::get_base_type)
(dwarf_evaluate_loc_desc::push_dwarf_reg_entry_value)
(show_entry_values_debug, call_site_to_target_addr)
(func_addr_to_tail_call_list, func_verify_no_selftailcall)
(dwarf_expr_reg_to_entry_parameter, dwarf_entry_parameter_to_value)
(entry_data_value_free_closure, value_of_dwarf_reg_entry)
(value_of_dwarf_block_entry, indirect_pieced_value)
(symbol_needs_eval_context::push_dwarf_reg_entry_value):
(disassemble_dwarf_expression): Likewise.
* dwarf2read.c (process_die, inherit_abstract_dies)
(read_call_site_scope): Likewise.
* gdbtypes.h (struct func_type, struct call_site_parameter)
(struct call_site): Likewise.
* stack.c (read_frame_arg): Likewise.
* std-operator.def (OP_VAR_ENTRY_VALUE): Likewise.
2017-02-20 Jan Kratochvil <jan.kratochvil@redhat.com> 2017-02-20 Jan Kratochvil <jan.kratochvil@redhat.com>
* defs.h (read_unsigned_leb128): New declaration. * defs.h (read_unsigned_leb128): New declaration.

View file

@ -239,8 +239,8 @@ call_site_for_pc (struct gdbarch *gdbarch, CORE_ADDR pc)
/* DW_TAG_gnu_call_site will be missing just if GCC could not determine /* DW_TAG_gnu_call_site will be missing just if GCC could not determine
the call target. */ the call target. */
throw_error (NO_ENTRY_VALUE_ERROR, throw_error (NO_ENTRY_VALUE_ERROR,
_("DW_OP_GNU_entry_value resolving cannot find " _("DW_OP_entry_value resolving cannot find "
"DW_TAG_GNU_call_site %s in %s"), "DW_TAG_call_site %s in %s"),
paddress (gdbarch, pc), paddress (gdbarch, pc),
(msym.minsym == NULL ? "???" (msym.minsym == NULL ? "???"
: MSYMBOL_PRINT_NAME (msym.minsym))); : MSYMBOL_PRINT_NAME (msym.minsym)));

View file

@ -87,7 +87,7 @@ enum errors {
means the register was not saved in the frame. */ means the register was not saved in the frame. */
OPTIMIZED_OUT_ERROR, OPTIMIZED_OUT_ERROR,
/* DW_OP_GNU_entry_value resolving failed. */ /* DW_OP_entry_value resolving failed. */
NO_ENTRY_VALUE_ERROR, NO_ENTRY_VALUE_ERROR,
/* Target throwing an error has been closed. Current command should be /* Target throwing an error has been closed. Current command should be

View file

@ -1,3 +1,8 @@
2017-02-20 Jan Kratochvil <jan.kratochvil@redhat.com>
* gdb.texinfo (Print Settings, Tail Call Frames): Rename DW_OP_GNU_*,
DW_TAG_GNU_* and DW_AT_GNU_*.
2017-02-14 Tim Wiederhake <tim.wiederhake@intel.com> 2017-02-14 Tim Wiederhake <tim.wiederhake@intel.com>
* python.texi (Recordings In Python): New section. * python.texi (Recordings In Python): New section.

View file

@ -9857,7 +9857,7 @@ this feature will behave in the @code{default} setting the same way as with the
@code{no} setting. @code{no} setting.
This functionality is currently supported only by DWARF 2 debugging format and This functionality is currently supported only by DWARF 2 debugging format and
the compiler has to produce @samp{DW_TAG_GNU_call_site} tags. With the compiler has to produce @samp{DW_TAG_call_site} tags. With
@value{NGCC}, you need to specify @option{-O -g} during compilation, to get @value{NGCC}, you need to specify @option{-O -g} during compilation, to get
this information. this information.
@ -12025,7 +12025,7 @@ some cases @value{GDBN} can determine that @code{C} was tail-called from
return address set up as if @code{B} called @code{C} normally. return address set up as if @code{B} called @code{C} normally.
This functionality is currently supported only by DWARF 2 debugging format and This functionality is currently supported only by DWARF 2 debugging format and
the compiler has to produce @samp{DW_TAG_GNU_call_site} tags. With the compiler has to produce @samp{DW_TAG_call_site} tags. With
@value{NGCC}, you need to specify @option{-O -g} during compilation, to get @value{NGCC}, you need to specify @option{-O -g} during compilation, to get
this information. this information.
@ -12078,8 +12078,8 @@ static void __attribute__((noinline, noclone)) a (void) @{ x++; @}
static void __attribute__((noinline, noclone)) c (void) @{ a (); @} static void __attribute__((noinline, noclone)) c (void) @{ a (); @}
int main (void) @{ x (); return 0; @} int main (void) @{ x (); return 0; @}
Breakpoint 1, DW_OP_GNU_entry_value resolving cannot find Breakpoint 1, DW_OP_entry_value resolving cannot find
DW_TAG_GNU_call_site 0x40039a in main DW_TAG_call_site 0x40039a in main
a () at t.c:3 a () at t.c:3
3 static void __attribute__((noinline, noclone)) a (void) @{ x++; @} 3 static void __attribute__((noinline, noclone)) a (void) @{ x++; @}
(gdb) bt (gdb) bt
@ -12155,7 +12155,7 @@ int main (void) @{ a (5); return 0; @}
(gdb) bt (gdb) bt
#0 c (i=i@@entry=0) at t.c:2 #0 c (i=i@@entry=0) at t.c:2
#1 0x0000000000400428 in a (DW_OP_GNU_entry_value resolving has found #1 0x0000000000400428 in a (DW_OP_entry_value resolving has found
function "a" at 0x400420 can call itself via tail calls function "a" at 0x400420 can call itself via tail calls
i=<optimized out>) at t.c:6 i=<optimized out>) at t.c:6
#2 0x000000000040036e in main () at t.c:7 #2 0x000000000040036e in main () at t.c:7

View file

@ -361,7 +361,7 @@ class dwarf_expr_executor : public dwarf_expr_context
union call_site_parameter_u kind_u, union call_site_parameter_u kind_u,
int deref_size) OVERRIDE int deref_size) OVERRIDE
{ {
invalid ("DW_OP_GNU_entry_value"); invalid ("DW_OP_entry_value");
} }
CORE_ADDR get_object_address () OVERRIDE CORE_ADDR get_object_address () OVERRIDE

View file

@ -423,7 +423,7 @@ dwarf_block_to_dwarf_reg (const gdb_byte *buf, const gdb_byte *buf_end)
return *buf - DW_OP_reg0; return *buf - DW_OP_reg0;
} }
if (*buf == DW_OP_GNU_regval_type) if (*buf == DW_OP_regval_type || *buf == DW_OP_GNU_regval_type)
{ {
buf++; buf++;
buf = gdb_read_uleb128 (buf, buf_end, &dwarf_reg); buf = gdb_read_uleb128 (buf, buf_end, &dwarf_reg);
@ -805,12 +805,13 @@ dwarf_expr_context::execute_stack_op (const gdb_byte *op_ptr,
dwarf_expr_require_composition (op_ptr, op_end, "DW_OP_stack_value"); dwarf_expr_require_composition (op_ptr, op_end, "DW_OP_stack_value");
goto no_push; goto no_push;
case DW_OP_implicit_pointer:
case DW_OP_GNU_implicit_pointer: case DW_OP_GNU_implicit_pointer:
{ {
int64_t len; int64_t len;
if (this->ref_addr_size == -1) if (this->ref_addr_size == -1)
error (_("DWARF-2 expression error: DW_OP_GNU_implicit_pointer " error (_("DWARF-2 expression error: DW_OP_implicit_pointer "
"is not allowed in frame context")); "is not allowed in frame context"));
/* The referred-to DIE of sect_offset kind. */ /* The referred-to DIE of sect_offset kind. */
@ -825,7 +826,7 @@ dwarf_expr_context::execute_stack_op (const gdb_byte *op_ptr,
this->location = DWARF_VALUE_IMPLICIT_POINTER; this->location = DWARF_VALUE_IMPLICIT_POINTER;
dwarf_expr_require_composition (op_ptr, op_end, dwarf_expr_require_composition (op_ptr, op_end,
"DW_OP_GNU_implicit_pointer"); "DW_OP_implicit_pointer");
} }
break; break;
@ -963,6 +964,7 @@ dwarf_expr_context::execute_stack_op (const gdb_byte *op_ptr,
case DW_OP_deref: case DW_OP_deref:
case DW_OP_deref_size: case DW_OP_deref_size:
case DW_OP_deref_type:
case DW_OP_GNU_deref_type: case DW_OP_GNU_deref_type:
{ {
int addr_size = (op == DW_OP_deref ? this->addr_size : *op_ptr++); int addr_size = (op == DW_OP_deref ? this->addr_size : *op_ptr++);
@ -972,7 +974,7 @@ dwarf_expr_context::execute_stack_op (const gdb_byte *op_ptr,
pop (); pop ();
if (op == DW_OP_GNU_deref_type) if (op == DW_OP_deref_type || op == DW_OP_GNU_deref_type)
{ {
cu_offset type_die; cu_offset type_die;
@ -1299,6 +1301,7 @@ dwarf_expr_context::execute_stack_op (const gdb_byte *op_ptr,
} }
goto no_push; goto no_push;
case DW_OP_entry_value:
case DW_OP_GNU_entry_value: case DW_OP_GNU_entry_value:
{ {
uint64_t len; uint64_t len;
@ -1307,7 +1310,7 @@ dwarf_expr_context::execute_stack_op (const gdb_byte *op_ptr,
op_ptr = safe_read_uleb128 (op_ptr, op_end, &len); op_ptr = safe_read_uleb128 (op_ptr, op_end, &len);
if (op_ptr + len > op_end) if (op_ptr + len > op_end)
error (_("DW_OP_GNU_entry_value: too few bytes available.")); error (_("DW_OP_entry_value: too few bytes available."));
kind_u.dwarf_reg = dwarf_block_to_dwarf_reg (op_ptr, op_ptr + len); kind_u.dwarf_reg = dwarf_block_to_dwarf_reg (op_ptr, op_ptr + len);
if (kind_u.dwarf_reg != -1) if (kind_u.dwarf_reg != -1)
@ -1332,7 +1335,7 @@ dwarf_expr_context::execute_stack_op (const gdb_byte *op_ptr,
goto no_push; goto no_push;
} }
error (_("DWARF-2 expression error: DW_OP_GNU_entry_value is " error (_("DWARF-2 expression error: DW_OP_entry_value is "
"supported only for single DW_OP_reg* " "supported only for single DW_OP_reg* "
"or for DW_OP_breg*(0)+DW_OP_deref*")); "or for DW_OP_breg*(0)+DW_OP_deref*"));
} }
@ -1350,6 +1353,7 @@ dwarf_expr_context::execute_stack_op (const gdb_byte *op_ptr,
} }
goto no_push; goto no_push;
case DW_OP_const_type:
case DW_OP_GNU_const_type: case DW_OP_GNU_const_type:
{ {
cu_offset type_die; cu_offset type_die;
@ -1368,6 +1372,7 @@ dwarf_expr_context::execute_stack_op (const gdb_byte *op_ptr,
} }
break; break;
case DW_OP_regval_type:
case DW_OP_GNU_regval_type: case DW_OP_GNU_regval_type:
{ {
cu_offset type_die; cu_offset type_die;
@ -1382,7 +1387,9 @@ dwarf_expr_context::execute_stack_op (const gdb_byte *op_ptr,
} }
break; break;
case DW_OP_convert:
case DW_OP_GNU_convert: case DW_OP_GNU_convert:
case DW_OP_reinterpret:
case DW_OP_GNU_reinterpret: case DW_OP_GNU_reinterpret:
{ {
cu_offset type_die; cu_offset type_die;
@ -1399,7 +1406,7 @@ dwarf_expr_context::execute_stack_op (const gdb_byte *op_ptr,
result_val = fetch (0); result_val = fetch (0);
pop (); pop ();
if (op == DW_OP_GNU_convert) if (op == DW_OP_convert || op == DW_OP_GNU_convert)
result_val = value_cast (type, result_val); result_val = value_cast (type, result_val);
else if (type == value_type (result_val)) else if (type == value_type (result_val))
{ {
@ -1407,7 +1414,7 @@ dwarf_expr_context::execute_stack_op (const gdb_byte *op_ptr,
} }
else if (TYPE_LENGTH (type) else if (TYPE_LENGTH (type)
!= TYPE_LENGTH (value_type (result_val))) != TYPE_LENGTH (value_type (result_val)))
error (_("DW_OP_GNU_reinterpret has wrong size")); error (_("DW_OP_reinterpret has wrong size"));
else else
result_val result_val
= value_from_contents (type, = value_from_contents (type,

View file

@ -164,7 +164,7 @@ struct dwarf_expr_context
/* Return the PC for the frame. */ /* Return the PC for the frame. */
virtual CORE_ADDR get_frame_pc () virtual CORE_ADDR get_frame_pc ()
{ {
error (_("%s is invalid in this context"), "DW_OP_GNU_implicit_pointer"); error (_("%s is invalid in this context"), "DW_OP_implicit_pointer");
} }
/* Return the thread-local storage address for /* Return the thread-local storage address for
@ -187,10 +187,10 @@ struct dwarf_expr_context
return builtin_type (this->gdbarch)->builtin_int; return builtin_type (this->gdbarch)->builtin_int;
} }
/* Push on DWARF stack an entry evaluated for DW_TAG_GNU_call_site's /* Push on DWARF stack an entry evaluated for DW_TAG_call_site's
parameter matching KIND and KIND_U at the caller of specified BATON. parameter matching KIND and KIND_U at the caller of specified BATON.
If DEREF_SIZE is not -1 then use DW_AT_GNU_call_site_data_value instead of If DEREF_SIZE is not -1 then use DW_AT_call_data_value instead of
DW_AT_GNU_call_site_value. */ DW_AT_call_value. */
virtual void push_dwarf_reg_entry_value (enum call_site_parameter_kind kind, virtual void push_dwarf_reg_entry_value (enum call_site_parameter_kind kind,
union call_site_parameter_u kind_u, union call_site_parameter_u kind_u,
int deref_size) = 0; int deref_size) = 0;
@ -248,7 +248,7 @@ struct dwarf_expr_piece
/* Used for DWARF_VALUE_IMPLICIT_POINTER. */ /* Used for DWARF_VALUE_IMPLICIT_POINTER. */
struct struct
{ {
/* The referent DIE from DW_OP_GNU_implicit_pointer. */ /* The referent DIE from DW_OP_implicit_pointer. */
sect_offset die; sect_offset die;
/* The byte offset into the resulting data. */ /* The byte offset into the resulting data. */
LONGEST offset; LONGEST offset;

View file

@ -588,9 +588,9 @@ class dwarf_evaluate_loc_desc : public dwarf_expr_context
{ {
struct type *result = dwarf2_get_die_type (die_offset, per_cu); struct type *result = dwarf2_get_die_type (die_offset, per_cu);
if (result == NULL) if (result == NULL)
error (_("Could not find type for DW_OP_GNU_const_type")); error (_("Could not find type for DW_OP_const_type"));
if (size != 0 && TYPE_LENGTH (result) != size) if (size != 0 && TYPE_LENGTH (result) != size)
error (_("DW_OP_GNU_const_type has different sizes for type and data")); error (_("DW_OP_const_type has different sizes for type and data"));
return result; return result;
} }
@ -640,7 +640,7 @@ class dwarf_evaluate_loc_desc : public dwarf_expr_context
/* DEREF_SIZE size is not verified here. */ /* DEREF_SIZE size is not verified here. */
if (data_src == NULL) if (data_src == NULL)
throw_error (NO_ENTRY_VALUE_ERROR, throw_error (NO_ENTRY_VALUE_ERROR,
_("Cannot resolve DW_AT_GNU_call_site_data_value")); _("Cannot resolve DW_AT_call_data_value"));
scoped_restore save_frame = make_scoped_restore (&this->frame, scoped_restore save_frame = make_scoped_restore (&this->frame,
caller_frame); caller_frame);
@ -732,7 +732,7 @@ show_entry_values_debug (struct ui_file *file, int from_tty,
value); value);
} }
/* Find DW_TAG_GNU_call_site's DW_AT_GNU_call_site_target address. /* Find DW_TAG_call_site's DW_AT_call_target address.
CALLER_FRAME (for registers) can be NULL if it is not known. This function CALLER_FRAME (for registers) can be NULL if it is not known. This function
always returns valid address or it throws NO_ENTRY_VALUE_ERROR. */ always returns valid address or it throws NO_ENTRY_VALUE_ERROR. */
@ -757,8 +757,7 @@ call_site_to_target_addr (struct gdbarch *call_site_gdbarch,
msym = lookup_minimal_symbol_by_pc (call_site->pc - 1); msym = lookup_minimal_symbol_by_pc (call_site->pc - 1);
throw_error (NO_ENTRY_VALUE_ERROR, throw_error (NO_ENTRY_VALUE_ERROR,
_("DW_AT_GNU_call_site_target is not specified " _("DW_AT_call_target is not specified at %s in %s"),
"at %s in %s"),
paddress (call_site_gdbarch, call_site->pc), paddress (call_site_gdbarch, call_site->pc),
(msym.minsym == NULL ? "???" (msym.minsym == NULL ? "???"
: MSYMBOL_PRINT_NAME (msym.minsym))); : MSYMBOL_PRINT_NAME (msym.minsym)));
@ -770,7 +769,7 @@ call_site_to_target_addr (struct gdbarch *call_site_gdbarch,
msym = lookup_minimal_symbol_by_pc (call_site->pc - 1); msym = lookup_minimal_symbol_by_pc (call_site->pc - 1);
throw_error (NO_ENTRY_VALUE_ERROR, throw_error (NO_ENTRY_VALUE_ERROR,
_("DW_AT_GNU_call_site_target DWARF block resolving " _("DW_AT_call_target DWARF block resolving "
"requires known frame which is currently not " "requires known frame which is currently not "
"available at %s in %s"), "available at %s in %s"),
paddress (call_site_gdbarch, call_site->pc), paddress (call_site_gdbarch, call_site->pc),
@ -783,8 +782,7 @@ call_site_to_target_addr (struct gdbarch *call_site_gdbarch,
val = dwarf2_evaluate_loc_desc (caller_core_addr_type, caller_frame, val = dwarf2_evaluate_loc_desc (caller_core_addr_type, caller_frame,
dwarf_block->data, dwarf_block->size, dwarf_block->data, dwarf_block->size,
dwarf_block->per_cu); dwarf_block->per_cu);
/* DW_AT_GNU_call_site_target is a DWARF expression, not a DWARF /* DW_AT_call_target is a DWARF expression, not a DWARF location. */
location. */
if (VALUE_LVAL (val) == lval_memory) if (VALUE_LVAL (val) == lval_memory)
return value_address (val); return value_address (val);
else else
@ -834,7 +832,7 @@ func_addr_to_tail_call_list (struct gdbarch *gdbarch, CORE_ADDR addr)
if (sym == NULL || BLOCK_START (SYMBOL_BLOCK_VALUE (sym)) != addr) if (sym == NULL || BLOCK_START (SYMBOL_BLOCK_VALUE (sym)) != addr)
throw_error (NO_ENTRY_VALUE_ERROR, throw_error (NO_ENTRY_VALUE_ERROR,
_("DW_TAG_GNU_call_site resolving failed to find function " _("DW_TAG_call_site resolving failed to find function "
"name for address %s"), "name for address %s"),
paddress (gdbarch, addr)); paddress (gdbarch, addr));
@ -892,7 +890,7 @@ func_verify_no_selftailcall (struct gdbarch *gdbarch, CORE_ADDR verify_addr)
msym = lookup_minimal_symbol_by_pc (verify_addr); msym = lookup_minimal_symbol_by_pc (verify_addr);
throw_error (NO_ENTRY_VALUE_ERROR, throw_error (NO_ENTRY_VALUE_ERROR,
_("DW_OP_GNU_entry_value resolving has found " _("DW_OP_entry_value resolving has found "
"function \"%s\" at %s can call itself via tail " "function \"%s\" at %s can call itself via tail "
"calls"), "calls"),
(msym.minsym == NULL ? "???" (msym.minsym == NULL ? "???"
@ -1234,7 +1232,7 @@ dwarf_expr_reg_to_entry_parameter (struct frame_info *frame,
struct gdbarch *caller_gdbarch = frame_unwind_arch (frame); struct gdbarch *caller_gdbarch = frame_unwind_arch (frame);
throw_error (NO_ENTRY_VALUE_ERROR, throw_error (NO_ENTRY_VALUE_ERROR,
_("DW_OP_GNU_entry_value resolving callee gdbarch %s " _("DW_OP_entry_value resolving callee gdbarch %s "
"(of %s (%s)) does not match caller gdbarch %s"), "(of %s (%s)) does not match caller gdbarch %s"),
gdbarch_bfd_arch_info (gdbarch)->printable_name, gdbarch_bfd_arch_info (gdbarch)->printable_name,
paddress (gdbarch, func_addr), paddress (gdbarch, func_addr),
@ -1248,7 +1246,7 @@ dwarf_expr_reg_to_entry_parameter (struct frame_info *frame,
struct bound_minimal_symbol msym struct bound_minimal_symbol msym
= lookup_minimal_symbol_by_pc (func_addr); = lookup_minimal_symbol_by_pc (func_addr);
throw_error (NO_ENTRY_VALUE_ERROR, _("DW_OP_GNU_entry_value resolving " throw_error (NO_ENTRY_VALUE_ERROR, _("DW_OP_entry_value resolving "
"requires caller of %s (%s)"), "requires caller of %s (%s)"),
paddress (gdbarch, func_addr), paddress (gdbarch, func_addr),
(msym.minsym == NULL ? "???" (msym.minsym == NULL ? "???"
@ -1265,7 +1263,7 @@ dwarf_expr_reg_to_entry_parameter (struct frame_info *frame,
target_msym = lookup_minimal_symbol_by_pc (target_addr).minsym; target_msym = lookup_minimal_symbol_by_pc (target_addr).minsym;
func_msym = lookup_minimal_symbol_by_pc (func_addr).minsym; func_msym = lookup_minimal_symbol_by_pc (func_addr).minsym;
throw_error (NO_ENTRY_VALUE_ERROR, throw_error (NO_ENTRY_VALUE_ERROR,
_("DW_OP_GNU_entry_value resolving expects callee %s at %s " _("DW_OP_entry_value resolving expects callee %s at %s "
"but the called frame is for %s at %s"), "but the called frame is for %s at %s"),
(target_msym == NULL ? "???" (target_msym == NULL ? "???"
: MSYMBOL_PRINT_NAME (target_msym)), : MSYMBOL_PRINT_NAME (target_msym)),
@ -1289,10 +1287,10 @@ dwarf_expr_reg_to_entry_parameter (struct frame_info *frame,
struct minimal_symbol *msym struct minimal_symbol *msym
= lookup_minimal_symbol_by_pc (caller_pc).minsym; = lookup_minimal_symbol_by_pc (caller_pc).minsym;
/* DW_TAG_GNU_call_site_parameter will be missing just if GCC could not /* DW_TAG_call_site_parameter will be missing just if GCC could not
determine its value. */ determine its value. */
throw_error (NO_ENTRY_VALUE_ERROR, _("Cannot find matching parameter " throw_error (NO_ENTRY_VALUE_ERROR, _("Cannot find matching parameter "
"at DW_TAG_GNU_call_site %s at %s"), "at DW_TAG_call_site %s at %s"),
paddress (gdbarch, caller_pc), paddress (gdbarch, caller_pc),
msym == NULL ? "???" : MSYMBOL_PRINT_NAME (msym)); msym == NULL ? "???" : MSYMBOL_PRINT_NAME (msym));
} }
@ -1302,8 +1300,8 @@ dwarf_expr_reg_to_entry_parameter (struct frame_info *frame,
} }
/* Return value for PARAMETER matching DEREF_SIZE. If DEREF_SIZE is -1, return /* Return value for PARAMETER matching DEREF_SIZE. If DEREF_SIZE is -1, return
the normal DW_AT_GNU_call_site_value block. Otherwise return the the normal DW_AT_call_value block. Otherwise return the
DW_AT_GNU_call_site_data_value (dereferenced) block. DW_AT_call_data_value (dereferenced) block.
TYPE and CALLER_FRAME specify how to evaluate the DWARF block into returned TYPE and CALLER_FRAME specify how to evaluate the DWARF block into returned
struct value. struct value.
@ -1327,9 +1325,9 @@ dwarf_entry_parameter_to_value (struct call_site_parameter *parameter,
/* DEREF_SIZE size is not verified here. */ /* DEREF_SIZE size is not verified here. */
if (data_src == NULL) if (data_src == NULL)
throw_error (NO_ENTRY_VALUE_ERROR, throw_error (NO_ENTRY_VALUE_ERROR,
_("Cannot resolve DW_AT_GNU_call_site_data_value")); _("Cannot resolve DW_AT_call_data_value"));
/* DW_AT_GNU_call_site_value is a DWARF expression, not a DWARF /* DW_AT_call_value is a DWARF expression, not a DWARF
location. Postprocessing of DWARF_VALUE_MEMORY would lose the type from location. Postprocessing of DWARF_VALUE_MEMORY would lose the type from
DWARF block. */ DWARF block. */
data = (gdb_byte *) alloca (size + 1); data = (gdb_byte *) alloca (size + 1);
@ -1380,7 +1378,7 @@ entry_data_value_free_closure (struct value *v)
/* Vector for methods for an entry value reference where the referenced value /* Vector for methods for an entry value reference where the referenced value
is stored in the caller. On the first dereference use is stored in the caller. On the first dereference use
DW_AT_GNU_call_site_data_value in the caller. */ DW_AT_call_data_value in the caller. */
static const struct lval_funcs entry_data_value_funcs = static const struct lval_funcs entry_data_value_funcs =
{ {
@ -1395,7 +1393,7 @@ static const struct lval_funcs entry_data_value_funcs =
/* Read parameter of TYPE at (callee) FRAME's function entry. KIND and KIND_U /* Read parameter of TYPE at (callee) FRAME's function entry. KIND and KIND_U
are used to match DW_AT_location at the caller's are used to match DW_AT_location at the caller's
DW_TAG_GNU_call_site_parameter. DW_TAG_call_site_parameter.
Function always returns non-NULL value. It throws NO_ENTRY_VALUE_ERROR if it Function always returns non-NULL value. It throws NO_ENTRY_VALUE_ERROR if it
cannot resolve the parameter for any reason. */ cannot resolve the parameter for any reason. */
@ -1419,7 +1417,7 @@ value_of_dwarf_reg_entry (struct type *type, struct frame_info *frame,
type, caller_frame, type, caller_frame,
caller_per_cu); caller_per_cu);
/* Check if DW_AT_GNU_call_site_data_value cannot be used. If it should be /* Check if DW_AT_call_data_value cannot be used. If it should be
used and it is not available do not fall back to OUTER_VAL - dereferencing used and it is not available do not fall back to OUTER_VAL - dereferencing
TYPE_CODE_REF with non-entry data value would give current value - not the TYPE_CODE_REF with non-entry data value would give current value - not the
entry value. */ entry value. */
@ -1447,7 +1445,7 @@ value_of_dwarf_reg_entry (struct type *type, struct frame_info *frame,
/* Read parameter of TYPE at (callee) FRAME's function entry. DATA and /* Read parameter of TYPE at (callee) FRAME's function entry. DATA and
SIZE are DWARF block used to match DW_AT_location at the caller's SIZE are DWARF block used to match DW_AT_location at the caller's
DW_TAG_GNU_call_site_parameter. DW_TAG_call_site_parameter.
Function always returns non-NULL value. It throws NO_ENTRY_VALUE_ERROR if it Function always returns non-NULL value. It throws NO_ENTRY_VALUE_ERROR if it
cannot resolve the parameter for any reason. */ cannot resolve the parameter for any reason. */
@ -1471,7 +1469,7 @@ value_of_dwarf_block_entry (struct type *type, struct frame_info *frame,
suppressed during normal operation. The expression can be arbitrary if suppressed during normal operation. The expression can be arbitrary if
there is no caller-callee entry value binding expected. */ there is no caller-callee entry value binding expected. */
throw_error (NO_ENTRY_VALUE_ERROR, throw_error (NO_ENTRY_VALUE_ERROR,
_("DWARF-2 expression error: DW_OP_GNU_entry_value is supported " _("DWARF-2 expression error: DW_OP_entry_value is supported "
"only for single DW_OP_reg* or for DW_OP_fbreg(*)")); "only for single DW_OP_reg* or for DW_OP_fbreg(*)"));
} }
@ -2226,7 +2224,7 @@ indirect_pieced_value (struct value *value)
return NULL; return NULL;
if (bit_length != 0) if (bit_length != 0)
error (_("Invalid use of DW_OP_GNU_implicit_pointer")); error (_("Invalid use of DW_OP_implicit_pointer"));
piece = p; piece = p;
break; break;
@ -2805,7 +2803,7 @@ class symbol_needs_eval_context : public dwarf_expr_context
per_cu_dwarf_call (this, die_offset, per_cu); per_cu_dwarf_call (this, die_offset, per_cu);
} }
/* DW_OP_GNU_entry_value accesses require a caller, therefore a /* DW_OP_entry_value accesses require a caller, therefore a
frame. */ frame. */
void push_dwarf_reg_entry_value (enum call_site_parameter_kind kind, void push_dwarf_reg_entry_value (enum call_site_parameter_kind kind,
@ -4162,6 +4160,7 @@ disassemble_dwarf_expression (struct ui_file *stream,
} }
break; break;
case DW_OP_implicit_pointer:
case DW_OP_GNU_implicit_pointer: case DW_OP_GNU_implicit_pointer:
{ {
ul = extract_unsigned_integer (data, offset_size, ul = extract_unsigned_integer (data, offset_size,
@ -4176,6 +4175,7 @@ disassemble_dwarf_expression (struct ui_file *stream,
} }
break; break;
case DW_OP_deref_type:
case DW_OP_GNU_deref_type: case DW_OP_GNU_deref_type:
{ {
int addr_size = *data++; int addr_size = *data++;
@ -4192,6 +4192,7 @@ disassemble_dwarf_expression (struct ui_file *stream,
} }
break; break;
case DW_OP_const_type:
case DW_OP_GNU_const_type: case DW_OP_GNU_const_type:
{ {
cu_offset type_die; cu_offset type_die;
@ -4206,6 +4207,7 @@ disassemble_dwarf_expression (struct ui_file *stream,
} }
break; break;
case DW_OP_regval_type:
case DW_OP_GNU_regval_type: case DW_OP_GNU_regval_type:
{ {
uint64_t reg; uint64_t reg;
@ -4225,7 +4227,9 @@ disassemble_dwarf_expression (struct ui_file *stream,
} }
break; break;
case DW_OP_convert:
case DW_OP_GNU_convert: case DW_OP_GNU_convert:
case DW_OP_reinterpret:
case DW_OP_GNU_reinterpret: case DW_OP_GNU_reinterpret:
{ {
cu_offset type_die; cu_offset type_die;
@ -4247,6 +4251,7 @@ disassemble_dwarf_expression (struct ui_file *stream,
} }
break; break;
case DW_OP_entry_value:
case DW_OP_GNU_entry_value: case DW_OP_GNU_entry_value:
data = safe_read_uleb128 (data, end, &ul); data = safe_read_uleb128 (data, end, &ul);
fputc_filtered ('\n', stream); fputc_filtered ('\n', stream);

View file

@ -8361,6 +8361,7 @@ process_die (struct die_info *die, struct dwarf2_cu *cu)
case DW_TAG_catch_block: case DW_TAG_catch_block:
read_lexical_block_scope (die, cu); read_lexical_block_scope (die, cu);
break; break;
case DW_TAG_call_site:
case DW_TAG_GNU_call_site: case DW_TAG_GNU_call_site:
read_call_site_scope (die, cu); read_call_site_scope (die, cu);
break; break;
@ -11314,11 +11315,12 @@ inherit_abstract_dies (struct die_info *die, struct dwarf2_cu *cu)
struct dwarf2_cu *child_origin_cu; struct dwarf2_cu *child_origin_cu;
/* We are trying to process concrete instance entries: /* We are trying to process concrete instance entries:
DW_TAG_GNU_call_site DIEs indeed have a DW_AT_abstract_origin tag, but DW_TAG_call_site DIEs indeed have a DW_AT_abstract_origin tag, but
it's not relevant to our analysis here. i.e. detecting DIEs that are it's not relevant to our analysis here. i.e. detecting DIEs that are
present in the abstract instance but not referenced in the concrete present in the abstract instance but not referenced in the concrete
one. */ one. */
if (child_die->tag == DW_TAG_GNU_call_site) if (child_die->tag == DW_TAG_call_site
|| child_die->tag == DW_TAG_GNU_call_site)
continue; continue;
/* For each CHILD_DIE, find the corresponding child of /* For each CHILD_DIE, find the corresponding child of
@ -11653,7 +11655,7 @@ read_lexical_block_scope (struct die_info *die, struct dwarf2_cu *cu)
local_using_directives = newobj->local_using_directives; local_using_directives = newobj->local_using_directives;
} }
/* Read in DW_TAG_GNU_call_site and insert it to CU->call_site_htab. */ /* Read in DW_TAG_call_site and insert it to CU->call_site_htab. */
static void static void
read_call_site_scope (struct die_info *die, struct dwarf2_cu *cu) read_call_site_scope (struct die_info *die, struct dwarf2_cu *cu)
@ -11669,11 +11671,17 @@ read_call_site_scope (struct die_info *die, struct dwarf2_cu *cu)
baseaddr = ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile)); baseaddr = ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
attr = dwarf2_attr (die, DW_AT_call_return_pc, cu);
if (attr == NULL)
{
/* This was a pre-DWARF-5 GNU extension alias
for DW_AT_call_return_pc. */
attr = dwarf2_attr (die, DW_AT_low_pc, cu); attr = dwarf2_attr (die, DW_AT_low_pc, cu);
}
if (!attr) if (!attr)
{ {
complaint (&symfile_complaints, complaint (&symfile_complaints,
_("missing DW_AT_low_pc for DW_TAG_GNU_call_site " _("missing DW_AT_call_return_pc for DW_TAG_call_site "
"DIE 0x%x [in module %s]"), "DIE 0x%x [in module %s]"),
die->offset.sect_off, objfile_name (objfile)); die->offset.sect_off, objfile_name (objfile));
return; return;
@ -11690,7 +11698,7 @@ read_call_site_scope (struct die_info *die, struct dwarf2_cu *cu)
if (*slot != NULL) if (*slot != NULL)
{ {
complaint (&symfile_complaints, complaint (&symfile_complaints,
_("Duplicate PC %s for DW_TAG_GNU_call_site " _("Duplicate PC %s for DW_TAG_call_site "
"DIE 0x%x [in module %s]"), "DIE 0x%x [in module %s]"),
paddress (gdbarch, pc), die->offset.sect_off, paddress (gdbarch, pc), die->offset.sect_off,
objfile_name (objfile)); objfile_name (objfile));
@ -11703,11 +11711,12 @@ read_call_site_scope (struct die_info *die, struct dwarf2_cu *cu)
for (child_die = die->child; child_die && child_die->tag; for (child_die = die->child; child_die && child_die->tag;
child_die = sibling_die (child_die)) child_die = sibling_die (child_die))
{ {
if (child_die->tag != DW_TAG_GNU_call_site_parameter) if (child_die->tag != DW_TAG_call_site_parameter
&& child_die->tag != DW_TAG_GNU_call_site_parameter)
{ {
complaint (&symfile_complaints, complaint (&symfile_complaints,
_("Tag %d is not DW_TAG_GNU_call_site_parameter in " _("Tag %d is not DW_TAG_call_site_parameter in "
"DW_TAG_GNU_call_site child DIE 0x%x [in module %s]"), "DW_TAG_call_site child DIE 0x%x [in module %s]"),
child_die->tag, child_die->offset.sect_off, child_die->tag, child_die->offset.sect_off,
objfile_name (objfile)); objfile_name (objfile));
continue; continue;
@ -11725,7 +11734,8 @@ read_call_site_scope (struct die_info *die, struct dwarf2_cu *cu)
memset (call_site, 0, sizeof (*call_site) - sizeof (*call_site->parameter)); memset (call_site, 0, sizeof (*call_site) - sizeof (*call_site->parameter));
call_site->pc = pc; call_site->pc = pc;
if (dwarf2_flag_true_p (die, DW_AT_GNU_tail_call, cu)) if (dwarf2_flag_true_p (die, DW_AT_call_tail_call, cu)
|| dwarf2_flag_true_p (die, DW_AT_GNU_tail_call, cu))
{ {
struct die_info *func_die; struct die_info *func_die;
@ -11735,10 +11745,12 @@ read_call_site_scope (struct die_info *die, struct dwarf2_cu *cu)
&& func_die->tag != DW_TAG_subroutine_type; && func_die->tag != DW_TAG_subroutine_type;
func_die = func_die->parent); func_die = func_die->parent);
/* DW_AT_GNU_all_call_sites is a superset /* DW_AT_call_all_calls is a superset
of DW_AT_GNU_all_tail_call_sites. */ of DW_AT_call_all_tail_calls. */
if (func_die if (func_die
&& !dwarf2_flag_true_p (func_die, DW_AT_call_all_calls, cu)
&& !dwarf2_flag_true_p (func_die, DW_AT_GNU_all_call_sites, cu) && !dwarf2_flag_true_p (func_die, DW_AT_GNU_all_call_sites, cu)
&& !dwarf2_flag_true_p (func_die, DW_AT_call_all_tail_calls, cu)
&& !dwarf2_flag_true_p (func_die, DW_AT_GNU_all_tail_call_sites, cu)) && !dwarf2_flag_true_p (func_die, DW_AT_GNU_all_tail_call_sites, cu))
{ {
/* TYPE_TAIL_CALL_LIST is not interesting in functions where it is /* TYPE_TAIL_CALL_LIST is not interesting in functions where it is
@ -11766,15 +11778,22 @@ read_call_site_scope (struct die_info *die, struct dwarf2_cu *cu)
} }
else else
complaint (&symfile_complaints, complaint (&symfile_complaints,
_("Cannot find function owning DW_TAG_GNU_call_site " _("Cannot find function owning DW_TAG_call_site "
"DIE 0x%x [in module %s]"), "DIE 0x%x [in module %s]"),
die->offset.sect_off, objfile_name (objfile)); die->offset.sect_off, objfile_name (objfile));
} }
} }
attr = dwarf2_attr (die, DW_AT_call_target, cu);
if (attr == NULL)
attr = dwarf2_attr (die, DW_AT_GNU_call_site_target, cu); attr = dwarf2_attr (die, DW_AT_GNU_call_site_target, cu);
if (attr == NULL) if (attr == NULL)
attr = dwarf2_attr (die, DW_AT_call_origin, cu);
if (attr == NULL)
{
/* This was a pre-DWARF-5 GNU extension alias for DW_AT_call_origin. */
attr = dwarf2_attr (die, DW_AT_abstract_origin, cu); attr = dwarf2_attr (die, DW_AT_abstract_origin, cu);
}
SET_FIELD_DWARF_BLOCK (call_site->target, NULL); SET_FIELD_DWARF_BLOCK (call_site->target, NULL);
if (!attr || (attr_form_is_block (attr) && DW_BLOCK (attr)->size == 0)) if (!attr || (attr_form_is_block (attr) && DW_BLOCK (attr)->size == 0))
/* Keep NULL DWARF_BLOCK. */; /* Keep NULL DWARF_BLOCK. */;
@ -11812,7 +11831,7 @@ read_call_site_scope (struct die_info *die, struct dwarf2_cu *cu)
target_physname = dwarf2_physname (NULL, target_die, target_cu); target_physname = dwarf2_physname (NULL, target_die, target_cu);
if (target_physname == NULL) if (target_physname == NULL)
complaint (&symfile_complaints, complaint (&symfile_complaints,
_("DW_AT_GNU_call_site_target target DIE has invalid " _("DW_AT_call_target target DIE has invalid "
"physname, for referencing DIE 0x%x [in module %s]"), "physname, for referencing DIE 0x%x [in module %s]"),
die->offset.sect_off, objfile_name (objfile)); die->offset.sect_off, objfile_name (objfile));
else else
@ -11826,7 +11845,7 @@ read_call_site_scope (struct die_info *die, struct dwarf2_cu *cu)
if (dwarf2_get_pc_bounds (target_die, &lowpc, NULL, target_cu, NULL) if (dwarf2_get_pc_bounds (target_die, &lowpc, NULL, target_cu, NULL)
<= PC_BOUNDS_INVALID) <= PC_BOUNDS_INVALID)
complaint (&symfile_complaints, complaint (&symfile_complaints,
_("DW_AT_GNU_call_site_target target DIE has invalid " _("DW_AT_call_target target DIE has invalid "
"low pc, for referencing DIE 0x%x [in module %s]"), "low pc, for referencing DIE 0x%x [in module %s]"),
die->offset.sect_off, objfile_name (objfile)); die->offset.sect_off, objfile_name (objfile));
else else
@ -11838,7 +11857,7 @@ read_call_site_scope (struct die_info *die, struct dwarf2_cu *cu)
} }
else else
complaint (&symfile_complaints, complaint (&symfile_complaints,
_("DW_TAG_GNU_call_site DW_AT_GNU_call_site_target is neither " _("DW_TAG_call_site DW_AT_call_target is neither "
"block nor reference, for DIE 0x%x [in module %s]"), "block nor reference, for DIE 0x%x [in module %s]"),
die->offset.sect_off, objfile_name (objfile)); die->offset.sect_off, objfile_name (objfile));
@ -11851,7 +11870,8 @@ read_call_site_scope (struct die_info *die, struct dwarf2_cu *cu)
struct call_site_parameter *parameter; struct call_site_parameter *parameter;
struct attribute *loc, *origin; struct attribute *loc, *origin;
if (child_die->tag != DW_TAG_GNU_call_site_parameter) if (child_die->tag != DW_TAG_call_site_parameter
&& child_die->tag != DW_TAG_GNU_call_site_parameter)
{ {
/* Already printed the complaint above. */ /* Already printed the complaint above. */
continue; continue;
@ -11862,10 +11882,16 @@ read_call_site_scope (struct die_info *die, struct dwarf2_cu *cu)
/* DW_AT_location specifies the register number or DW_AT_abstract_origin /* DW_AT_location specifies the register number or DW_AT_abstract_origin
specifies DW_TAG_formal_parameter. Value of the data assumed for the specifies DW_TAG_formal_parameter. Value of the data assumed for the
register is contained in DW_AT_GNU_call_site_value. */ register is contained in DW_AT_call_value. */
loc = dwarf2_attr (child_die, DW_AT_location, cu); loc = dwarf2_attr (child_die, DW_AT_location, cu);
origin = dwarf2_attr (child_die, DW_AT_call_parameter, cu);
if (origin == NULL)
{
/* This was a pre-DWARF-5 GNU extension alias
for DW_AT_call_parameter. */
origin = dwarf2_attr (child_die, DW_AT_abstract_origin, cu); origin = dwarf2_attr (child_die, DW_AT_abstract_origin, cu);
}
if (loc == NULL && origin != NULL && attr_form_is_ref (origin)) if (loc == NULL && origin != NULL && attr_form_is_ref (origin))
{ {
sect_offset offset; sect_offset offset;
@ -11878,9 +11904,8 @@ read_call_site_scope (struct die_info *die, struct dwarf2_cu *cu)
binding can be done only inside one CU. Such referenced DIE binding can be done only inside one CU. Such referenced DIE
therefore cannot be even moved to DW_TAG_partial_unit. */ therefore cannot be even moved to DW_TAG_partial_unit. */
complaint (&symfile_complaints, complaint (&symfile_complaints,
_("DW_AT_abstract_origin offset is not in CU for " _("DW_AT_call_parameter offset is not in CU for "
"DW_TAG_GNU_call_site child DIE 0x%x " "DW_TAG_call_site child DIE 0x%x [in module %s]"),
"[in module %s]"),
child_die->offset.sect_off, objfile_name (objfile)); child_die->offset.sect_off, objfile_name (objfile));
continue; continue;
} }
@ -11891,7 +11916,7 @@ read_call_site_scope (struct die_info *die, struct dwarf2_cu *cu)
{ {
complaint (&symfile_complaints, complaint (&symfile_complaints,
_("No DW_FORM_block* DW_AT_location for " _("No DW_FORM_block* DW_AT_location for "
"DW_TAG_GNU_call_site child DIE 0x%x [in module %s]"), "DW_TAG_call_site child DIE 0x%x [in module %s]"),
child_die->offset.sect_off, objfile_name (objfile)); child_die->offset.sect_off, objfile_name (objfile));
continue; continue;
} }
@ -11910,19 +11935,21 @@ read_call_site_scope (struct die_info *die, struct dwarf2_cu *cu)
complaint (&symfile_complaints, complaint (&symfile_complaints,
_("Only single DW_OP_reg or DW_OP_fbreg is supported " _("Only single DW_OP_reg or DW_OP_fbreg is supported "
"for DW_FORM_block* DW_AT_location is supported for " "for DW_FORM_block* DW_AT_location is supported for "
"DW_TAG_GNU_call_site child DIE 0x%x " "DW_TAG_call_site child DIE 0x%x "
"[in module %s]"), "[in module %s]"),
child_die->offset.sect_off, objfile_name (objfile)); child_die->offset.sect_off, objfile_name (objfile));
continue; continue;
} }
} }
attr = dwarf2_attr (child_die, DW_AT_call_value, cu);
if (attr == NULL)
attr = dwarf2_attr (child_die, DW_AT_GNU_call_site_value, cu); attr = dwarf2_attr (child_die, DW_AT_GNU_call_site_value, cu);
if (!attr_form_is_block (attr)) if (!attr_form_is_block (attr))
{ {
complaint (&symfile_complaints, complaint (&symfile_complaints,
_("No DW_FORM_block* DW_AT_GNU_call_site_value for " _("No DW_FORM_block* DW_AT_call_value for "
"DW_TAG_GNU_call_site child DIE 0x%x [in module %s]"), "DW_TAG_call_site child DIE 0x%x [in module %s]"),
child_die->offset.sect_off, objfile_name (objfile)); child_die->offset.sect_off, objfile_name (objfile));
continue; continue;
} }
@ -11934,13 +11961,15 @@ read_call_site_scope (struct die_info *die, struct dwarf2_cu *cu)
parameter->data_value_size = 0; parameter->data_value_size = 0;
call_site->parameter_count++; call_site->parameter_count++;
attr = dwarf2_attr (child_die, DW_AT_call_data_value, cu);
if (attr == NULL)
attr = dwarf2_attr (child_die, DW_AT_GNU_call_site_data_value, cu); attr = dwarf2_attr (child_die, DW_AT_GNU_call_site_data_value, cu);
if (attr) if (attr)
{ {
if (!attr_form_is_block (attr)) if (!attr_form_is_block (attr))
complaint (&symfile_complaints, complaint (&symfile_complaints,
_("No DW_FORM_block* DW_AT_GNU_call_site_data_value for " _("No DW_FORM_block* DW_AT_call_data_value for "
"DW_TAG_GNU_call_site child DIE 0x%x [in module %s]"), "DW_TAG_call_site child DIE 0x%x [in module %s]"),
child_die->offset.sect_off, objfile_name (objfile)); child_die->offset.sect_off, objfile_name (objfile));
else else
{ {

View file

@ -1041,12 +1041,12 @@ struct func_type
unsigned int is_noreturn : 1; unsigned int is_noreturn : 1;
/* * Only those DW_TAG_GNU_call_site's in this function that have /* * Only those DW_TAG_call_site's in this function that have
DW_AT_GNU_tail_call set are linked in this list. Function DW_AT_call_tail_call set are linked in this list. Function
without its tail call list complete without its tail call list complete
(DW_AT_GNU_all_tail_call_sites or its superset (DW_AT_call_all_tail_calls or its superset
DW_AT_GNU_all_call_sites) has TAIL_CALL_LIST NULL, even if some DW_AT_call_all_calls) has TAIL_CALL_LIST NULL, even if some
DW_TAG_GNU_call_site's exist in such function. */ DW_TAG_call_site's exist in such function. */
struct call_site *tail_call_list; struct call_site *tail_call_list;
@ -1106,13 +1106,12 @@ struct call_site_parameter
union call_site_parameter_u u; union call_site_parameter_u u;
/* * DW_TAG_formal_parameter's DW_AT_GNU_call_site_value. It /* * DW_TAG_formal_parameter's DW_AT_call_value. It is never NULL. */
is never NULL. */
const gdb_byte *value; const gdb_byte *value;
size_t value_size; size_t value_size;
/* * DW_TAG_formal_parameter's DW_AT_GNU_call_site_data_value. /* * DW_TAG_formal_parameter's DW_AT_call_data_value.
It may be NULL if not provided by DWARF. */ It may be NULL if not provided by DWARF. */
const gdb_byte *data_value; const gdb_byte *data_value;
@ -1120,8 +1119,7 @@ struct call_site_parameter
}; };
/* * A place where a function gets called from, represented by /* * A place where a function gets called from, represented by
DW_TAG_GNU_call_site. It can be looked up from DW_TAG_call_site. It can be looked up from symtab->call_site_htab. */
symtab->call_site_htab. */
struct call_site struct call_site
{ {
@ -1135,7 +1133,7 @@ struct call_site
struct call_site *tail_call_next; struct call_site *tail_call_next;
/* * Describe DW_AT_GNU_call_site_target. Missing attribute uses /* * Describe DW_AT_call_target. Missing attribute uses
FIELD_LOC_KIND_DWARF_BLOCK with FIELD_DWARF_BLOCK == NULL. */ FIELD_LOC_KIND_DWARF_BLOCK with FIELD_DWARF_BLOCK == NULL. */
struct call_site_target target; struct call_site_target target;
@ -1149,7 +1147,7 @@ struct call_site
struct dwarf2_per_cu_data *per_cu; struct dwarf2_per_cu_data *per_cu;
/* * Describe DW_TAG_GNU_call_site's DW_TAG_formal_parameter. */ /* * Describe DW_TAG_call_site's DW_TAG_formal_parameter. */
struct call_site_parameter parameter[1]; struct call_site_parameter parameter[1];
}; };

View file

@ -407,10 +407,9 @@ read_frame_arg (struct symbol *sym, struct frame_info *frame,
/* Initialize it just to avoid a GCC false warning. */ /* Initialize it just to avoid a GCC false warning. */
struct value *val_deref = NULL, *entryval_deref; struct value *val_deref = NULL, *entryval_deref;
/* DW_AT_GNU_call_site_value does match with the current /* DW_AT_call_value does match with the current
value. If it is a reference still try to verify if value. If it is a reference still try to verify if
dereferenced DW_AT_GNU_call_site_data_value does not dereferenced DW_AT_call_data_value does not differ. */
differ. */
TRY TRY
{ {

View file

@ -129,7 +129,7 @@ OP (OP_VAR_VALUE)
/* OP_VAR_ENTRY_VALUE takes one struct symbol * in the following element, /* OP_VAR_ENTRY_VALUE takes one struct symbol * in the following element,
followed by another OP_VAR_ENTRY_VALUE, making three exp_elements. followed by another OP_VAR_ENTRY_VALUE, making three exp_elements.
somename@entry may mean parameter value as present at the entry of the somename@entry may mean parameter value as present at the entry of the
current function. Implemented via DW_OP_GNU_entry_value. */ current function. Implemented via DW_OP_entry_value. */
OP (OP_VAR_ENTRY_VALUE) OP (OP_VAR_ENTRY_VALUE)
/* OP_LAST is followed by an integer in the next exp_element. /* OP_LAST is followed by an integer in the next exp_element.

View file

@ -1,3 +1,11 @@
2017-02-20 Jan Kratochvil <jan.kratochvil@redhat.com>
* gdb.arch/amd64-entry-value-param-dwarf5.S: New file.
* gdb.arch/amd64-entry-value-param-dwarf5.c: New file.
* gdb.arch/amd64-entry-value-param-dwarf5.exp: New file.
* gdb.arch/amd64-entry-value.exp: Rename DW_OP_GNU_*, DW_TAG_GNU_* and
DW_AT_GNU_*.
2017-02-20 Jan Kratochvil <jan.kratochvil@redhat.com> 2017-02-20 Jan Kratochvil <jan.kratochvil@redhat.com>
* gdb.dwarf2/dw2-error.exp (file $testfile): Update expected string. * gdb.dwarf2/dw2-error.exp (file $testfile): Update expected string.

View file

@ -0,0 +1,699 @@
/* This testcase is part of GDB, the GNU debugger.
Copyright 2012-2017 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* This file is compiled from gdb.arch/amd64-entry-value-param-dwarf5.c
using -g -dA -S -O2. */
.file "amd64-entry-value-param-dwarf5.c"
.text
.Ltext0:
.p2align 4,,15
.type foo.isra.0.constprop.2, @function
foo.isra.0.constprop.2:
.LFB4:
/* gdb.arch/amd64-entry-value-param-dwarf5.c:21 */
.LM1:
.cfi_startproc
.LVL0:
/* BLOCK 2 freq:10000 seq:0 */
/* PRED: ENTRY [100.0%] (FALLTHRU) */
/* gdb.arch/amd64-entry-value-param-dwarf5.c:26 */
.LM2:
movl vv(%rip), %eax
addl $1, %eax
movl %eax, vv(%rip)
/* gdb.arch/amd64-entry-value-param-dwarf5.c:27 */
.LM3:
leal 3(%rdi), %eax
/* SUCC: EXIT [100.0%] */
/* gdb.arch/amd64-entry-value-param-dwarf5.c:28 */
.LM4:
ret
.cfi_endproc
.LFE4:
.size foo.isra.0.constprop.2, .-foo.isra.0.constprop.2
.p2align 4,,15
.type bar.constprop.1, @function
bar.constprop.1:
.LFB5:
/* gdb.arch/amd64-entry-value-param-dwarf5.c:31 */
.LM5:
.cfi_startproc
/* BLOCK 2 freq:10000 seq:0 */
/* PRED: ENTRY [100.0%] (FALLTHRU) */
.LVL1:
/* gdb.arch/amd64-entry-value-param-dwarf5.c:33 */
.LM6:
movl $10, %edi
call foo.isra.0.constprop.2
.LVL2:
movl $10, %edi
movl %eax, %edx
call foo.isra.0.constprop.2
.LVL3:
movl $16, %edi
addl %eax, %edx
call foo.isra.0.constprop.2
.LVL4:
leal 10(%rdx,%rax), %eax
/* SUCC: EXIT [100.0%] */
/* gdb.arch/amd64-entry-value-param-dwarf5.c:34 */
.LM7:
ret
.cfi_endproc
.LFE5:
.size bar.constprop.1, .-bar.constprop.1
.section .text.startup,"ax",@progbits
.p2align 4,,15
.globl main
.type main, @function
main:
.LFB2:
/* gdb.arch/amd64-entry-value-param-dwarf5.c:38 */
.LM8:
.cfi_startproc
/* BLOCK 2 freq:10000 seq:0 */
/* PRED: ENTRY [100.0%] (FALLTHRU) */
/* SUCC: EXIT [100.0%] (ABNORMAL,SIBCALL) */
/* gdb.arch/amd64-entry-value-param-dwarf5.c:39 */
.LM9:
jmp bar.constprop.1
.LVL5:
.cfi_endproc
.LFE2:
.size main, .-main
.comm vv,4,4
.text
.Letext0:
.section .debug_info,"",@progbits
.Ldebug_info0:
.long 0x199 /* Length of Compilation Unit Info */
.value 0x5 /* DWARF version number */
.byte 0x1 /* DW_UT_compile */
.byte 0x8 /* Pointer Size (in bytes) */
.long .Ldebug_abbrev0 /* Offset Into Abbrev. Section */
.uleb128 0xa /* (DIE (0xc) DW_TAG_compile_unit) */
.long .LASF2 /* DW_AT_producer: "GNU C11 7.0.1 20170218 (experimental) -mtune=generic -march=x86-64 -gdwarf-5 -O2" */
.byte 0x1d /* DW_AT_language */
.long .LASF0 /* DW_AT_name: "gdb.arch/amd64-entry-value-param-dwarf5.c" */
.long .LASF1 /* DW_AT_comp_dir: "" */
.long .LLRL0 /* DW_AT_ranges */
.quad 0 /* DW_AT_low_pc */
.long .Ldebug_line0 /* DW_AT_stmt_list */
.uleb128 0xb /* (DIE (0x2a) DW_TAG_variable) */
.ascii "vv\0" /* DW_AT_name */
.byte 0x1 /* DW_AT_decl_file (gdb.arch/amd64-entry-value-param-dwarf5.c) */
.byte 0x12 /* DW_AT_decl_line */
.long 0x45 /* DW_AT_type */
/* DW_AT_external */
.uleb128 0x9 /* DW_AT_location */
.byte 0x3 /* DW_OP_addr */
.quad vv
.uleb128 0xc /* (DIE (0x3e) DW_TAG_base_type) */
.byte 0x4 /* DW_AT_byte_size */
.byte 0x5 /* DW_AT_encoding */
.ascii "int\0" /* DW_AT_name */
.uleb128 0xd /* (DIE (0x45) DW_TAG_volatile_type) */
.long 0x3e /* DW_AT_type */
.uleb128 0xe /* (DIE (0x4a) DW_TAG_subprogram) */
/* DW_AT_external */
.long .LASF3 /* DW_AT_name: "main" */
.byte 0x1 /* DW_AT_decl_file (gdb.arch/amd64-entry-value-param-dwarf5.c) */
.byte 0x25 /* DW_AT_decl_line */
/* DW_AT_prototyped */
.long 0x3e /* DW_AT_type */
.quad .LFB2 /* DW_AT_low_pc */
.quad .LFE2-.LFB2 /* DW_AT_high_pc */
.uleb128 0x1 /* DW_AT_frame_base */
.byte 0x9c /* DW_OP_call_frame_cfa */
/* DW_AT_call_all_calls */
.long 0x79 /* DW_AT_sibling */
.uleb128 0xf /* (DIE (0x6b) DW_TAG_call_site) */
.quad .LVL5 /* DW_AT_call_return_pc */
/* DW_AT_call_tail_call */
.long 0x125 /* DW_AT_call_origin */
.byte 0 /* end of children of DIE 0x4a */
.uleb128 0x5 /* (DIE (0x79) DW_TAG_subprogram) */
.ascii "bar\0" /* DW_AT_name */
/* DW_AT_decl_file (1, gdb.arch/amd64-entry-value-param-dwarf5.c) */
.byte 0x1f /* DW_AT_decl_line */
/* DW_AT_prototyped */
.long 0x3e /* DW_AT_type */
.byte 0x1 /* DW_AT_inline */
.long 0x91 /* DW_AT_sibling */
.uleb128 0x1 /* (DIE (0x88) DW_TAG_formal_parameter) */
.ascii "x\0" /* DW_AT_name */
/* DW_AT_decl_file (1, gdb.arch/amd64-entry-value-param-dwarf5.c) */
.byte 0x1f /* DW_AT_decl_line */
.long 0x3e /* DW_AT_type */
.byte 0 /* end of children of DIE 0x79 */
.uleb128 0x5 /* (DIE (0x91) DW_TAG_subprogram) */
.ascii "foo\0" /* DW_AT_name */
/* DW_AT_decl_file (1, gdb.arch/amd64-entry-value-param-dwarf5.c) */
.byte 0x15 /* DW_AT_decl_line */
/* DW_AT_prototyped */
.long 0x3e /* DW_AT_type */
.byte 0 /* DW_AT_inline */
.long 0xd1 /* DW_AT_sibling */
.uleb128 0x1 /* (DIE (0xa0) DW_TAG_formal_parameter) */
.ascii "x\0" /* DW_AT_name */
/* DW_AT_decl_file (1, gdb.arch/amd64-entry-value-param-dwarf5.c) */
.byte 0x15 /* DW_AT_decl_line */
.long 0x3e /* DW_AT_type */
.uleb128 0x1 /* (DIE (0xa8) DW_TAG_formal_parameter) */
.ascii "y\0" /* DW_AT_name */
/* DW_AT_decl_file (1, gdb.arch/amd64-entry-value-param-dwarf5.c) */
.byte 0x15 /* DW_AT_decl_line */
.long 0x3e /* DW_AT_type */
.uleb128 0x1 /* (DIE (0xb0) DW_TAG_formal_parameter) */
.ascii "z\0" /* DW_AT_name */
/* DW_AT_decl_file (1, gdb.arch/amd64-entry-value-param-dwarf5.c) */
.byte 0x15 /* DW_AT_decl_line */
.long 0x3e /* DW_AT_type */
.uleb128 0x2 /* (DIE (0xb8) DW_TAG_variable) */
.ascii "a\0" /* DW_AT_name */
/* DW_AT_decl_file (1, gdb.arch/amd64-entry-value-param-dwarf5.c) */
.byte 0x17 /* DW_AT_decl_line */
.long 0x3e /* DW_AT_type */
.uleb128 0x2 /* (DIE (0xc0) DW_TAG_variable) */
.ascii "b\0" /* DW_AT_name */
/* DW_AT_decl_file (1, gdb.arch/amd64-entry-value-param-dwarf5.c) */
.byte 0x18 /* DW_AT_decl_line */
.long 0x3e /* DW_AT_type */
.uleb128 0x2 /* (DIE (0xc8) DW_TAG_variable) */
.ascii "c\0" /* DW_AT_name */
/* DW_AT_decl_file (1, gdb.arch/amd64-entry-value-param-dwarf5.c) */
.byte 0x19 /* DW_AT_decl_line */
.long 0x3e /* DW_AT_type */
.byte 0 /* end of children of DIE 0x91 */
.uleb128 0x10 /* (DIE (0xd1) DW_TAG_subprogram) */
.long 0x91 /* DW_AT_abstract_origin */
.quad .LFB4 /* DW_AT_low_pc */
.quad .LFE4-.LFB4 /* DW_AT_high_pc */
.uleb128 0x1 /* DW_AT_frame_base */
.byte 0x9c /* DW_OP_call_frame_cfa */
/* DW_AT_call_all_calls */
.long 0x125 /* DW_AT_sibling */
.uleb128 0x6 /* (DIE (0xec) DW_TAG_formal_parameter) */
.long 0xa0 /* DW_AT_abstract_origin */
.uleb128 0x1 /* DW_AT_location */
.byte 0x55 /* DW_OP_reg5 */
.uleb128 0x6 /* (DIE (0xf3) DW_TAG_formal_parameter) */
.long 0xa8 /* DW_AT_abstract_origin */
.uleb128 0x6 /* DW_AT_location */
.byte 0xfa /* DW_OP_GNU_parameter_ref */
.long 0xa8
.byte 0x9f /* DW_OP_stack_value */
.uleb128 0x7 /* (DIE (0xff) DW_TAG_variable) */
.long 0xb8 /* DW_AT_abstract_origin */
.uleb128 0x5 /* DW_AT_location */
.byte 0x75 /* DW_OP_breg5 */
.sleb128 0
.byte 0x31 /* DW_OP_lit1 */
.byte 0x24 /* DW_OP_shl */
.byte 0x9f /* DW_OP_stack_value */
.uleb128 0x7 /* (DIE (0x10a) DW_TAG_variable) */
.long 0xc0 /* DW_AT_abstract_origin */
.uleb128 0x8 /* DW_AT_location */
.byte 0xfa /* DW_OP_GNU_parameter_ref */
.long 0xa8
.byte 0x31 /* DW_OP_lit1 */
.byte 0x24 /* DW_OP_shl */
.byte 0x9f /* DW_OP_stack_value */
.uleb128 0x11 /* (DIE (0x118) DW_TAG_variable) */
.long 0xc8 /* DW_AT_abstract_origin */
.byte 0x6 /* DW_AT_const_value */
.uleb128 0x8 /* (DIE (0x11e) DW_TAG_formal_parameter) */
.long 0xb0 /* DW_AT_abstract_origin */
.byte 0x3 /* DW_AT_const_value */
.byte 0 /* end of children of DIE 0xd1 */
.uleb128 0x12 /* (DIE (0x125) DW_TAG_subprogram) */
.long 0x79 /* DW_AT_abstract_origin */
.quad .LFB5 /* DW_AT_low_pc */
.quad .LFE5-.LFB5 /* DW_AT_high_pc */
.uleb128 0x1 /* DW_AT_frame_base */
.byte 0x9c /* DW_OP_call_frame_cfa */
/* DW_AT_call_all_calls */
.uleb128 0x8 /* (DIE (0x13c) DW_TAG_formal_parameter) */
.long 0x88 /* DW_AT_abstract_origin */
.byte 0xa /* DW_AT_const_value */
.uleb128 0x9 /* (DIE (0x142) DW_TAG_call_site) */
.quad .LVL2 /* DW_AT_call_return_pc */
.long 0xd1 /* DW_AT_call_origin */
.long 0x161 /* DW_AT_sibling */
.uleb128 0x3 /* (DIE (0x153) DW_TAG_call_site_parameter) */
.uleb128 0x1 /* DW_AT_location */
.byte 0x55 /* DW_OP_reg5 */
.uleb128 0x2 /* DW_AT_call_value */
.byte 0x75 /* DW_OP_breg5 */
.sleb128 0
.uleb128 0x4 /* (DIE (0x159) DW_TAG_call_site_parameter) */
.long 0xa8 /* DW_AT_call_parameter */
.uleb128 0x1 /* DW_AT_call_value */
.byte 0x32 /* DW_OP_lit2 */
.byte 0 /* end of children of DIE 0x142 */
.uleb128 0x9 /* (DIE (0x161) DW_TAG_call_site) */
.quad .LVL3 /* DW_AT_call_return_pc */
.long 0xd1 /* DW_AT_call_origin */
.long 0x180 /* DW_AT_sibling */
.uleb128 0x3 /* (DIE (0x172) DW_TAG_call_site_parameter) */
.uleb128 0x1 /* DW_AT_location */
.byte 0x55 /* DW_OP_reg5 */
.uleb128 0x2 /* DW_AT_call_value */
.byte 0x75 /* DW_OP_breg5 */
.sleb128 0
.uleb128 0x4 /* (DIE (0x178) DW_TAG_call_site_parameter) */
.long 0xa8 /* DW_AT_call_parameter */
.uleb128 0x1 /* DW_AT_call_value */
.byte 0x34 /* DW_OP_lit4 */
.byte 0 /* end of children of DIE 0x161 */
.uleb128 0x13 /* (DIE (0x180) DW_TAG_call_site) */
.quad .LVL4 /* DW_AT_call_return_pc */
.long 0xd1 /* DW_AT_call_origin */
.uleb128 0x3 /* (DIE (0x18d) DW_TAG_call_site_parameter) */
.uleb128 0x1 /* DW_AT_location */
.byte 0x55 /* DW_OP_reg5 */
.uleb128 0x2 /* DW_AT_call_value */
.byte 0x75 /* DW_OP_breg5 */
.sleb128 0
.uleb128 0x4 /* (DIE (0x193) DW_TAG_call_site_parameter) */
.long 0xa8 /* DW_AT_call_parameter */
.uleb128 0x1 /* DW_AT_call_value */
.byte 0x3a /* DW_OP_lit10 */
.byte 0 /* end of children of DIE 0x180 */
.byte 0 /* end of children of DIE 0x125 */
.byte 0 /* end of children of DIE 0xc */
.section .debug_abbrev,"",@progbits
.Ldebug_abbrev0:
.uleb128 0x1 /* (abbrev code) */
.uleb128 0x5 /* (TAG: DW_TAG_formal_parameter) */
.byte 0 /* DW_children_no */
.uleb128 0x3 /* (DW_AT_name) */
.uleb128 0x8 /* (DW_FORM_string) */
.uleb128 0x3a /* (DW_AT_decl_file) */
.uleb128 0x21 /* (DW_FORM_implicit_const) */
.sleb128 1 /* (gdb.arch/amd64-entry-value-param-dwarf5.c) */
.uleb128 0x3b /* (DW_AT_decl_line) */
.uleb128 0xb /* (DW_FORM_data1) */
.uleb128 0x49 /* (DW_AT_type) */
.uleb128 0x13 /* (DW_FORM_ref4) */
.byte 0
.byte 0
.uleb128 0x2 /* (abbrev code) */
.uleb128 0x34 /* (TAG: DW_TAG_variable) */
.byte 0 /* DW_children_no */
.uleb128 0x3 /* (DW_AT_name) */
.uleb128 0x8 /* (DW_FORM_string) */
.uleb128 0x3a /* (DW_AT_decl_file) */
.uleb128 0x21 /* (DW_FORM_implicit_const) */
.sleb128 1 /* (gdb.arch/amd64-entry-value-param-dwarf5.c) */
.uleb128 0x3b /* (DW_AT_decl_line) */
.uleb128 0xb /* (DW_FORM_data1) */
.uleb128 0x49 /* (DW_AT_type) */
.uleb128 0x13 /* (DW_FORM_ref4) */
.byte 0
.byte 0
.uleb128 0x3 /* (abbrev code) */
.uleb128 0x49 /* (TAG: DW_TAG_call_site_parameter) */
.byte 0 /* DW_children_no */
.uleb128 0x2 /* (DW_AT_location) */
.uleb128 0x18 /* (DW_FORM_exprloc) */
.uleb128 0x7e /* (DW_AT_call_value) */
.uleb128 0x18 /* (DW_FORM_exprloc) */
.byte 0
.byte 0
.uleb128 0x4 /* (abbrev code) */
.uleb128 0x49 /* (TAG: DW_TAG_call_site_parameter) */
.byte 0 /* DW_children_no */
.uleb128 0x80 /* (DW_AT_call_parameter) */
.uleb128 0x13 /* (DW_FORM_ref4) */
.uleb128 0x7e /* (DW_AT_call_value) */
.uleb128 0x18 /* (DW_FORM_exprloc) */
.byte 0
.byte 0
.uleb128 0x5 /* (abbrev code) */
.uleb128 0x2e /* (TAG: DW_TAG_subprogram) */
.byte 0x1 /* DW_children_yes */
.uleb128 0x3 /* (DW_AT_name) */
.uleb128 0x8 /* (DW_FORM_string) */
.uleb128 0x3a /* (DW_AT_decl_file) */
.uleb128 0x21 /* (DW_FORM_implicit_const) */
.sleb128 1 /* (gdb.arch/amd64-entry-value-param-dwarf5.c) */
.uleb128 0x3b /* (DW_AT_decl_line) */
.uleb128 0xb /* (DW_FORM_data1) */
.uleb128 0x27 /* (DW_AT_prototyped) */
.uleb128 0x19 /* (DW_FORM_flag_present) */
.uleb128 0x49 /* (DW_AT_type) */
.uleb128 0x13 /* (DW_FORM_ref4) */
.uleb128 0x20 /* (DW_AT_inline) */
.uleb128 0xb /* (DW_FORM_data1) */
.uleb128 0x1 /* (DW_AT_sibling) */
.uleb128 0x13 /* (DW_FORM_ref4) */
.byte 0
.byte 0
.uleb128 0x6 /* (abbrev code) */
.uleb128 0x5 /* (TAG: DW_TAG_formal_parameter) */
.byte 0 /* DW_children_no */
.uleb128 0x31 /* (DW_AT_abstract_origin) */
.uleb128 0x13 /* (DW_FORM_ref4) */
.uleb128 0x2 /* (DW_AT_location) */
.uleb128 0x18 /* (DW_FORM_exprloc) */
.byte 0
.byte 0
.uleb128 0x7 /* (abbrev code) */
.uleb128 0x34 /* (TAG: DW_TAG_variable) */
.byte 0 /* DW_children_no */
.uleb128 0x31 /* (DW_AT_abstract_origin) */
.uleb128 0x13 /* (DW_FORM_ref4) */
.uleb128 0x2 /* (DW_AT_location) */
.uleb128 0x18 /* (DW_FORM_exprloc) */
.byte 0
.byte 0
.uleb128 0x8 /* (abbrev code) */
.uleb128 0x5 /* (TAG: DW_TAG_formal_parameter) */
.byte 0 /* DW_children_no */
.uleb128 0x31 /* (DW_AT_abstract_origin) */
.uleb128 0x13 /* (DW_FORM_ref4) */
.uleb128 0x1c /* (DW_AT_const_value) */
.uleb128 0xb /* (DW_FORM_data1) */
.byte 0
.byte 0
.uleb128 0x9 /* (abbrev code) */
.uleb128 0x48 /* (TAG: DW_TAG_call_site) */
.byte 0x1 /* DW_children_yes */
.uleb128 0x7d /* (DW_AT_call_return_pc) */
.uleb128 0x1 /* (DW_FORM_addr) */
.uleb128 0x7f /* (DW_AT_call_origin) */
.uleb128 0x13 /* (DW_FORM_ref4) */
.uleb128 0x1 /* (DW_AT_sibling) */
.uleb128 0x13 /* (DW_FORM_ref4) */
.byte 0
.byte 0
.uleb128 0xa /* (abbrev code) */
.uleb128 0x11 /* (TAG: DW_TAG_compile_unit) */
.byte 0x1 /* DW_children_yes */
.uleb128 0x25 /* (DW_AT_producer) */
.uleb128 0xe /* (DW_FORM_strp) */
.uleb128 0x13 /* (DW_AT_language) */
.uleb128 0xb /* (DW_FORM_data1) */
.uleb128 0x3 /* (DW_AT_name) */
.uleb128 0x1f /* (DW_FORM_line_strp) */
.uleb128 0x1b /* (DW_AT_comp_dir) */
.uleb128 0x1f /* (DW_FORM_line_strp) */
.uleb128 0x55 /* (DW_AT_ranges) */
.uleb128 0x17 /* (DW_FORM_sec_offset) */
.uleb128 0x11 /* (DW_AT_low_pc) */
.uleb128 0x1 /* (DW_FORM_addr) */
.uleb128 0x10 /* (DW_AT_stmt_list) */
.uleb128 0x17 /* (DW_FORM_sec_offset) */
.byte 0
.byte 0
.uleb128 0xb /* (abbrev code) */
.uleb128 0x34 /* (TAG: DW_TAG_variable) */
.byte 0 /* DW_children_no */
.uleb128 0x3 /* (DW_AT_name) */
.uleb128 0x8 /* (DW_FORM_string) */
.uleb128 0x3a /* (DW_AT_decl_file) */
.uleb128 0xb /* (DW_FORM_data1) */
.uleb128 0x3b /* (DW_AT_decl_line) */
.uleb128 0xb /* (DW_FORM_data1) */
.uleb128 0x49 /* (DW_AT_type) */
.uleb128 0x13 /* (DW_FORM_ref4) */
.uleb128 0x3f /* (DW_AT_external) */
.uleb128 0x19 /* (DW_FORM_flag_present) */
.uleb128 0x2 /* (DW_AT_location) */
.uleb128 0x18 /* (DW_FORM_exprloc) */
.byte 0
.byte 0
.uleb128 0xc /* (abbrev code) */
.uleb128 0x24 /* (TAG: DW_TAG_base_type) */
.byte 0 /* DW_children_no */
.uleb128 0xb /* (DW_AT_byte_size) */
.uleb128 0xb /* (DW_FORM_data1) */
.uleb128 0x3e /* (DW_AT_encoding) */
.uleb128 0xb /* (DW_FORM_data1) */
.uleb128 0x3 /* (DW_AT_name) */
.uleb128 0x8 /* (DW_FORM_string) */
.byte 0
.byte 0
.uleb128 0xd /* (abbrev code) */
.uleb128 0x35 /* (TAG: DW_TAG_volatile_type) */
.byte 0 /* DW_children_no */
.uleb128 0x49 /* (DW_AT_type) */
.uleb128 0x13 /* (DW_FORM_ref4) */
.byte 0
.byte 0
.uleb128 0xe /* (abbrev code) */
.uleb128 0x2e /* (TAG: DW_TAG_subprogram) */
.byte 0x1 /* DW_children_yes */
.uleb128 0x3f /* (DW_AT_external) */
.uleb128 0x19 /* (DW_FORM_flag_present) */
.uleb128 0x3 /* (DW_AT_name) */
.uleb128 0xe /* (DW_FORM_strp) */
.uleb128 0x3a /* (DW_AT_decl_file) */
.uleb128 0xb /* (DW_FORM_data1) */
.uleb128 0x3b /* (DW_AT_decl_line) */
.uleb128 0xb /* (DW_FORM_data1) */
.uleb128 0x27 /* (DW_AT_prototyped) */
.uleb128 0x19 /* (DW_FORM_flag_present) */
.uleb128 0x49 /* (DW_AT_type) */
.uleb128 0x13 /* (DW_FORM_ref4) */
.uleb128 0x11 /* (DW_AT_low_pc) */
.uleb128 0x1 /* (DW_FORM_addr) */
.uleb128 0x12 /* (DW_AT_high_pc) */
.uleb128 0x7 /* (DW_FORM_data8) */
.uleb128 0x40 /* (DW_AT_frame_base) */
.uleb128 0x18 /* (DW_FORM_exprloc) */
.uleb128 0x7a /* (DW_AT_call_all_calls) */
.uleb128 0x19 /* (DW_FORM_flag_present) */
.uleb128 0x1 /* (DW_AT_sibling) */
.uleb128 0x13 /* (DW_FORM_ref4) */
.byte 0
.byte 0
.uleb128 0xf /* (abbrev code) */
.uleb128 0x48 /* (TAG: DW_TAG_call_site) */
.byte 0 /* DW_children_no */
.uleb128 0x7d /* (DW_AT_call_return_pc) */
.uleb128 0x1 /* (DW_FORM_addr) */
.uleb128 0x82 /* (DW_AT_call_tail_call) */
.uleb128 0x19 /* (DW_FORM_flag_present) */
.uleb128 0x7f /* (DW_AT_call_origin) */
.uleb128 0x13 /* (DW_FORM_ref4) */
.byte 0
.byte 0
.uleb128 0x10 /* (abbrev code) */
.uleb128 0x2e /* (TAG: DW_TAG_subprogram) */
.byte 0x1 /* DW_children_yes */
.uleb128 0x31 /* (DW_AT_abstract_origin) */
.uleb128 0x13 /* (DW_FORM_ref4) */
.uleb128 0x11 /* (DW_AT_low_pc) */
.uleb128 0x1 /* (DW_FORM_addr) */
.uleb128 0x12 /* (DW_AT_high_pc) */
.uleb128 0x7 /* (DW_FORM_data8) */
.uleb128 0x40 /* (DW_AT_frame_base) */
.uleb128 0x18 /* (DW_FORM_exprloc) */
.uleb128 0x7a /* (DW_AT_call_all_calls) */
.uleb128 0x19 /* (DW_FORM_flag_present) */
.uleb128 0x1 /* (DW_AT_sibling) */
.uleb128 0x13 /* (DW_FORM_ref4) */
.byte 0
.byte 0
.uleb128 0x11 /* (abbrev code) */
.uleb128 0x34 /* (TAG: DW_TAG_variable) */
.byte 0 /* DW_children_no */
.uleb128 0x31 /* (DW_AT_abstract_origin) */
.uleb128 0x13 /* (DW_FORM_ref4) */
.uleb128 0x1c /* (DW_AT_const_value) */
.uleb128 0xb /* (DW_FORM_data1) */
.byte 0
.byte 0
.uleb128 0x12 /* (abbrev code) */
.uleb128 0x2e /* (TAG: DW_TAG_subprogram) */
.byte 0x1 /* DW_children_yes */
.uleb128 0x31 /* (DW_AT_abstract_origin) */
.uleb128 0x13 /* (DW_FORM_ref4) */
.uleb128 0x11 /* (DW_AT_low_pc) */
.uleb128 0x1 /* (DW_FORM_addr) */
.uleb128 0x12 /* (DW_AT_high_pc) */
.uleb128 0x7 /* (DW_FORM_data8) */
.uleb128 0x40 /* (DW_AT_frame_base) */
.uleb128 0x18 /* (DW_FORM_exprloc) */
.uleb128 0x7a /* (DW_AT_call_all_calls) */
.uleb128 0x19 /* (DW_FORM_flag_present) */
.byte 0
.byte 0
.uleb128 0x13 /* (abbrev code) */
.uleb128 0x48 /* (TAG: DW_TAG_call_site) */
.byte 0x1 /* DW_children_yes */
.uleb128 0x7d /* (DW_AT_call_return_pc) */
.uleb128 0x1 /* (DW_FORM_addr) */
.uleb128 0x7f /* (DW_AT_call_origin) */
.uleb128 0x13 /* (DW_FORM_ref4) */
.byte 0
.byte 0
.byte 0
.section .debug_aranges,"",@progbits
.long 0x3c /* Length of Address Ranges Info */
.value 0x2 /* DWARF Version */
.long .Ldebug_info0 /* Offset of Compilation Unit Info */
.byte 0x8 /* Size of Address */
.byte 0 /* Size of Segment Descriptor */
.value 0 /* Pad to 16 byte boundary */
.value 0
.quad .Ltext0 /* Address */
.quad .Letext0-.Ltext0 /* Length */
.quad .LFB2 /* Address */
.quad .LFE2-.LFB2 /* Length */
.quad 0
.quad 0
.section .debug_rnglists,"",@progbits
.Ldebug_ranges0:
.long .Ldebug_ranges3-.Ldebug_ranges2 /* Length of Range Lists */
.Ldebug_ranges2:
.value 0x5 /* DWARF Version */
.byte 0x8 /* Address Size */
.byte 0 /* Segment Size */
.long 0 /* Offset Entry Count */
.LLRL0:
.byte 0x7 /* DW_RLE_start_length (*.LLRL0) */
.quad .Ltext0 /* Range begin address (*.LLRL0) */
.uleb128 .Letext0-.Ltext0 /* Range length (*.LLRL0) */
.byte 0x7 /* DW_RLE_start_length (*.LLRL0) */
.quad .LFB2 /* Range begin address (*.LLRL0) */
.uleb128 .LFE2-.LFB2 /* Range length (*.LLRL0) */
.byte 0 /* DW_RLE_end_of_list (*.LLRL0) */
.Ldebug_ranges3:
.section .debug_line,"",@progbits
.Ldebug_line0:
.long .LELT0-.LSLT0 /* Length of Source Line Info */
.LSLT0:
.value 0x5 /* DWARF Version */
.byte 0x8 /* Address Size */
.byte 0 /* Segment Size */
.long .LELTP0-.LASLTP0 /* Prolog Length */
.LASLTP0:
.byte 0x1 /* Minimum Instruction Length */
.byte 0x1 /* Maximum Operations Per Instruction */
.byte 0x1 /* Default is_stmt_start flag */
.byte 0xf6 /* Line Base Value (Special Opcodes) */
.byte 0xf2 /* Line Range Value (Special Opcodes) */
.byte 0xd /* Special Opcode Base */
.byte 0 /* opcode: 0x1 has 0 args */
.byte 0x1 /* opcode: 0x2 has 1 args */
.byte 0x1 /* opcode: 0x3 has 1 args */
.byte 0x1 /* opcode: 0x4 has 1 args */
.byte 0x1 /* opcode: 0x5 has 1 args */
.byte 0 /* opcode: 0x6 has 0 args */
.byte 0 /* opcode: 0x7 has 0 args */
.byte 0 /* opcode: 0x8 has 0 args */
.byte 0x1 /* opcode: 0x9 has 1 args */
.byte 0 /* opcode: 0xa has 0 args */
.byte 0 /* opcode: 0xb has 0 args */
.byte 0x1 /* opcode: 0xc has 1 args */
.byte 0x1 /* Directory entry format count */
.uleb128 0x1 /* DW_LNCT_path */
.uleb128 0x1f /* DW_FORM_line_strp */
.uleb128 0x2 /* Directories count */
.long .LASF1 /* Directory Entry: 0: "" */
.long .LASF4 /* Directory Entry: 0: "gdb.arch" */
.byte 0x2 /* File name entry format count */
.uleb128 0x1 /* DW_LNCT_path */
.uleb128 0x1f /* DW_FORM_line_strp */
.uleb128 0x2 /* DW_LNCT_directory_index */
.uleb128 0xb /* DW_FORM_data1 */
.uleb128 0x2 /* File names count */
.long .LASF0 /* File Entry: 0: "gdb.arch/amd64-entry-value-param-dwarf5.c" */
.byte 0
.long .LASF5 /* File Entry: 0: "amd64-entry-value-param-dwarf5.c" */
.byte 0x1
.LELTP0:
.byte 0 /* set address *.LM8 */
.uleb128 0x9
.byte 0x2
.quad .LM8
.byte 0x3c /* line 38 */
.byte 0 /* set address *.LM9 */
.uleb128 0x9
.byte 0x2
.quad .LM9
.byte 0x18 /* line 39 */
.byte 0 /* set address *.LFE2 */
.uleb128 0x9
.byte 0x2
.quad .LFE2
.byte 0 /* end sequence */
.uleb128 0x1
.byte 0x1
.byte 0 /* set address *.LM1 */
.uleb128 0x9
.byte 0x2
.quad .LM1
.byte 0x2b /* line 21 */
.byte 0 /* set address *.LM2 */
.uleb128 0x9
.byte 0x2
.quad .LM2
.byte 0x1c /* line 26 */
.byte 0 /* set address *.LM3 */
.uleb128 0x9
.byte 0x2
.quad .LM3
.byte 0x18 /* line 27 */
.byte 0 /* set address *.LM4 */
.uleb128 0x9
.byte 0x2
.quad .LM4
.byte 0x18 /* line 28 */
.byte 0 /* set address *.LM5 */
.uleb128 0x9
.byte 0x2
.quad .LM5
.byte 0x1a /* line 31 */
.byte 0 /* set address *.LM6 */
.uleb128 0x9
.byte 0x2
.quad .LM6
.byte 0x19 /* line 33 */
.byte 0 /* set address *.LM7 */
.uleb128 0x9
.byte 0x2
.quad .LM7
.byte 0x18 /* line 34 */
.byte 0 /* set address *.Letext0 */
.uleb128 0x9
.byte 0x2
.quad .Letext0
.byte 0 /* end sequence */
.uleb128 0x1
.byte 0x1
.LELT0:
.section .debug_str,"MS",@progbits,1
.LASF2:
.string "GNU C11 7.0.1 20170218 (experimental) -mtune=generic -march=x86-64 -gdwarf-5 -O2"
.LASF3:
.string "main"
.section .debug_line_str,"MS",@progbits,1
.LASF5:
.string "amd64-entry-value-param-dwarf5.c"
.LASF0:
.string "gdb.arch/amd64-entry-value-param-dwarf5.c"
.LASF1:
.string ""
.LASF4:
.string "gdb.arch"
.ident "GCC: (GNU) 7.0.1 20170218 (experimental)"
.section .note.GNU-stack,"",@progbits

View file

@ -0,0 +1,40 @@
/* This testcase is part of GDB, the GNU debugger.
Copyright 2012-2017 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
volatile int vv;
static __attribute__((noinline)) int
foo (int x, int y, int z)
{
int a = x * 2;
int b = y * 2;
int c = z * 2;
vv++; /* break-here */
return x + z;
}
static __attribute__((noinline)) int
bar (int x)
{
return foo (x, 2, 3) + foo (x, 4, 3) + foo (x + 6, x, 3) + x;
}
int
main (void)
{
return bar (10);
}

View file

@ -0,0 +1,49 @@
# Copyright (C) 2012-2017 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
standard_testfile .S .c
set opts {}
if [info exists COMPILE] {
# make check RUNTESTFLAGS="gdb.arch/amd64-entry-value-param-dwarf5.exp COMPILE=1"
set srcfile ${srcfile2}
lappend opts optimize=-O2 additional_flags=-gdwarf-5
} elseif { ![istarget x86_64-*-* ] || ![is_lp64_target] } {
verbose "Skipping amd64-entry-value-param-dwarf5."
return
}
if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} $opts] } {
return -1
}
if ![runto_main] {
return -1
}
set srcfile $srcfile2
gdb_breakpoint [gdb_get_line_number "break-here"]
gdb_continue_to_breakpoint "break-here" ".* break-here .*"
gdb_test "p y" " = 2"
gdb_test "p b" " = 4"
gdb_continue_to_breakpoint "break-here" ".* break-here .*"
gdb_test "p y" " = 4"
gdb_test "p b" " = 8"
gdb_continue_to_breakpoint "break-here" ".* break-here .*"
gdb_test "p y" " = 10"
gdb_test "p b" " = 20"

View file

@ -159,7 +159,7 @@ gdb_test_no_output "set print entry-values default" "entry_invalid: set print en
gdb_test "frame" {\(inv=<optimized out>\).*} "entry_invalid: frame: default" gdb_test "frame" {\(inv=<optimized out>\).*} "entry_invalid: frame: default"
# Test @entry values for DW_AT_GNU_call_site_data_value parameters. # Test @entry values for DW_AT_call_data_value parameters.
gdb_continue_to_breakpoint "entry_reference: reference" gdb_continue_to_breakpoint "entry_reference: reference"
@ -188,7 +188,7 @@ gdb_test "p regparam@entry" " = \\(int &\\) @$addr: 1" "entry_reference: p regpa
gdb_test "p &regparam@entry" " = \\(int \\*\\) $addr" "entry_reference: p &regparam@entry" gdb_test "p &regparam@entry" " = \\(int \\*\\) $addr" "entry_reference: p &regparam@entry"
gdb_test "p regcopy" " = 1" "entry_reference: p regcopy" gdb_test "p regcopy" " = 1" "entry_reference: p regcopy"
gdb_test "p nodataparam" " = \\(int &\\) @0x\[0-9a-f\]+: 22" "entry_reference: p nodataparam" gdb_test "p nodataparam" " = \\(int &\\) @0x\[0-9a-f\]+: 22" "entry_reference: p nodataparam"
gdb_test "p nodataparam@entry" "Cannot resolve DW_AT_GNU_call_site_data_value" "entry_reference: p nodataparam@entry" gdb_test "p nodataparam@entry" "Cannot resolve DW_AT_call_data_value" "entry_reference: p nodataparam@entry"
# Test virtual tail call frames. # Test virtual tail call frames.
@ -249,5 +249,5 @@ gdb_test "bt" "^bt\r\n#0 +d \\(i=<optimized out>, j=<optimized out>\\)\[^\r\n\]*
"self: bt" "self: bt"
gdb_test_no_output "set debug entry-values 1" gdb_test_no_output "set debug entry-values 1"
gdb_test "bt" "DW_OP_GNU_entry_value resolving has found function \"self\\(int\\)\" at 0x\[0-9a-f\]+ can call itself via tail calls\r\n.*" \ gdb_test "bt" "DW_OP_entry_value resolving has found function \"self\\(int\\)\" at 0x\[0-9a-f\]+ can call itself via tail calls\r\n.*" \
"self: bt debug entry-values" "self: bt debug entry-values"