Hi David,

On Tue, 2007-12-11 at 13:21 -0700, David Mosberger-Tang wrote:
> I'm fine with the patch in principe, but I think it needs to go into a
> dwarf-specific file ("mi" stands for "machine-independent").

OK, what about using tdep_get_ip() instead? It will do the right thing
whatever the target.

2007-12-14  Mark Wielaard  <[EMAIL PROTECTED]>

    * src/mi/Gget_reg.c (unw_get_reg): Use tdep_get_ip() when
    looking for UNW_REG_IP.

Thanks,

Mark
diff --git a/src/mi/Gget_reg.c b/src/mi/Gget_reg.c
index 23b72be..021d913 100644
--- a/src/mi/Gget_reg.c
+++ b/src/mi/Gget_reg.c
@@ -30,5 +30,12 @@ unw_get_reg (unw_cursor_t *cursor, int regnum, unw_word_t *valp)
 {
   struct cursor *c = (struct cursor *) cursor;
 
+  // We can get the IP value directly without needing a lookup.
+  if (regnum == UNW_REG_IP)
+    {
+      *valp = tdep_get_ip (c);
+      return 0;
+    }
+
   return tdep_access_reg (c, regnum, valp, 0);
 }
_______________________________________________
Libunwind-devel mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/libunwind-devel

Reply via email to