aboutsummaryrefslogtreecommitdiff
path: root/gdb/dwarf2expr.h
diff options
context:
space:
mode:
authorUlrich Weigand <uweigand@de.ibm.com>2010-06-25 13:00:33 +0000
committerUlrich Weigand <uweigand@de.ibm.com>2010-06-25 13:00:33 +0000
commitf2c7657e9a0e18772ce4b0a95afd2b6546152b78 (patch)
treea7af9795f2e7daa59d8e72d016040c1a294b7aee /gdb/dwarf2expr.h
parentb1d61bc9d188010bf897f8155a76fb76ab99775f (diff)
downloadgdb-f2c7657e9a0e18772ce4b0a95afd2b6546152b78.zip
gdb-f2c7657e9a0e18772ce4b0a95afd2b6546152b78.tar.gz
gdb-f2c7657e9a0e18772ce4b0a95afd2b6546152b78.tar.bz2
ChangeLog:
* dwarf2expr.h (struct dwarf_value_location): Use ULONGEST as type of stack values. (struct dwarf_expr_piece): Rename "expr" member to "mem". Add new "value" member. (dwarf_expr_push): Change input type to ULONGEST. (dwarf_expr_fetch): Change return type to ULONGEST. (dwarf_expr_fetch_address): Add prototype. (dwarf2_read_address): Remove prototype. * dwarf2expr.c (dwarf_expr_push): Use ULONGEST as type of stack values. Truncate stack values to ctx->addr_size bytes. (dwarf_expr_fetch): Change return value to ULONGEST. (dwarf_expr_fetch_address): New function. (add_piece): Use dwarf_expr_fetch_address instead of dwarf_expr_fetch when appropriate. Update for struct dwarf_expr_piece changes. (dwarf2_read_address): Remove. (unsigned_address_type): Remove. (signed_address_type): Remove. (execute_stack_op): Use dwarf_expr_fetch_address instead of dwarf_expr_fetch when appropriate. Use ULONGEST as type of stack values. Perform operations on ULONGEST instead of on GDB values, sign-extending from ctx->addr_size bytes as needed. Read DW_OP_addr values and DW_OP_deref results as unsigned integers. * dwarf2loc.c (read_pieced_value): Update for struct dwarf_expr_piece changes. (write_pieced_value): Likewise. (dwarf2_evaluate_loc_desc): Use dwarf_expr_fetch_address instead of dwarf_expr_fetch when appropriate. (compile_dwarf_to_ax): Read DW_OP_addr values as unsigned integers. * dwarf2-frame.c (execute_stack_op): Use dwarf_expr_fetch_address instead of dwarf_expr_fetch when appropriate. testsuite/ChangeLog: * gdb.cell/dwarfaddr.exp: New file. * gdb.cell/dwarfaddr.S: New file.
Diffstat (limited to 'gdb/dwarf2expr.h')
-rw-r--r--gdb/dwarf2expr.h23
1 files changed, 13 insertions, 10 deletions
diff --git a/gdb/dwarf2expr.h b/gdb/dwarf2expr.h
index 727e557..31381c0 100644
--- a/gdb/dwarf2expr.h
+++ b/gdb/dwarf2expr.h
@@ -48,7 +48,7 @@ enum dwarf_value_location
struct dwarf_stack_value
{
- CORE_ADDR value;
+ ULONGEST value;
/* Non-zero if the piece is in memory and is known to be
on the program's stack. It is always ok to set this to zero.
@@ -163,17 +163,21 @@ struct dwarf_expr_piece
{
struct
{
- /* This piece's address or register number. */
- CORE_ADDR value;
+ /* This piece's address, for DWARF_VALUE_MEMORY pieces. */
+ CORE_ADDR addr;
/* Non-zero if the piece is known to be in memory and on
the program's stack. */
int in_stack_memory;
- } expr;
+ } mem;
+
+ /* The piece's register number or literal value, for
+ DWARF_VALUE_REGISTER or DWARF_VALUE_STACK pieces. */
+ ULONGEST value;
struct
{
- /* A pointer to the data making up this piece, for literal
- pieces. */
+ /* A pointer to the data making up this piece,
+ for DWARF_VALUE_LITERAL pieces. */
const gdb_byte *data;
/* The length of the available data. */
ULONGEST length;
@@ -191,12 +195,13 @@ void free_dwarf_expr_context (struct dwarf_expr_context *ctx);
struct cleanup *
make_cleanup_free_dwarf_expr_context (struct dwarf_expr_context *ctx);
-void dwarf_expr_push (struct dwarf_expr_context *ctx, CORE_ADDR value,
+void dwarf_expr_push (struct dwarf_expr_context *ctx, ULONGEST value,
int in_stack_memory);
void dwarf_expr_pop (struct dwarf_expr_context *ctx);
void dwarf_expr_eval (struct dwarf_expr_context *ctx, const gdb_byte *addr,
size_t len);
-CORE_ADDR dwarf_expr_fetch (struct dwarf_expr_context *ctx, int n);
+ULONGEST dwarf_expr_fetch (struct dwarf_expr_context *ctx, int n);
+CORE_ADDR dwarf_expr_fetch_address (struct dwarf_expr_context *ctx, int n);
int dwarf_expr_fetch_in_stack_memory (struct dwarf_expr_context *ctx, int n);
@@ -204,8 +209,6 @@ const gdb_byte *read_uleb128 (const gdb_byte *buf, const gdb_byte *buf_end,
ULONGEST * r);
const gdb_byte *read_sleb128 (const gdb_byte *buf, const gdb_byte *buf_end,
LONGEST * r);
-CORE_ADDR dwarf2_read_address (struct gdbarch *gdbarch, const gdb_byte *buf,
- const gdb_byte *buf_end, int addr_size);
const char *dwarf_stack_op_name (unsigned int, int);