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

[Xen-changelog] pdb: reconcile register manipulation between processes and domains



# HG changeset patch
# User ach61@xxxxxxxxxxxxxxxxxxxxxx
# Node ID 09be5b1bdeb0df88e24bb6ec89c7c523a4800b19
# Parent  57b2fa8bf11da928b39f4971391bdcf1c7953c2c

pdb: reconcile register manipulation between processes and domains

diff -r 57b2fa8bf11d -r 09be5b1bdeb0 tools/debugger/pdb/pdb_caml_xen.h
--- a/tools/debugger/pdb/pdb_caml_xen.h Wed Jul 13 15:04:49 2005
+++ b/tools/debugger/pdb/pdb_caml_xen.h Wed Jul 13 15:37:08 2005
@@ -16,6 +16,14 @@
                      GDB_CS,  GDB_SS,  GDB_DS,  GDB_ES,
                      GDB_FS,  GDB_GS };
 
+/* this order comes from linux-2.6.11/include/asm-i386/ptrace.h */
+enum x86_registers { LINUX_EBX, LINUX_ECX, LINUX_EDX, LINUX_ESI, LINUX_EDI,
+                     LINUX_EBP, LINUX_EAX, LINUX_DS,  LINUX_ES,  LINUX_FS,
+                     LINUX_GS,  LINUX_ORIG_EAX, LINUX_EIP, LINUX_CS, LINUX_EFL,
+                     LINUX_ESP, LINUX_SS };
+#define REGISTER_FRAME_SIZE 17
+
+
 #define PAGE_SIZE 4096
 
 extern int xc_handle;
diff -r 57b2fa8bf11d -r 09be5b1bdeb0 tools/debugger/pdb/pdb_caml_process.c
--- a/tools/debugger/pdb/pdb_caml_process.c     Wed Jul 13 15:04:49 2005
+++ b/tools/debugger/pdb/pdb_caml_process.c     Wed Jul 13 15:37:08 2005
@@ -22,13 +22,6 @@
 #include "pdb_module.h"
 #include "pdb_caml_xen.h"
 
