summaryrefslogtreecommitdiff
path: root/gdb/dwarf2expr.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2010-05-25 16:41:42 +0000
committerTom Tromey <tromey@redhat.com>2010-05-25 16:41:42 +0000
commit21b7661801cd268665cf01c5bc971cd400d287ce (patch)
treeceda8d04e3dc1275bec4e203ba0a059e5939b94b /gdb/dwarf2expr.c
parent5dee8918b852e4ffd881b4667249df686bc9c090 (diff)
downloadgdb-21b7661801cd268665cf01c5bc971cd400d287ce.tar.gz
* dwarf2loc.c (dwarf_expr_frame_base): Constify.
(dwarf_expr_frame_base_1): Likewise. (read_pieced_value): Update. (needs_frame_frame_base): Constify. (dwarf2_tracepoint_var_loc): Likewise. (dwarf2_tracepoint_var_access): Likewise. (locexpr_describe_location_piece): Likewise. (locexpr_describe_location_1): Likewise. * dwarf2expr.h (struct dwarf_expr_context) <get_frame_base>: Constify. (data): Now const. (struct dwarf_expr_piece) <v.literal.data>: Likewise. (dwarf_expr_eval, read_uleb128, read_sleb128) (dwarf2_read_address): Update. * dwarf2expr.c (dwarf_expr_eval): Constify. (read_uleb128): Likewise. (read_sleb128): Likewise. (dwarf2_read_address): Likewise. (require_composition): Likewise. (execute_stack_op): Likewise. * dwarf2-frame.h (struct dwarf2_frame_state_reg) <loc.exp>: Now a "const gdb_byte *". * dwarf2-frame.c (struct dwarf2_frame_state_reg_info) <cfa_exp>: Now const. (no_get_frame_base): Constify. (execute_stack_op): Likewise. (execute_cfa_program): Likewise. (read_encoded_value): Likewise.
Diffstat (limited to 'gdb/dwarf2expr.c')
-rw-r--r--gdb/dwarf2expr.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/gdb/dwarf2expr.c b/gdb/dwarf2expr.c
index 723293bd747..c145cf4558b 100644
--- a/gdb/dwarf2expr.c
+++ b/gdb/dwarf2expr.c
@@ -32,7 +32,7 @@
/* Local prototypes. */
static void execute_stack_op (struct dwarf_expr_context *,
- gdb_byte *, gdb_byte *);
+ const gdb_byte *, const gdb_byte *);
static struct type *unsigned_address_type (struct gdbarch *, int);
/* Create a new context for the expression evaluator. */
@@ -193,7 +193,8 @@ add_piece (struct dwarf_expr_context *ctx, ULONGEST size, ULONGEST offset)
CTX. */
void
-dwarf_expr_eval (struct dwarf_expr_context *ctx, gdb_byte *addr, size_t len)
+dwarf_expr_eval (struct dwarf_expr_context *ctx, const gdb_byte *addr,
+ size_t len)
{
int old_recursion_depth = ctx->recursion_depth;
@@ -208,8 +209,8 @@ dwarf_expr_eval (struct dwarf_expr_context *ctx, gdb_byte *addr, size_t len)
by R, and return the new value of BUF. Verify that it doesn't extend
past BUF_END. */
-gdb_byte *
-read_uleb128 (gdb_byte *buf, gdb_byte *buf_end, ULONGEST * r)
+const gdb_byte *
+read_uleb128 (const gdb_byte *buf, const gdb_byte *buf_end, ULONGEST * r)
{
unsigned shift = 0;
ULONGEST result = 0;
@@ -234,8 +235,8 @@ read_uleb128 (gdb_byte *buf, gdb_byte *buf_end, ULONGEST * r)
by R, and return the new value of BUF. Verify that it doesn't extend
past BUF_END. */
-gdb_byte *
-read_sleb128 (gdb_byte *buf, gdb_byte *buf_end, LONGEST * r)
+const gdb_byte *
+read_sleb128 (const gdb_byte *buf, const gdb_byte *buf_end, LONGEST * r)
{
unsigned shift = 0;
LONGEST result = 0;
@@ -263,8 +264,8 @@ read_sleb128 (gdb_byte *buf, gdb_byte *buf_end, LONGEST * r)
doesn't extend past BUF_END. */
CORE_ADDR
-dwarf2_read_address (struct gdbarch *gdbarch, gdb_byte *buf,
- gdb_byte *buf_end, int addr_size)
+dwarf2_read_address (struct gdbarch *gdbarch, const gdb_byte *buf,
+ const gdb_byte *buf_end, int addr_size)
{
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
@@ -334,7 +335,8 @@ signed_address_type (struct gdbarch *gdbarch, int addr_size)
expression, or that it is followed by a composition operator. */
static void
-require_composition (gdb_byte *op_ptr, gdb_byte *op_end, const char *op_name)
+require_composition (const gdb_byte *op_ptr, const gdb_byte *op_end,
+ const char *op_name)
{
/* It seems like DW_OP_GNU_uninit should be handled here. However,
it doesn't seem to make sense for DW_OP_*_value, and it was not
@@ -351,7 +353,7 @@ require_composition (gdb_byte *op_ptr, gdb_byte *op_end, const char *op_name)
static void
execute_stack_op (struct dwarf_expr_context *ctx,
- gdb_byte *op_ptr, gdb_byte *op_end)
+ const gdb_byte *op_ptr, const gdb_byte *op_end)
{
enum bfd_endian byte_order = gdbarch_byte_order (ctx->gdbarch);
@@ -583,7 +585,7 @@ execute_stack_op (struct dwarf_expr_context *ctx,
break;
case DW_OP_fbreg:
{
- gdb_byte *datastart;
+ const gdb_byte *datastart;
size_t datalen;
unsigned int before_stack_len;