aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2009-09-29 16:27:05 +0000
committerJan Kratochvil <jan.kratochvil@redhat.com>2009-09-29 16:27:05 +0000
commite453266f586ea8d1417a6b710ff61147328cf7f5 (patch)
tree7aea4675a2f6809ead7ba581bc2fac1959d21c18 /gdb
parent94454bb4c9cfcf78717194a4a6376915a606343f (diff)
downloadgdb-e453266f586ea8d1417a6b710ff61147328cf7f5.zip
gdb-e453266f586ea8d1417a6b710ff61147328cf7f5.tar.gz
gdb-e453266f586ea8d1417a6b710ff61147328cf7f5.tar.bz2
gdb/
* ia64-tdep.c (ia64_convert_from_func_ptr_addr): New variable buf. Check first the descriptor memory is readable.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/ia64-tdep.c9
2 files changed, 11 insertions, 3 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 133f423..e3196bc 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2009-09-29 Jan Kratochvil <jan.kratochvil@redhat.com>
+
+ * ia64-tdep.c (ia64_convert_from_func_ptr_addr): New variable buf.
+ Check first the descriptor memory is readable.
+
2009-09-29 Tom Tromey <tromey@redhat.com>
* python/py-value.c (valpy_string): NULL-terminate 'keywords'.
diff --git a/gdb/ia64-tdep.c b/gdb/ia64-tdep.c
index 058930b..e9464e1 100644
--- a/gdb/ia64-tdep.c
+++ b/gdb/ia64-tdep.c
@@ -3510,6 +3510,7 @@ ia64_convert_from_func_ptr_addr (struct gdbarch *gdbarch, CORE_ADDR addr,
{
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
struct obj_section *s;
+ gdb_byte buf[8];
s = find_pc_section (addr);
@@ -3520,10 +3521,12 @@ ia64_convert_from_func_ptr_addr (struct gdbarch *gdbarch, CORE_ADDR addr,
/* Normally, functions live inside a section that is executable.
So, if ADDR points to a non-executable section, then treat it
as a function descriptor and return the target address iff
- the target address itself points to a section that is executable. */
- if (s && (s->the_bfd_section->flags & SEC_CODE) == 0)
+ the target address itself points to a section that is executable.
+ Check first the memory of the whole length of 8 bytes is readable. */
+ if (s && (s->the_bfd_section->flags & SEC_CODE) == 0
+ && target_read_memory (addr, buf, 8) == 0)
{
- CORE_ADDR pc = read_memory_unsigned_integer (addr, 8, byte_order);
+ CORE_ADDR pc = extract_unsigned_integer (buf, 8, byte_order);
struct obj_section *pc_section = find_pc_section (pc);
if (pc_section && (pc_section->the_bfd_section->flags & SEC_CODE))