summaryrefslogtreecommitdiff
path: root/gdb/gdbtypes.h
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2012-06-17 19:50:50 +0000
committerJan Kratochvil <jan.kratochvil@redhat.com>2012-06-17 19:50:50 +0000
commitfdd359c07f289b8391aceb2e73c850517027e076 (patch)
tree226a981ed86f07fe78b333a80300b184a0f79698 /gdb/gdbtypes.h
parent25e690174b0b72dbca2aa719a7b8378e2793abfc (diff)
downloadgdb-fdd359c07f289b8391aceb2e73c850517027e076.tar.gz
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/gdbtypes.h')
-rw-r--r--gdb/gdbtypes.h34
1 files changed, 25 insertions, 9 deletions
diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h
index 887dfdb5dea..e0dd669a08d 100644
--- a/gdb/gdbtypes.h
+++ b/gdb/gdbtypes.h
@@ -23,6 +23,7 @@
#define GDBTYPES_H 1
#include "hashtab.h"
+#include "dwarf2expr.h"
/* Forward declarations for prototypes. */
struct field;
@@ -915,6 +916,17 @@ struct func_type
struct call_site *tail_call_list;
};
+/* struct call_site_parameter can be referenced in callees by several ways. */
+
+enum call_site_parameter_kind
+{
+ /* Use field call_site_parameter.u.dwarf_reg. */
+ CALL_SITE_PARAMETER_DWARF_REG,
+
+ /* Use field call_site_parameter.u.fb_offset. */
+ CALL_SITE_PARAMETER_FB_OFFSET
+};
+
/* A place where a function gets called from, represented by
DW_TAG_GNU_call_site. It can be looked up from symtab->call_site_htab. */
@@ -948,15 +960,19 @@ struct call_site
/* Describe DW_TAG_GNU_call_site's DW_TAG_formal_parameter. */
struct call_site_parameter
{
- /* DW_TAG_formal_parameter's DW_AT_location's DW_OP_regX as DWARF
- register number, for register passed parameters. If -1 then use
- fb_offset. */
- int dwarf_reg;
-
- /* Offset from the callee's frame base, for stack passed parameters.
- This equals offset from the caller's stack pointer. Valid only if
- DWARF_REGNUM is -1. */
- CORE_ADDR fb_offset;
+ ENUM_BITFIELD (call_site_parameter_kind) kind : 2;
+
+ union call_site_parameter_u
+ {
+ /* DW_TAG_formal_parameter's DW_AT_location's DW_OP_regX as DWARF
+ register number, for register passed parameters. */
+ int dwarf_reg;
+
+ /* Offset from the callee's frame base, for stack passed parameters.
+ This equals offset from the caller's stack pointer. */
+ CORE_ADDR fb_offset;
+ }
+ u;
/* DW_TAG_formal_parameter's DW_AT_GNU_call_site_value. It is never
NULL. */