aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorMichael Snyder <msnyder@vmware.com>2000-05-24 17:25:39 +0000
committerMichael Snyder <msnyder@vmware.com>2000-05-24 17:25:39 +0000
commit0f2c5ba5c5457819f3089c6ad9cd7fced6bc0538 (patch)
treee6646427c1e7f096b86cb9fbd833d7affcd5a479 /gdb
parentab9d50c7a84d3313a3a8c0d23c8d2b01fc3c507e (diff)
downloadgdb-0f2c5ba5c5457819f3089c6ad9cd7fced6bc0538.zip
gdb-0f2c5ba5c5457819f3089c6ad9cd7fced6bc0538.tar.gz
gdb-0f2c5ba5c5457819f3089c6ad9cd7fced6bc0538.tar.bz2
2000-05-24 Michael Snyder <msnyder@seadog.cygnus.com>
* findvar.c (value_from_register): Factor code, simplify logic.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog4
-rw-r--r--gdb/findvar.c32
2 files changed, 18 insertions, 18 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 04db1e2..efedf75 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,7 @@
+2000-05-24 Michael Snyder <msnyder@seadog.cygnus.com>
+
+ * findvar.c (value_from_register): Factor code, simplify logic.
+
2000-05-23 J.T. Conklin <jtc@redback.com>
* config/i386/nbsd.mt (TDEPFILES): Move solib.o from here...
diff --git a/gdb/findvar.c b/gdb/findvar.c
index 8f19608..7edbcea 100644
--- a/gdb/findvar.c
+++ b/gdb/findvar.c
@@ -1476,7 +1476,7 @@ addresses have not been bound by the dynamic loader. Try again when executable i
}
/* Return a value of type TYPE, stored in register REGNUM, in frame
- FRAME.
+ FRAME.
NOTE: returns NULL if register value is not available.
Caller will check return value or die! */
@@ -1500,7 +1500,8 @@ value_from_register (type, regnum, frame)
CHECK_TYPEDEF (type);
len = TYPE_LENGTH (type);
- /* Pointers on D10V are really only 16 bits, but we lie to gdb elsewhere... */
+ /* Pointers on D10V are really only 16 bits,
+ but we lie to gdb elsewhere... */
if (GDB_TARGET_IS_D10V && TYPE_CODE (type) == TYPE_CODE_PTR)
len = 2;
@@ -1703,25 +1704,20 @@ value_from_register (type, regnum, frame)
}
if (GDB_TARGET_IS_D10V
- && TYPE_CODE (type) == TYPE_CODE_PTR
- && TYPE_TARGET_TYPE (type)
- && (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_FUNC))
+ && TYPE_CODE (type) == TYPE_CODE_PTR)
{
- /* pointer to function */
unsigned long num;
unsigned short snum;
- snum = (unsigned short) extract_unsigned_integer (VALUE_CONTENTS_RAW (v), 2);
- num = D10V_MAKE_IADDR (snum);
- store_address (VALUE_CONTENTS_RAW (v), 4, num);
- }
- else if (GDB_TARGET_IS_D10V
- && TYPE_CODE (type) == TYPE_CODE_PTR)
- {
- /* pointer to data */
- unsigned long num;
- unsigned short snum;
- snum = (unsigned short) extract_unsigned_integer (VALUE_CONTENTS_RAW (v), 2);
- num = D10V_MAKE_DADDR (snum);
+
+ snum = (unsigned short)
+ extract_unsigned_integer (VALUE_CONTENTS_RAW (v), 2);
+
+ if (TYPE_TARGET_TYPE (type) /* pointer to function */
+ && (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_FUNC))
+ num = D10V_MAKE_IADDR (snum);
+ else /* pointer to data */
+ num = D10V_MAKE_DADDR (snum);
+
store_address (VALUE_CONTENTS_RAW (v), 4, num);
}