aboutsummaryrefslogtreecommitdiff
path: root/gdb/dwarf2expr.c
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2003-04-13 15:43:35 +0000
committerDaniel Jacobowitz <drow@false.org>2003-04-13 15:43:35 +0000
commit0d53c4c49facfc7400795d0d4fc7489b296d743d (patch)
treef448041b3ca20debb7bbb7f2614ffd78abd7d3eb /gdb/dwarf2expr.c
parent6aca59a35914f39148f06d4d43f56a56c3cc4e55 (diff)
downloadfsf-binutils-gdb-0d53c4c49facfc7400795d0d4fc7489b296d743d.zip
fsf-binutils-gdb-0d53c4c49facfc7400795d0d4fc7489b296d743d.tar.gz
fsf-binutils-gdb-0d53c4c49facfc7400795d0d4fc7489b296d743d.tar.bz2
2003-04-13 Daniel Jacobowitz <drow@mvista.com>
* dwarf2expr.c (dwarf2_read_address): Renamed from read_address; made non-static. (execute_stack_op): All callers updated. * dwarf2expr.h: Add prototype for dwarf2_read_address. * dwarf2loc.c (find_location_expression): New function. (dwarf_expr_frame_base): Call it. (dwarf2_evaluate_loc_desc): Handle 0-length location expressions. (dwarf2_tracepoint_var_ref): New function, broken out from locexpr_tracepoint_var_ref. (locexpr_tracepoint_var_ref): Call dwarf2_tracepoint_var_ref. Make static. (loclist_read_variable, loclist_read_needs_frame): New functions. (loclist_describe_location, loclist_tracepoint_var_ref): New functions. (dwarf2_loclist_funcs): New struct location_funcs. * dwarf2loc.h (struct dwarf2_loclist_baton): New type. (struct dwarf2_locexpr_baton): Add comments. (dwarf2_loclist_funcs): New extern. * dwarf2read.c (struct comp_unit_head): Remove DIE member, add base_address and base_known. (dwarf_loc_buffer): New variable. (struct dwarf2_pinfo): Add dwarf_loc_buffer and dwarf_loc_size. (DWARF_LOC_BUFFER, DWARF_LOC_SIZE): New macros. (dwarf2_has_info): Initialize dwarf_loc_offset. (dwarf2_build_psymtabs): Read in .debug_loc. (dwarf2_build_psymtabs_hard): Use DWARF_LOC_BUFFER and DWARF_LOC_SIZE. (psymtab_to_symtab_1): Likewise. Move base address calculation here, from... (dwarf2_get_pc_bounds): ... here. Use the base address from cu_header. (dwarf2_symbol_mark_computed): Handle location lists.
Diffstat (limited to 'gdb/dwarf2expr.c')
-rw-r--r--gdb/dwarf2expr.c29
1 files changed, 16 insertions, 13 deletions
diff --git a/gdb/dwarf2expr.c b/gdb/dwarf2expr.c
index be965ab..a87dfc6 100644
--- a/gdb/dwarf2expr.c
+++ b/gdb/dwarf2expr.c
@@ -170,13 +170,13 @@ read_sleb128 (unsigned char *buf, unsigned char *buf_end, LONGEST * r)
BUF_END. The address is returned, and *BYTES_READ is set to the
number of bytes read from BUF. */
-static CORE_ADDR
-read_address (unsigned char *buf, unsigned char *buf_end, int *bytes_read)
+CORE_ADDR
+dwarf2_read_address (unsigned char *buf, unsigned char *buf_end, int *bytes_read)
{
CORE_ADDR result;
if (buf_end - buf < TARGET_ADDR_BIT / TARGET_CHAR_BIT)
- error ("read_address: Corrupted DWARF expression.");
+ error ("dwarf2_read_address: Corrupted DWARF expression.");
*bytes_read = TARGET_ADDR_BIT / TARGET_CHAR_BIT;
result = extract_address (buf, TARGET_ADDR_BIT / TARGET_CHAR_BIT);
@@ -277,7 +277,7 @@ execute_stack_op (struct dwarf_expr_context *ctx, unsigned char *op_ptr,
break;
case DW_OP_addr:
- result = read_address (op_ptr, op_end, &bytes_read);
+ result = dwarf2_read_address (op_ptr, op_end, &bytes_read);
op_ptr += bytes_read;
break;
@@ -467,9 +467,10 @@ execute_stack_op (struct dwarf_expr_context *ctx, unsigned char *op_ptr,
(ctx->read_mem) (ctx->baton, buf, result,
TARGET_ADDR_BIT / TARGET_CHAR_BIT);
- result = read_address (buf,
- buf + TARGET_ADDR_BIT / TARGET_CHAR_BIT,
- &bytes_read);
+ result = dwarf2_read_address (buf,
+ buf + (TARGET_ADDR_BIT
+ / TARGET_CHAR_BIT),
+ &bytes_read);
}
result = result + offset;
ctx->stack_len = before_stack_len;
@@ -528,9 +529,10 @@ execute_stack_op (struct dwarf_expr_context *ctx, unsigned char *op_ptr,
(ctx->read_mem) (ctx->baton, buf, result,
TARGET_ADDR_BIT / TARGET_CHAR_BIT);
- result = read_address (buf,
- buf + TARGET_ADDR_BIT / TARGET_CHAR_BIT,
- &bytes_read);
+ result = dwarf2_read_address (buf,
+ buf + (TARGET_ADDR_BIT
+ / TARGET_CHAR_BIT),
+ &bytes_read);
}
break;
@@ -540,9 +542,10 @@ execute_stack_op (struct dwarf_expr_context *ctx, unsigned char *op_ptr,
int bytes_read;
(ctx->read_mem) (ctx->baton, buf, result, *op_ptr++);
- result = read_address (buf,
- buf + TARGET_ADDR_BIT / TARGET_CHAR_BIT,
- &bytes_read);
+ result = dwarf2_read_address (buf,
+ buf + (TARGET_ADDR_BIT
+ / TARGET_CHAR_BIT),
+ &bytes_read);
}
break;