Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/gpl3/gdb/dist/gdb Add "Xhandle*" inter...



details:   https://anonhg.NetBSD.org/src/rev/e52f679502db
branches:  trunk
changeset: 318434:e52f679502db
user:      christos <christos%NetBSD.org@localhost>
date:      Mon Apr 23 14:53:07 2018 +0000
description:
Add "Xhandle*" interrupt handling.

diffstat:

 external/gpl3/gdb/dist/gdb/amd64-nbsd-tdep.c |  47 +++++++++++++++++++--------
 external/gpl3/gdb/dist/gdb/i386-nbsd-tdep.c  |  26 ++++++++------
 2 files changed, 48 insertions(+), 25 deletions(-)

diffs (114 lines):

diff -r 8ca00160fcf9 -r e52f679502db external/gpl3/gdb/dist/gdb/amd64-nbsd-tdep.c
--- a/external/gpl3/gdb/dist/gdb/amd64-nbsd-tdep.c      Mon Apr 23 10:35:20 2018 +0000
+++ b/external/gpl3/gdb/dist/gdb/amd64-nbsd-tdep.c      Mon Apr 23 14:53:07 2018 +0000
@@ -148,10 +148,21 @@
 
   /* There is an extra 'call' in the interrupt sequence - ignore the extra
    * return address */
-  if (name && strncmp (name, "Xintr", 5) == 0)
-    addr = sp + 8;             /* It's an interrupt frame.  */
-  else
-    addr = sp;
+
+  addr = sp;
+  if (name) {
+       if (strncmp (name, "Xintr", 5) == 0
+        || strncmp (name, "Xhandle", 7) == 0) {
+               addr += 8;              /* It's an interrupt frame.  */
+       }
+  }
+
+#ifdef DEBUG_TRAPFRAME
+  for (i = 0; i < 50; i++) {
+    cs = read_memory_unsigned_integer (addr + i * 8, 8, byte_order);
+    printf("%s i=%d r=%#jx\n", name, i, (intmax_t)cs);
+  }
+#endif
 
   for (i = 0; i < ARRAY_SIZE (amd64nbsd_tf_reg_offset); i++)
     if (amd64nbsd_tf_reg_offset[i] != -1)
@@ -163,6 +174,10 @@
   rip = read_memory_unsigned_integer (addr
     + amd64nbsd_tf_reg_offset[AMD64_RIP_REGNUM], 8, byte_order);
 
+#ifdef DEBUG_TRAPFRAME
+  printf("%s cs=%#jx rip=%#jx\n", name, (intmax_t)cs, (intmax_t)rip);
+#endif
+
   /* The trap frame layout was changed lf the %rip value is less than 2^16 it
    * is almost certainly the %ss of the old format. */
   if (rip < (1 << 16))
@@ -243,16 +258,20 @@
 
   find_pc_partial_function (get_frame_pc (this_frame), &name, NULL, NULL);
   return (name && ((strcmp (name, "alltraps") == 0)
-                  || (strcmp (name, "calltrap") == 0)
-                  || (strncmp (name, "Xtrap", 5) == 0)
-                  || (strcmp (name, "osyscall1") == 0)
-                  || (strcmp (name, "Xsyscall") == 0)
-                  || (strncmp (name, "Xintr", 5) == 0)
-                  || (strncmp (name, "Xresume", 7) == 0)
-                  || (strncmp (name, "Xstray", 6) == 0)
-                  || (strncmp (name, "Xrecurse", 8) == 0)
-                  || (strncmp (name, "Xsoft", 5) == 0)
-                  || (strcmp (name, "Xdoreti") == 0)));
+               || (strcmp (name, "calltrap") == 0)
+               || (strcmp (name, "handle_syscall") == 0)
+               || (strcmp (name, "Xdoreti") == 0)
+               || (strcmp (name, "Xspllower") == 0)
+               || (strncmp (name, "Xhandle", 7) == 0)
+               || (strncmp (name, "Xintr", 5) == 0)
+               || (strncmp (name, "Xpreempt", 8) == 0)
+               || (strncmp (name, "Xrecurse", 8) == 0)
+               || (strncmp (name, "Xresume", 7) == 0)
+               || (strncmp (name, "Xsoft", 5) == 0)
+               || (strncmp (name, "Xstray", 6) == 0)
+               || (strncmp (name, "Xsyscall", 8) == 0)
+               || (strncmp (name, "Xtrap", 5) == 0)
+           ));
 }
 
 static const struct frame_unwind amd64nbsd_trapframe_unwind = {
diff -r 8ca00160fcf9 -r e52f679502db external/gpl3/gdb/dist/gdb/i386-nbsd-tdep.c
--- a/external/gpl3/gdb/dist/gdb/i386-nbsd-tdep.c       Mon Apr 23 10:35:20 2018 +0000
+++ b/external/gpl3/gdb/dist/gdb/i386-nbsd-tdep.c       Mon Apr 23 14:53:07 2018 +0000
@@ -312,7 +312,8 @@
   sp = get_frame_register_unsigned (this_frame, I386_ESP_REGNUM);
 
   find_pc_partial_function (func, &name, NULL, NULL);
-  if (name && strncmp (name, "Xintr", 5) == 0)
+  if (name && (strncmp (name, "Xintr", 5) == 0 ||
+               strncmp (name, "Xhandle", 7) == 0))
     {
       /* It's an interrupt frame. */
       tmp = read_memory_unsigned_integer (sp + 4, 4, byte_order);
@@ -391,16 +392,19 @@
 
   find_pc_partial_function (get_frame_pc (this_frame), &name, NULL, NULL);
   return (name && ((strcmp (name, "alltraps") == 0)
-                  || (strcmp (name, "calltrap") == 0)
-                  || (strncmp (name, "Xtrap", 5) == 0)
-                  || (strcmp (name, "syscall1") == 0)
-                  || (strcmp (name, "Xsyscall") == 0)
-                  || (strncmp (name, "Xintr", 5) == 0)
-                  || (strncmp (name, "Xresume", 7) == 0)
-                  || (strncmp (name, "Xstray", 6) == 0)
-                  || (strncmp (name, "Xrecurse", 8) == 0)
-                  || (strncmp (name, "Xsoft", 5) == 0)
-                  || (strncmp (name, "Xdoreti", 5) == 0)));
+               || (strcmp (name, "calltrap") == 0)
+               || (strcmp (name, "syscall1") == 0)
+               || (strcmp (name, "Xdoreti") == 0)
+               || (strncmp (name, "Xintr", 5) == 0)
+               || (strncmp (name, "Xhandle", 7) == 0)
+               || (strncmp (name, "Xpreempt", 8) == 0)
+               || (strncmp (name, "Xrecurse", 8) == 0)
+               || (strncmp (name, "Xresume", 7) == 0)
+               || (strncmp (name, "Xsoft", 5) == 0)
+               || (strncmp (name, "Xstray", 6) == 0)
+               || (strncmp (name, "Xsyscall", 8) == 0)
+               || (strncmp (name, "Xtrap", 5) == 0)
+           ));
 }
 
 const struct frame_unwind i386nbsd_trapframe_unwind = {



Home | Main Index | Thread Index | Old Index