summaryrefslogtreecommitdiff
path: root/gdb/dwarf2expr.c
diff options
context:
space:
mode:
authorUlrich Weigand <uweigand@de.ibm.com>2007-06-13 17:59:51 +0000
committerUlrich Weigand <uweigand@de.ibm.com>2007-06-13 17:59:51 +0000
commit8cc13fbcfab50cf81aa8861c0a1dd85c03cd1b64 (patch)
tree5932d0d8f63d28dbfe7e5cf4fc127d015f846da4 /gdb/dwarf2expr.c
parente2eda8a68e85639775da4e1d22586a767a8ac332 (diff)
downloadgdb-8cc13fbcfab50cf81aa8861c0a1dd85c03cd1b64.tar.gz
2007-06-13 Markus Deuling <deuling@de.ibm.com>
* gdbarch.sh (TARGET_ADDR_BIT): Replace by gdbarch_addr_bit. * valops.c (value_cast): Likewise. * utils.c (strlen_paddr, paddr, paddr_nz, paddress): Likewise. * ui-out.c (ui_out_field_core_addr): Likewise. * tracepoint.c (tracepoints_info): Likewise. * symtab.c (print_msymbol_info): Likewise. * solib-irix.c (irix_current_sos) (irix_open_symbol_file_object): Likewise. * remote.c (build_remote_gdbarch_data): Likewise. * prologue-value.c (make_pv_area): Likewise. * procfs.c (info_mappings_callback): Likewise. * printcmd.c (print_scalar_formatted) (deprecated_print_address_numeric): Likewise. * memattr.c (mem_info_command): Likewise. * linux-nat.c (linux_nat_info_proc_cmd): Likewise. * gdbtypes.c (build_flt, gdbtypes_post_init): Likewise. * exec.c (print_section_info): Likewise. * dwarf2read.c (read_subrange_type): Likewise. * dwarf2loc.c (find_location_expression): Likewise. * dwarf2expr.c (dwarf2_read_address, unsigned_address_type) (signed_address_type, execute_stack_op): Likewise. * breakpoint.c (print_one_breakpoint, breakpoint_1): Likewise. * gdbarch.c, gdbarch.h: Regenerate.
Diffstat (limited to 'gdb/dwarf2expr.c')
-rw-r--r--gdb/dwarf2expr.c27
1 files changed, 17 insertions, 10 deletions
diff --git a/gdb/dwarf2expr.c b/gdb/dwarf2expr.c
index 92d9e16e359..ab2b109dfa6 100644
--- a/gdb/dwarf2expr.c
+++ b/gdb/dwarf2expr.c
@@ -202,10 +202,10 @@ dwarf2_read_address (gdb_byte *buf, gdb_byte *buf_end, int *bytes_read)
{
CORE_ADDR result;
- if (buf_end - buf < TARGET_ADDR_BIT / TARGET_CHAR_BIT)
+ if (buf_end - buf < gdbarch_addr_bit (current_gdbarch) / TARGET_CHAR_BIT)
error (_("dwarf2_read_address: Corrupted DWARF expression."));
- *bytes_read = TARGET_ADDR_BIT / TARGET_CHAR_BIT;
+ *bytes_read = gdbarch_addr_bit (current_gdbarch) / TARGET_CHAR_BIT;
/* For most architectures, calling extract_unsigned_integer() alone
is sufficient for extracting an address. However, some
@@ -233,7 +233,8 @@ dwarf2_read_address (gdb_byte *buf, gdb_byte *buf_end, int *bytes_read)
(unsigned_address_type (),
extract_unsigned_integer
(buf,
- TARGET_ADDR_BIT / TARGET_CHAR_BIT)));
+ gdbarch_addr_bit (current_gdbarch)
+ / TARGET_CHAR_BIT)));
return result;
}
@@ -243,7 +244,7 @@ dwarf2_read_address (gdb_byte *buf, gdb_byte *buf_end, int *bytes_read)
static struct type *
unsigned_address_type (void)
{
- switch (TARGET_ADDR_BIT / TARGET_CHAR_BIT)
+ switch (gdbarch_addr_bit (current_gdbarch) / TARGET_CHAR_BIT)
{
case 2:
return builtin_type_uint16;
@@ -262,7 +263,7 @@ unsigned_address_type (void)
static struct type *
signed_address_type (void)
{
- switch (TARGET_ADDR_BIT / TARGET_CHAR_BIT)
+ switch (gdbarch_addr_bit (current_gdbarch) / TARGET_CHAR_BIT)
{
case 2:
return builtin_type_int16;
@@ -550,13 +551,16 @@ execute_stack_op (struct dwarf_expr_context *ctx,
{
case DW_OP_deref:
{
- gdb_byte *buf = alloca (TARGET_ADDR_BIT / TARGET_CHAR_BIT);
+ gdb_byte *buf = alloca (gdbarch_addr_bit (current_gdbarch)
+ / TARGET_CHAR_BIT);
int bytes_read;
(ctx->read_mem) (ctx->baton, buf, result,
- TARGET_ADDR_BIT / TARGET_CHAR_BIT);
+ gdbarch_addr_bit (current_gdbarch)
+ / TARGET_CHAR_BIT);
result = dwarf2_read_address (buf,
- buf + (TARGET_ADDR_BIT
+ buf + (gdbarch_addr_bit
+ (current_gdbarch)
/ TARGET_CHAR_BIT),
&bytes_read);
}
@@ -564,12 +568,15 @@ execute_stack_op (struct dwarf_expr_context *ctx,
case DW_OP_deref_size:
{
- gdb_byte *buf = alloca (TARGET_ADDR_BIT / TARGET_CHAR_BIT);
+ gdb_byte *buf
+ = alloca (gdbarch_addr_bit (current_gdbarch)
+ / TARGET_CHAR_BIT);
int bytes_read;
(ctx->read_mem) (ctx->baton, buf, result, *op_ptr++);
result = dwarf2_read_address (buf,
- buf + (TARGET_ADDR_BIT
+ buf + (gdbarch_addr_bit
+ (current_gdbarch)
/ TARGET_CHAR_BIT),
&bytes_read);
}