aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Weigand <uweigand@de.ibm.com>2008-09-11 14:25:49 +0000
committerUlrich Weigand <uweigand@de.ibm.com>2008-09-11 14:25:49 +0000
commitc56324e00105ce40f440d2b8052764b282cd1074 (patch)
treeff19dced92fe39a5815f4fbab396ed3b4748c13b
parent7788af6d308c7719a90b33584d95bea005c5ebd2 (diff)
downloadgdb-c56324e00105ce40f440d2b8052764b282cd1074.zip
gdb-c56324e00105ce40f440d2b8052764b282cd1074.tar.gz
gdb-c56324e00105ce40f440d2b8052764b282cd1074.tar.bz2
* valarith.c (value_x_unop): Use builtin_type_int8 as type for
UNOP_POSTINCREMENT/UNOP_POSTDECREMENT constant 0 argument. (value_bit_index): Use extract_unsigned_integer instead of unpack_long to read single byte.
-rw-r--r--gdb/ChangeLog7
-rw-r--r--gdb/valarith.c7
2 files changed, 10 insertions, 4 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index eb61a50..46c9d94 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,12 @@
2008-09-11 Ulrich Weigand <uweigand@de.ibm.com>
+ * valarith.c (value_x_unop): Use builtin_type_int8 as type for
+ UNOP_POSTINCREMENT/UNOP_POSTDECREMENT constant 0 argument.
+ (value_bit_index): Use extract_unsigned_integer
+ instead of unpack_long to read single byte.
+
+2008-09-11 Ulrich Weigand <uweigand@de.ibm.com>
+
* infcall.c (value_arg_coerce): Add GDBARCH parameter. Use its
associates types instead of builtin_type_ macros.
(find_function_addr): Leave output VALUE_TYPE NULL if unknown.
diff --git a/gdb/valarith.c b/gdb/valarith.c
index b9b3657..59f67d3 100644
--- a/gdb/valarith.c
+++ b/gdb/valarith.c
@@ -546,13 +546,13 @@ value_x_unop (struct value *arg1, enum exp_opcode op, enum noside noside)
break;
case UNOP_POSTINCREMENT:
strcpy (ptr, "++");
- argvec[2] = value_from_longest (builtin_type_int, 0);
+ argvec[2] = value_from_longest (builtin_type_int8, 0);
argvec[3] = 0;
nargs ++;
break;
case UNOP_POSTDECREMENT:
strcpy (ptr, "--");
- argvec[2] = value_from_longest (builtin_type_int, 0);
+ argvec[2] = value_from_longest (builtin_type_int8, 0);
argvec[3] = 0;
nargs ++;
break;
@@ -1563,8 +1563,7 @@ value_bit_index (struct type *type, const gdb_byte *valaddr, int index)
if (index < low_bound || index > high_bound)
return -1;
rel_index = index - low_bound;
- word = unpack_long (builtin_type_unsigned_char,
- valaddr + (rel_index / TARGET_CHAR_BIT));
+ word = extract_unsigned_integer (valaddr + (rel_index / TARGET_CHAR_BIT), 1);
rel_index %= TARGET_CHAR_BIT;
if (gdbarch_bits_big_endian (current_gdbarch))
rel_index = TARGET_CHAR_BIT - 1 - rel_index;