ia64/xen-unstable

changeset 9179:57a905038907

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

Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
author kaf24@firebug.cl.cam.ac.uk
date Mon Mar 06 23:49:48 2006 +0100 (2006-03-06)
parents b0d8b38681ff
children 583d01868d17
files xen/common/gdbstub.c xen/include/xen/gdbstub.h
line diff
     1.1 --- a/xen/common/gdbstub.c	Mon Mar 06 23:47:53 2006 +0100
     1.2 +++ b/xen/common/gdbstub.c	Mon Mar 06 23:49:48 2006 +0100
     1.3 @@ -348,7 +348,10 @@ gdb_cmd_write_mem(unsigned long addr, un
     1.4          }
     1.5      }
     1.6  
     1.7 -    gdb_write_to_packet_str((x != length) ? "OK" : "E11", ctx);
     1.8 +    if (x == length)
     1.9 +        gdb_write_to_packet_str("OK", ctx);
    1.10 +    else
    1.11 +        gdb_write_to_packet_str("E11", ctx);
    1.12  
    1.13      dbg_printk("Write done.\n");
    1.14  
    1.15 @@ -397,13 +400,18 @@ process_command(struct cpu_user_regs *re
    1.16          break;
    1.17      case 'M': /* Write memory */
    1.18          addr = simple_strtoul(ctx->in_buf + 1, &ptr, 16);
    1.19 -        if ( (ptr == (ctx->in_buf + 1)) || (ptr[0] != ':') )
    1.20 +        if ( (ptr == (ctx->in_buf + 1)) || (ptr[0] != ',') )
    1.21          {
    1.22              gdb_send_reply("E03", ctx);
    1.23              return 0;
    1.24          }
    1.25          length = simple_strtoul(ptr + 1, &ptr, 16);
    1.26 -        gdb_cmd_write_mem(addr, length, ptr, ctx);
    1.27 +        if ( ptr[0] != ':')
    1.28 +        {
    1.29 +            gdb_send_reply("E04", ctx);
    1.30 +            return 0;
    1.31 +        }
    1.32 +        gdb_cmd_write_mem(addr, length, ptr + 1, ctx);
    1.33          break;
    1.34      case 'p': /* read register */
    1.35          addr = simple_strtoul(ctx->in_buf + 1, &ptr, 16);
    1.36 @@ -419,12 +427,6 @@ process_command(struct cpu_user_regs *re
    1.37          }
    1.38          gdb_arch_read_reg(addr, regs, ctx);
    1.39          break;
    1.40 -    case 'Z': /* We need to claim to support these or gdb
    1.41 -                 won't let you continue the process. */
    1.42 -    case 'z':
    1.43 -        gdb_send_reply("OK", ctx);
    1.44 -        break;
    1.45 -
    1.46      case 'D':
    1.47          ctx->currently_attached = 0;
    1.48          gdb_send_reply("OK", ctx);
     2.1 --- a/xen/include/xen/gdbstub.h	Mon Mar 06 23:47:53 2006 +0100
     2.2 +++ b/xen/include/xen/gdbstub.h	Mon Mar 06 23:49:48 2006 +0100
     2.3 @@ -21,6 +21,9 @@
     2.4  #ifndef __XEN_GDBSTUB_H__
     2.5  #define __XEN_GDBSTUB_H__
     2.6  
     2.7 +#include <asm/atomic.h>
     2.8 +#include <asm/page.h>
     2.9 +
    2.10  #ifdef CRASH_DEBUG
    2.11  
    2.12  /* value <-> char (de)serialzers for arch specific gdb backends */