aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@gnu.org>2002-07-08 20:53:45 +0000
committerMark Kettenis <kettenis@gnu.org>2002-07-08 20:53:45 +0000
commit9b94f7bfd5f81a59fcd02bdbc6d330c4c86f79fc (patch)
treebfda4df54ab81a4afd5489c044205c0a817f28ff
parentc74222f7de2e4198556888ce584680f643ee5110 (diff)
downloadgdb-9b94f7bfd5f81a59fcd02bdbc6d330c4c86f79fc.zip
gdb-9b94f7bfd5f81a59fcd02bdbc6d330c4c86f79fc.tar.gz
gdb-9b94f7bfd5f81a59fcd02bdbc6d330c4c86f79fc.tar.bz2
* dwarf2cfi.c: Include "gcore.h".
(execute_stack_op): Fix implementation of the DW_OP_deref and DW_OP_deref_size operators by letting do their lookup in the target.
-rw-r--r--gdb/ChangeLog7
-rw-r--r--gdb/dwarf2cfi.c32
2 files changed, 18 insertions, 21 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 2515ed1..eb6b039 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,10 @@
+2002-07-08 Mark Kettenis <kettenis@gnu.org>
+
+ * dwarf2cfi.c: Include "gcore.h".
+ (execute_stack_op): Fix implementation of the
+ DW_OP_deref and DW_OP_deref_size operators by letting do their
+ lookup in the target.
+
2002-07-07 Mark Kettenis <kettenis@gnu.org>
From Peter Schauer <Peter.Schauer@regent.e-technik.tu-muenchen.de>:
diff --git a/gdb/dwarf2cfi.c b/gdb/dwarf2cfi.c
index 7302b45..8d9567f 100644
--- a/gdb/dwarf2cfi.c
+++ b/gdb/dwarf2cfi.c
@@ -21,6 +21,7 @@
Boston, MA 02111-1307, USA. */
#include "defs.h"
+#include "gdbcore.h"
#include "symtab.h"
#include "symfile.h"
#include "objfiles.h"
@@ -1119,32 +1120,21 @@ execute_stack_op (struct objfile *objfile,
{
case DW_OP_deref:
{
- char *ptr = (char *) result;
- result = read_pointer (objfile->obfd, &ptr);
+ int len = TARGET_ADDR_BIT / TARGET_CHAR_BIT;
+ if (len != 4 && len != 8)
+ internal_error (__FILE__, __LINE__,
+ "execute_stack_op error");
+ result = read_memory_unsigned_integer (result, len);
}
break;
case DW_OP_deref_size:
{
- char *ptr = (char *) result;
- switch (*op_ptr++)
- {
- case 1:
- result = read_1u (objfile->obfd, &ptr);
- break;
- case 2:
- result = read_2u (objfile->obfd, &ptr);
- break;
- case 4:
- result = read_4u (objfile->obfd, &ptr);
- break;
- case 8:
- result = read_8u (objfile->obfd, &ptr);
- break;
- default:
- internal_error (__FILE__, __LINE__,
- "execute_stack_op error");
- }
+ int len = *op_ptr++;
+ if (len != 1 && len != 2 && len != 4 && len !=8)
+ internal_error (__FILE__, __LINE__,
+ "execute_stack_op error");
+ result = read_memory_unsigned_integer (result, len);
}
break;