-/* this order comes from linux-2.6.11/include/asm-i386/ptrace.h */
-enum x86_registers { LINUX_EBX, LINUX_ECX, LINUX_EDX, LINUX_ESI, LINUX_EDI,
-                     LINUX_EBP, LINUX_EAX, LINUX_DS,  LINUX_ES,  LINUX_FS,
-                     LINUX_GS,  LINUX_ORIG_EAX, LINUX_EIP, LINUX_CS, LINUX_EFL,
-                     LINUX_ESP, LINUX_SS };
-#define FRAME_SIZE 17
-
 typedef struct
 {
     int domain;
@@ -206,7 +199,7 @@
     CAMLparam1(context);
     CAMLlocal1(result);
 
-    u32 regs[FRAME_SIZE];
+    u32 regs[REGISTER_FRAME_SIZE];
 
     pdb_request_t req;
     context_t ctx;
@@ -218,7 +211,7 @@
     req.domain  = ctx.domain;
     req.process = ctx.process;
 
-    for (loop = 0; loop < FRAME_SIZE; loop++)
+    for (loop = 0; loop < REGISTER_FRAME_SIZE; loop++)
     {
         pdb_response_t resp;
 
diff -r 57b2fa8bf11d -r 09be5b1bdeb0 tools/debugger/pdb/pdb_caml_domain.c
--- a/tools/debugger/pdb/pdb_caml_domain.c      Wed Jul 13 15:04:49 2005
+++ b/tools/debugger/pdb/pdb_caml_domain.c      Wed Jul 13 15:37:08 2005
@@ -19,12 +19,6 @@
 #include <caml/mlvalues.h>
 
 #include "pdb_caml_xen.h"
-
-/* this order comes from xen/include/public/arch-x86_32.h */
-enum x86_registers { PDB_EBX, PDB_ECX, PDB_EDX, PDB_ESI, PDB_EDI,
-                     PDB_EBP, PDB_EAX, PDB_Error_code, PDB_Entry_vector, 
-                     PDB_EIP, PDB_CS, PDB_EFLAGS, PDB_ESP, PDB_SS,
-                     PDB_ES, PDB_DS, PDB_FS, PDB_GS };
 
 typedef struct
 {
@@ -119,26 +113,25 @@
 
     switch (my_reg)
     {
-    case PDB_EBX: regs->ebx = val; break;
-    case PDB_ECX: regs->ecx = val; break;
-    case PDB_EDX: regs->edx = val; break;
-    case PDB_ESI: regs->esi = val; break;
-    case PDB_EDI: regs->edi = val; break;
-
-    case PDB_EBP: regs->ebp = val; break;
-    case PDB_EAX: regs->eax = val; break;
-    case PDB_Error_code: regs->error_code = val; break;
-    case PDB_Entry_vector: regs->entry_vector = val; break;
+    case GDB_EAX: regs->eax = val; break;
+    case GDB_ECX: regs->ecx = val; break;
+    case GDB_EDX: regs->edx = val; break;
+    case GDB_EBX: regs->ebx = val; break;
+
+    case GDB_ESP: regs->esp = val; break;
+    case GDB_EBP: regs->ebp = val; break;
+    case GDB_ESI: regs->esi = val; break;
+    case GDB_EDI: regs->edi = val; break;
  
-    case PDB_EIP: regs->eip = val; break;
-    case PDB_CS:  regs->cs  = val; break;
-    case PDB_EFLAGS: regs->eflags = val; break;
-    case PDB_ESP: regs->esp = val; break;
-    case PDB_SS:  regs->ss  = val; break;
-    case PDB_ES:  regs->es  = val; break;
-    case PDB_DS:  regs->ds  = val; break;
-    case PDB_FS:  regs->fs  = val; break;
-    case PDB_GS:  regs->gs  = val; break;
+    case GDB_EIP: regs->eip = val; break;
+    case GDB_EFL: regs->eflags = val; break;
+
+    case GDB_CS:  regs->cs  = val; break;
+    case GDB_SS:  regs->ss  = val; break;
+    case GDB_DS:  regs->ds  = val; break;
+    case GDB_ES:  regs->es  = val; break;
+    case GDB_FS:  regs->fs  = val; break;
+    case GDB_GS:  regs->gs  = val; break;
     }
 
     if ( xendebug_write_registers(xc_handle, ctx.domain, ctx.vcpu, regs) )
@@ -437,9 +430,10 @@
         failwith("query domain stop");
     }
 
-    printf ("QDS: %d\n", count);
+    printf ("QDS [%d]: \n", count);
     for (loop = 0; loop < count; loop ++)
-        printf ("  %d %d\n", loop, dom_list[loop]);
+        printf (" %d", dom_list[loop]);
+    printf ("\n");
 
     result = caml_alloc(2,0);
     if ( count > 0 )                                                  /* car */
diff -r 57b2fa8bf11d -r 09be5b1bdeb0 tools/debugger/pdb/debugger.ml
--- a/tools/debugger/pdb/debugger.ml    Wed Jul 13 15:04:49 2005
+++ b/tools/debugger/pdb/debugger.ml    Wed Jul 13 15:37:08 2005
@@ -331,7 +331,7 @@
   let (dom, vcpu) = List.find find_pair dom_list in
   let vec = 3 in
   let sock = PDB.find_domain dom vcpu in
-  print_endline (Printf.sprintf "handle bkpt d:%d ed:%d v:%d  %s" 
+  print_endline (Printf.sprintf "handle bkpt dom:%d vcpu:%d vec:%d  %s" 
                   dom vcpu vec (Util.get_connection_info sock));
   Util.send_reply sock "S05";
   Evtchn.unmask fd channel                                (* allow next virq *)

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.