+2009-06-17 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * printcmd.c (print_scalar_formatted): Always truncate
+ unsigned data types.
+
+ * cli-dump.c (struct callback_data): Change type of load_offset
+ to CORE_ADDR.
+ (restore_binary_file): Update type casts.
+ (restore_command): Parse load_offset as address, not long.
+
+ * utils.c (string_to_core_addr): Do not sign-extend value.
+ * varobj.c (find_frame_addr_in_frame_chain): Truncate frame_base
+ before comparing against requested frame address.
+
2009-06-17 Ulrich Weigand <uweigand@de.ibm.com>
* gdbarch.sh (gcore_bfd_target): New gdbarch callback.
/* Opaque data for restore_section_callback. */
struct callback_data {
- long load_offset;
+ CORE_ADDR load_offset;
CORE_ADDR load_start;
CORE_ADDR load_end;
};
printf_filtered
("Restoring binary file %s into memory (0x%lx to 0x%lx)\n",
filename,
- (unsigned long) data->load_start + data->load_offset,
- (unsigned long) data->load_start + data->load_offset + len);
+ (unsigned long) (data->load_start + data->load_offset),
+ (unsigned long) (data->load_start + data->load_offset + len));
/* Now set the file pos to the requested load start pos. */
if (fseek (file, data->load_start, SEEK_SET) != 0)
/* Parse offset (optional). */
if (args != NULL && *args != '\0')
data.load_offset =
- parse_and_eval_long (scan_expression_with_cleanup (&args, NULL));
+ parse_and_eval_address (scan_expression_with_cleanup (&args, NULL));
if (args != NULL && *args != '\0')
{
/* Parse start address (optional). */
/* If we are printing it as unsigned, truncate it in case it is actually
a negative signed value (e.g. "print/u (short)-1" should print 65535
(if shorts are 16 bits) instead of 4294967295). */
- if (options->format != 'd')
+ if (options->format != 'd' || TYPE_UNSIGNED (type))
{
if (len < sizeof (LONGEST))
val_long &= ((LONGEST) 1 << HOST_CHAR_BIT * len) - 1;
+2009-06-17 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
+
+ * gdb.base/dump.exp: Handle SPU like 64-bit platforms.
+
2009-06-17 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
* gdb.mi/gdb680.exp: Update test for error message.
set is64bitonly "yes"
}
+if {[istarget "spu*-*-*"]} then {
+ # The internal address format used for the combined Cell/B.E.
+ # debugger requires 64-bit.
+ set is64bitonly "yes"
+}
+
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable ${options}] != "" } {
untested dump.exp
return -1
CORE_ADDR
string_to_core_addr (const char *my_string)
{
- int addr_bit = gdbarch_addr_bit (current_gdbarch);
CORE_ADDR addr = 0;
if (my_string[0] == '0' && tolower (my_string[1]) == 'x')
else
error (_("invalid hex \"%s\""), my_string);
}
-
- /* Not very modular, but if the executable format expects
- addresses to be sign-extended, then do so if the address was
- specified with only 32 significant bits. Really this should
- be determined by the target architecture, not by the object
- file. */
- if (i - 2 == addr_bit / 4
- && exec_bfd
- && bfd_get_sign_extend_vma (exec_bfd))
- addr = (addr ^ ((CORE_ADDR) 1 << (addr_bit - 1)))
- - ((CORE_ADDR) 1 << (addr_bit - 1));
}
else
{
frame != NULL;
frame = get_prev_frame (frame))
{
- if (get_frame_base_address (frame) == frame_addr)
+ /* The CORE_ADDR we get as argument was parsed from a string GDB
+ output as $fp. This output got truncated to gdbarch_addr_bit.
+ Truncate the frame base address in the same manner before
+ comparing it against our argument. */
+ CORE_ADDR frame_base = get_frame_base_address (frame);
+ int addr_bit = gdbarch_addr_bit (get_frame_arch (frame));
+ if (addr_bit < (sizeof (CORE_ADDR) * HOST_CHAR_BIT))
+ frame_base &= ((CORE_ADDR) 1 << addr_bit) - 1;
+
+ if (frame_base == frame_addr)
return frame;
}