aboutsummaryrefslogtreecommitdiff
path: root/opcodes
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1999-08-10 15:02:41 +0000
committerIan Lance Taylor <ian@airs.com>1999-08-10 15:02:41 +0000
commit9c492adce5bb8cf1422878cfd5e294fabed9b2b9 (patch)
tree419178ae6de95be417169fccea6560534b0584d8 /opcodes
parent5499724a85d9cb03d56bb3aa7ef6519c00cfece8 (diff)
downloadgdb-9c492adce5bb8cf1422878cfd5e294fabed9b2b9.zip
gdb-9c492adce5bb8cf1422878cfd5e294fabed9b2b9.tar.gz
gdb-9c492adce5bb8cf1422878cfd5e294fabed9b2b9.tar.bz2
From Wally Iimura <iimura@microunity.com>:
* dis-buf.c (buffer_read_memory): Rewrite expression to avoid overflow at end of address space. (generic_print_address): Use sprintf_vma.
Diffstat (limited to 'opcodes')
-rw-r--r--opcodes/ChangeLog7
-rw-r--r--opcodes/dis-buf.c7
2 files changed, 12 insertions, 2 deletions
diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog
index 9f3cbe6..19349c6 100644
--- a/opcodes/ChangeLog
+++ b/opcodes/ChangeLog
@@ -1,3 +1,10 @@
+1999-08-10 Ian Lance Taylor <ian@zembu.com>
+
+ From Wally Iimura <iimura@microunity.com>:
+ * dis-buf.c (buffer_read_memory): Rewrite expression to avoid
+ overflow at end of address space.
+ (generic_print_address): Use sprintf_vma.
+
1999-08-08 Ian Lance Taylor <ian@zembu.com>
* Makefile.am: Rename .dep* files to DEP*. Change DEP variable to
diff --git a/opcodes/dis-buf.c b/opcodes/dis-buf.c
index c6e5121..523fe72 100644
--- a/opcodes/dis-buf.c
+++ b/opcodes/dis-buf.c
@@ -30,7 +30,7 @@ buffer_read_memory (memaddr, myaddr, length, info)
struct disassemble_info *info;
{
if (memaddr < info->buffer_vma
- || memaddr + length > info->buffer_vma + info->buffer_length)
+ || memaddr - info->buffer_vma + length > info->buffer_length)
/* Out of bounds. Use EIO because GDB uses it. */
return EIO;
memcpy (myaddr, info->buffer + (memaddr - info->buffer_vma), length);
@@ -67,7 +67,10 @@ generic_print_address (addr, info)
bfd_vma addr;
struct disassemble_info *info;
{
- (*info->fprintf_func) (info->stream, "0x%x", addr);
+ char buf[30];
+
+ sprintf_vma (buf, addr);
+ (*info->fprintf_func) (info->stream, "0x%s", buf);
}
/* Just concatenate the address as hex. This is included for