aboutsummaryrefslogtreecommitdiff
path: root/gdb/dwarf2loc.c
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@gnu.org>2005-07-12 13:06:54 +0000
committerMark Kettenis <kettenis@gnu.org>2005-07-12 13:06:54 +0000
commit852483bc793b005fc6a7cad8bb6a15846fe7ef25 (patch)
tree245dcaded679cc857d24048d5f07b0a90b154eb6 /gdb/dwarf2loc.c
parent22a44745e3c45871c3124196752c5b7bf0c593e3 (diff)
downloadgdb-852483bc793b005fc6a7cad8bb6a15846fe7ef25.zip
gdb-852483bc793b005fc6a7cad8bb6a15846fe7ef25.tar.gz
gdb-852483bc793b005fc6a7cad8bb6a15846fe7ef25.tar.bz2
* dwarf2expr.h: Tweak comment.
(struct dwarf_expr_context): Use `gdb_byte *' in read_mem and get_frame_base function pointers. (read_uleb128, read_sleb128): Change return type and types of first two arguments to `gdb_byte *'. (dwarf2_read_address): Change types of first two arguments to `gdb_byte *'. * dwarf2expr.c: Tweak comment. (dwarf_expr_eval): Change type of second argument to `gdb_byte *'. (read_uleb128, read_sleb128): Change return type and types of first two arguments to `gdb_byte *'. (dwarf2_read_address): Change types of first two arguments to `gdb_byte *'. (execute_stack_op): Change types of last two arguments to `gdb_byte *'. Use `gdb_byte *' for byte buffers. * dwarf2loc.h: Tweak comment. (struct dwarf2_locexpr_baton, struct dwarf2_loclist_baton): Use `gdb_byte *' for byte buffers. * dwarf2loc.c (find_location_expression): Change return type to `gdb_byte *'. Use `gdb_byte *' for byte buffers. Change length to `unsigned int'. (dwarf_expr_read_reg): Use `gdb_byte *' for byte buffer. Remove bogus cast. (dwarf_expr_read_mem): Change type of second argument to `gdb_byte *'. (dwarf_expr_frame_base): Change type of second argument to `gdb_byte **'. (dwarf2_evaluate_loc_desc): Change type of third argument to `gdb_byte *'. (needs_frame_read_mem): Change type of second argument to `gdb_byte *'. (needs_frame_frame_base): Change type of second argument `gdb_byte **'. Use gdb_byte for lit0. (dwarf2_tracepoint_var_ref): Change type of fourth argument to `gdb_byte *'. Use `gdb_byte *' for byte buffer. (loclist_read_variable, loclist_tracepoint_var_ref): Use `gdb_byte *' for byte buffer. * dwarf2-frame.c (struct dwarf2_cie, struct dwarf2_fde) (struct dwarf2_frame_state): Use gdb_byte instead of `unsigned char'. (read_reg): Use `gdb_byte *' for byte buffers. Remove redundant cast. (read_mem): Change second argument to `gdb_byte *'. (no_get_frame_base): Change second argument to `gdb_byte **'. (execute_stack_op): Change first argument to `gdb_byte *'. (execute_cfa_program): Change first two arguments to `gdb_byte *'. Use gdb_byte instead of `unsigned int'. Use temprorary variable to store result of read_uleb128. (struct comp_unit): Use `gdb_byte *' for byte buffers. (read_1_byte, read_4_bytes, read_8_bytes): Change last argument to `gdb_byte *'. (read_unsigned_leb128, read_signed_leb128): Change second argument to `gdb_byte *'. Use gdb_byte instead of `unsigned char'. (read_initial_length): Change second argument to `gdb_byte *'. Remove redundant casts. (read_encoded_value): Use gdb_byte instead of `unsigned char'. Remove bogus casts. (decode_frame_entry_1): Change return type and second argument to `gdb_byte *'. Use `gdb_byte *' for byte buffers. Use gdb_byte instead of `unsigned char'. (decode_frame_entry): Change return type and second argument to `gdb_byte *'. Use `gdb_byte *' for byte buffers. (dwarf2_build_frame_info): Use `gdb_byte *' for byte buffers.
Diffstat (limited to 'gdb/dwarf2loc.c')
-rw-r--r--gdb/dwarf2loc.c35
1 files changed, 18 insertions, 17 deletions
diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c
index 47c8101..6c33448 100644
--- a/gdb/dwarf2loc.c
+++ b/gdb/dwarf2loc.c
@@ -52,13 +52,14 @@
For now, only return the first matching location expression; there
can be more than one in the list. */
-static char *
+static gdb_byte *
find_location_expression (struct dwarf2_loclist_baton *baton,
size_t *locexpr_length, CORE_ADDR pc)
{
CORE_ADDR low, high;
- char *loc_ptr, *buf_end;
- unsigned int addr_size = TARGET_ADDR_BIT / TARGET_CHAR_BIT, length;
+ gdb_byte *loc_ptr, *buf_end;
+ int length;
+ unsigned int addr_size = TARGET_ADDR_BIT / TARGET_CHAR_BIT;
CORE_ADDR base_mask = ~(~(CORE_ADDR)1 << (addr_size * 8 - 1));
/* Adjust base_address for relocatable objects. */
CORE_ADDR base_offset = ANOFFSET (baton->objfile->section_offsets,
@@ -122,12 +123,12 @@ dwarf_expr_read_reg (void *baton, int dwarf_regnum)
struct dwarf_expr_baton *debaton = (struct dwarf_expr_baton *) baton;
CORE_ADDR result, save_addr;
enum lval_type lval_type;
- char *buf;
+ gdb_byte *buf;
int optimized, regnum, realnum, regsize;
regnum = DWARF2_REG_TO_REGNUM (dwarf_regnum);
regsize = register_size (current_gdbarch, regnum);
- buf = (char *) alloca (regsize);
+ buf = alloca (regsize);
frame_register (debaton->frame, regnum, &optimized, &lval_type, &save_addr,
&realnum, buf);
@@ -141,7 +142,7 @@ dwarf_expr_read_reg (void *baton, int dwarf_regnum)
/* Read memory at ADDR (length LEN) into BUF. */
static void
-dwarf_expr_read_mem (void *baton, char *buf, CORE_ADDR addr, size_t len)
+dwarf_expr_read_mem (void *baton, gdb_byte *buf, CORE_ADDR addr, size_t len)
{
read_memory (addr, buf, len);
}
@@ -150,7 +151,7 @@ dwarf_expr_read_mem (void *baton, char *buf, CORE_ADDR addr, size_t len)
describing the frame base. Return a pointer to it in START and
its length in LENGTH. */
static void
-dwarf_expr_frame_base (void *baton, unsigned char **start, size_t * length)
+dwarf_expr_frame_base (void *baton, gdb_byte **start, size_t * length)
{
/* FIXME: cagney/2003-03-26: This code should be using
get_frame_base_address(), and then implement a dwarf2 specific
@@ -273,7 +274,7 @@ dwarf_expr_tls_address (void *baton, CORE_ADDR offset)
of FRAME. */
static struct value *
dwarf2_evaluate_loc_desc (struct symbol *var, struct frame_info *frame,
- unsigned char *data, unsigned short size,
+ gdb_byte *data, unsigned short size,
struct objfile *objfile)
{
struct gdbarch *arch = get_frame_arch (frame);
@@ -350,16 +351,16 @@ needs_frame_read_reg (void *baton, int regnum)
/* Reads from memory do not require a frame. */
static void
-needs_frame_read_mem (void *baton, char *buf, CORE_ADDR addr, size_t len)
+needs_frame_read_mem (void *baton, gdb_byte *buf, CORE_ADDR addr, size_t len)
{
memset (buf, 0, len);
}
/* Frame-relative accesses do require a frame. */
static void
-needs_frame_frame_base (void *baton, unsigned char **start, size_t * length)
+needs_frame_frame_base (void *baton, gdb_byte **start, size_t * length)
{
- static char lit0 = DW_OP_lit0;
+ static gdb_byte lit0 = DW_OP_lit0;
struct needs_frame_baton *nf_baton = baton;
*start = &lit0;
@@ -381,7 +382,7 @@ needs_frame_tls_address (void *baton, CORE_ADDR offset)
requires a frame to evaluate. */
static int
-dwarf2_loc_desc_needs_frame (unsigned char *data, unsigned short size)
+dwarf2_loc_desc_needs_frame (gdb_byte *data, unsigned short size)
{
struct needs_frame_baton baton;
struct dwarf_expr_context *ctx;
@@ -417,8 +418,8 @@ dwarf2_loc_desc_needs_frame (unsigned char *data, unsigned short size)
}
static void
-dwarf2_tracepoint_var_ref (struct symbol * symbol, struct agent_expr * ax,
- struct axs_value * value, unsigned char *data,
+dwarf2_tracepoint_var_ref (struct symbol *symbol, struct agent_expr *ax,
+ struct axs_value *value, gdb_byte *data,
int size)
{
if (size == 0)
@@ -445,7 +446,7 @@ dwarf2_tracepoint_var_ref (struct symbol * symbol, struct agent_expr * ax,
as above. */
int frame_reg;
LONGEST frame_offset;
- unsigned char *buf_end;
+ gdb_byte *buf_end;
buf_end = read_sleb128 (data + 1, data + size, &frame_offset);
if (buf_end != data + size)
@@ -575,7 +576,7 @@ loclist_read_variable (struct symbol *symbol, struct frame_info *frame)
{
struct dwarf2_loclist_baton *dlbaton = SYMBOL_LOCATION_BATON (symbol);
struct value *val;
- unsigned char *data;
+ gdb_byte *data;
size_t size;
data = find_location_expression (dlbaton, &size,
@@ -622,7 +623,7 @@ loclist_tracepoint_var_ref (struct symbol * symbol, struct agent_expr * ax,
struct axs_value * value)
{
struct dwarf2_loclist_baton *dlbaton = SYMBOL_LOCATION_BATON (symbol);
- unsigned char *data;
+ gdb_byte *data;
size_t size;
data = find_location_expression (dlbaton, &size, ax->scope);