diff options
author | Jan Kratochvil <jan.kratochvil@redhat.com> | 2012-06-17 19:50:53 +0000 |
---|---|---|
committer | Jan Kratochvil <jan.kratochvil@redhat.com> | 2012-06-17 19:50:53 +0000 |
commit | 24c5c679cb74ed4035f8c1dd4249654602fd1f10 (patch) | |
tree | ee24fda32e84b20b44aafb6812f454044d5e4db5 /gdb/dwarf2read.c | |
parent | e8c21678a448808bdfd5eff794aa5a061cba6af6 (diff) | |
download | gdb-24c5c679cb74ed4035f8c1dd4249654602fd1f10.zip gdb-24c5c679cb74ed4035f8c1dd4249654602fd1f10.tar.gz gdb-24c5c679cb74ed4035f8c1dd4249654602fd1f10.tar.bz2 |
gdb/
Code cleanup: Generalize call_site.parameter key.
* dwarf2expr.c (execute_stack_op) <DW_OP_GNU_entry_value>: Remove
variable dwarf_reg. New variable kind_u. Update parameters to
push_dwarf_reg_entry_value.
(ctx_no_push_dwarf_reg_entry_value): Update parameters.
* dwarf2expr.h (enum call_site_parameter_kind)
(union call_site_parameter_u): Forward declarations.
(struct dwarf_expr_context_funcs): Update parameters and their
description for push_dwarf_reg_entry_value.
(ctx_no_push_dwarf_reg_entry_value): Update parameters.
* dwarf2loc.c (call_site_parameter_matches): New function.
(dwarf_expr_reg_to_entry_parameter): Update parameters and their
description. Use call_site_parameter_matches.
(dwarf_expr_push_dwarf_reg_entry_value, value_of_dwarf_reg_entry):
Update parameters and their description.
(value_of_dwarf_block_entry): Remove variables dwarf_reg and fb_offset.
New variable kind_u. Adjust the caller for updated parameters.
(needs_dwarf_reg_entry_value): Update parameters.
* dwarf2read.c (read_call_site_scope): New variable loc. Use it
instead of attr. Update for the changed fields of struct
call_site_parameter.
* gdbtypes.h: Include dwarf2expr.h.
(enum call_site_parameter_kind): New.
(struct call_site.parameter): New field kind. Wrap dwarf_reg and
fb_offset into new union u.
Diffstat (limited to 'gdb/dwarf2read.c')
-rw-r--r-- | gdb/dwarf2read.c | 36 |
1 files changed, 22 insertions, 14 deletions
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index a8cd158..0577420 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -7812,6 +7812,7 @@ read_call_site_scope (struct die_info *die, struct dwarf2_cu *cu) child_die = sibling_die (child_die)) { struct call_site_parameter *parameter; + struct attribute *loc; if (child_die->tag != DW_TAG_GNU_call_site_parameter) { @@ -7825,8 +7826,8 @@ read_call_site_scope (struct die_info *die, struct dwarf2_cu *cu) /* DW_AT_location specifies the register number. Value of the data assumed for the register is contained in DW_AT_GNU_call_site_value. */ - attr = dwarf2_attr (child_die, DW_AT_location, cu); - if (!attr || !attr_form_is_block (attr)) + loc = dwarf2_attr (child_die, DW_AT_location, cu); + if (loc == NULL || !attr_form_is_block (loc)) { complaint (&symfile_complaints, _("No DW_FORM_block* DW_AT_location for " @@ -7834,19 +7835,26 @@ read_call_site_scope (struct die_info *die, struct dwarf2_cu *cu) child_die->offset.sect_off, objfile->name); continue; } - parameter->dwarf_reg = dwarf_block_to_dwarf_reg (DW_BLOCK (attr)->data, - &DW_BLOCK (attr)->data[DW_BLOCK (attr)->size]); - if (parameter->dwarf_reg == -1 - && !dwarf_block_to_sp_offset (gdbarch, DW_BLOCK (attr)->data, - &DW_BLOCK (attr)->data[DW_BLOCK (attr)->size], - ¶meter->fb_offset)) + else { - complaint (&symfile_complaints, - _("Only single DW_OP_reg or DW_OP_fbreg is supported " - "for DW_FORM_block* DW_AT_location for " - "DW_TAG_GNU_call_site child DIE 0x%x [in module %s]"), - child_die->offset.sect_off, objfile->name); - continue; + parameter->u.dwarf_reg = dwarf_block_to_dwarf_reg + (DW_BLOCK (loc)->data, &DW_BLOCK (loc)->data[DW_BLOCK (loc)->size]); + if (parameter->u.dwarf_reg != -1) + parameter->kind = CALL_SITE_PARAMETER_DWARF_REG; + else if (dwarf_block_to_sp_offset (gdbarch, DW_BLOCK (loc)->data, + &DW_BLOCK (loc)->data[DW_BLOCK (loc)->size], + ¶meter->u.fb_offset)) + parameter->kind = CALL_SITE_PARAMETER_FB_OFFSET; + else + { + complaint (&symfile_complaints, + _("Only single DW_OP_reg or DW_OP_fbreg is supported " + "for DW_FORM_block* DW_AT_location is supported for " + "DW_TAG_GNU_call_site child DIE 0x%x " + "[in module %s]"), + child_die->offset.sect_off, objfile->name); + continue; + } } attr = dwarf2_attr (child_die, DW_AT_GNU_call_site_value, cu); |