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-devel

[Xen-devel] [patch] additional gdbstub fixes

To: Xen Devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [patch] additional gdbstub fixes
From: Hollis Blanchard <hollisb@xxxxxxxxxx>
Date: Mon, 6 Mar 2006 15:59:08 -0600
Cc: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
Delivery-date: Mon, 06 Mar 2006 22:00:14 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Organization: IBM Linux Technology Center
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: KMail/1.8.3
Fix additional gdbstub issues.
- gdbstub.h uses atomic_t and PAGE_SIZE, so include those headers
- do not lie about setting breakpoints
- fix memory writing

Given that breakpoints/stepping and memory writing completely did not work, I 
think a little more testing could have gone in to the common gdbstub.

Note that when the stub does not support the "Z" (breakpoint) command, GDB 
falls back to writing trap instructions directly into memory (which was also 
broken). I have no idea why that comment about "gdb won't let you continue 
the process" was there.

Please apply.

Signed-off-by: Hollis Blanchard <hollisb@xxxxxxxxxx>

# HG changeset patch
# User hollisb@xxxxxxxxxxxxxxxxxxxxx
# Node ID c26f6df8adc48b0559f036a803b4c79894303bec
# Parent  2307bf2a4bfc615488a9a606753fbcb021532fcf
fix gdbstub breakpoints, memory writing, and build

diff -r 2307bf2a4bfc -r c26f6df8adc4 xen/common/gdbstub.c
--- a/xen/common/gdbstub.c      Fri Mar  3 18:21:48 2006
+++ b/xen/common/gdbstub.c      Mon Mar  6 21:52:45 2006
@@ -348,7 +348,10 @@
         }
     }
 
-    gdb_write_to_packet_str((x != length) ? "OK" : "E11", ctx);
+    if (x == length)
+        gdb_write_to_packet_str("OK", ctx);
+    else
+        gdb_write_to_packet_str("E11", ctx);
 
     dbg_printk("Write done.\n");
 
@@ -397,13 +400,18 @@
         break;
     case 'M': /* Write memory */
         addr = simple_strtoul(ctx->in_buf + 1, &ptr, 16);
-        if ( (ptr == (ctx->in_buf + 1)) || (ptr[0] != ':') )
+        if ( (ptr == (ctx->in_buf + 1)) || (ptr[0] != ',') )
         {
             gdb_send_reply("E03", ctx);
             return 0;
         }
         length = simple_strtoul(ptr + 1, &ptr, 16);
-        gdb_cmd_write_mem(addr, length, ptr, ctx);
+        if ( ptr[0] != ':')
+        {
+            gdb_send_reply("E04", ctx);
+            return 0;
+        }
+        gdb_cmd_write_mem(addr, length, ptr + 1, ctx);
         break;
     case 'p': /* read register */
         addr = simple_strtoul(ctx->in_buf + 1, &ptr, 16);
@@ -419,12 +427,6 @@
         }
         gdb_arch_read_reg(addr, regs, ctx);
         break;
-    case 'Z': /* We need to claim to support these or gdb
-                 won't let you continue the process. */
-    case 'z':
-        gdb_send_reply("OK", ctx);
-        break;
-
     case 'D':
         ctx->currently_attached = 0;
         gdb_send_reply("OK", ctx);
diff -r 2307bf2a4bfc -r c26f6df8adc4 xen/include/xen/gdbstub.h
--- a/xen/include/xen/gdbstub.h Fri Mar  3 18:21:48 2006
+++ b/xen/include/xen/gdbstub.h Mon Mar  6 21:52:45 2006
@@ -20,6 +20,9 @@
 
 #ifndef __XEN_GDBSTUB_H__
 #define __XEN_GDBSTUB_H__
+
+#include <asm/atomic.h>
+#include <asm/page.h>
 
 #ifdef CRASH_DEBUG
 

-- 
Hollis Blanchard
IBM Linux Technology Center

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [patch] additional gdbstub fixes, Hollis Blanchard <=