WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] gdbstub: Small fixes.

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] gdbstub: Small fixes.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 12 Aug 2009 07:45:34 -0700
Delivery-date: Wed, 12 Aug 2009 07:47:26 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1250083672 -3600
# Node ID 8a9f81672c76c93891a2af0bbc2659c83493a440
# Parent  ebb07c5934c8cc0090bbbd6ce17a558e73428339
gdbstub: Small fixes.

 * Correctly handly EFLAGS.TF in the hypervisor
 * Register value sent with 'P' command is in native byte order.

Signed-off-by: Keir Fraser <keir.fraser@xxxxxxxxxx>
---
 xen/arch/x86/traps.c |    7 +++++--
 xen/common/gdbstub.c |   24 +++++++++++++++++++++++-
 2 files changed, 28 insertions(+), 3 deletions(-)

diff -r ebb07c5934c8 -r 8a9f81672c76 xen/arch/x86/traps.c
--- a/xen/arch/x86/traps.c      Wed Aug 12 14:16:09 2009 +0100
+++ b/xen/arch/x86/traps.c      Wed Aug 12 14:27:52 2009 +0100
@@ -3007,9 +3007,12 @@ asmlinkage void do_debug(struct cpu_user
             if ( (regs->rip >= (unsigned long)sysenter_entry) &&
                  (regs->rip < (unsigned long)sysenter_eflags_saved) )
                 goto out;
-            WARN_ON(regs->rip != (unsigned long)sysenter_eflags_saved);
+            if ( (regs->rip != (unsigned long)sysenter_eflags_saved) &&
+                 !debugger_trap_fatal(TRAP_debug, regs) )
+                WARN_ON(1);
 #else
-            WARN_ON(1);
+            if ( !debugger_trap_fatal(TRAP_debug, regs) )
+                WARN_ON(1);
 #endif
             regs->eflags &= ~EF_TF;
         }
diff -r ebb07c5934c8 -r 8a9f81672c76 xen/common/gdbstub.c
--- a/xen/common/gdbstub.c      Wed Aug 12 14:16:09 2009 +0100
+++ b/xen/common/gdbstub.c      Wed Aug 12 14:27:52 2009 +0100
@@ -116,6 +116,28 @@ str2ulong(const char *str, unsigned long
     return x;
 }
 
+unsigned long
+str_to_native_ulong(const char *str)
+{
+    unsigned long x = 0, i = 0;
+
+    while ( *str && (i < BYTES_PER_LONG) )
+    {
+#ifdef __BIG_ENDIAN
+        x <<= 8;
+        x += str2hex(*str);
+#elif defined(__LITTLE_ENDIAN)
+        x += (unsigned long)str2hex(*str) << (i*8);
+#else
+# error unknown endian
+#endif
+        str += 2;
+        i++;
+    }
+
+    return x;
+}
+
 /* gdb io wrappers */
 static signed long
 gdb_io_write(const char *buf, unsigned long len, struct gdb_context *ctx)
@@ -488,7 +510,7 @@ process_command(struct cpu_user_regs *re
             return 0;
         }
         ptr++;
-        val = str2ulong(ptr, sizeof(unsigned long));
+        val = str_to_native_ulong(ptr);
         gdb_arch_write_reg(addr, val, regs, ctx);
         break;
     case 'D':

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] gdbstub: Small fixes., Xen patchbot-unstable <=