ia64/xen-unstable

changeset 17104:07d9e9ca34f0

[IA64] Add a dump command to xenitp

Signed-off-by: Tristan Gingold <tgingold@free.fr>
author Alex Williamson <alex.williamson@hp.com>
date Mon Feb 25 06:24:43 2008 -0700 (2008-02-25)
parents 3d6e463d08a2
children 4a9f31bdfcc0
files tools/debugger/xenitp/xenitp.c
line diff
     1.1 --- a/tools/debugger/xenitp/xenitp.c	Fri Feb 22 08:40:32 2008 -0700
     1.2 +++ b/tools/debugger/xenitp/xenitp.c	Mon Feb 25 06:24:43 2008 -0700
     1.3 @@ -1081,6 +1081,36 @@ cmd_disassemble (char *args)
     1.4  }
     1.5  
     1.6  static enum cmd_status
     1.7 +cmd_dump (char *args)
     1.8 +{
     1.9 +    static unsigned long addr;
    1.10 +    unsigned long end_addr = addr + 256;
    1.11 +    unsigned long p;
    1.12 +
    1.13 +    if (*args != 0) {
    1.14 +        if (parse_expr (&args, &addr, 0) < 0)
    1.15 +            return CMD_ERROR;
    1.16 +        if (*args != 0) {
    1.17 +            if (parse_expr (&args, &end_addr, 0) < 0)
    1.18 +                return CMD_ERROR;
    1.19 +        }
    1.20 +        else 
    1.21 +            end_addr = addr + 256;
    1.22 +    }
    1.23 +    for (p = addr; p < end_addr; p += 16) {
    1.24 +        int i;
    1.25 +        printf ("%016lx:", p);
    1.26 +        for (i = 0; i < 16; i++) {
    1.27 +            unsigned char *m = target_map_memory (p + i);
    1.28 +            printf ("%c%02x", i == 8 ? '-' : ' ', *m);
    1.29 +        }
    1.30 +        printf ("\n");
    1.31 +    }
    1.32 +    addr = end_addr;
    1.33 +    return CMD_REPEAT;
    1.34 +}
    1.35 +
    1.36 +static enum cmd_status
    1.37  cmd_break (char *args)
    1.38  {
    1.39      unsigned long addr;
    1.40 @@ -1461,6 +1491,7 @@ const struct command_desc commands[] = {
    1.41      { "quit", "quit debugger", cmd_quit },
    1.42      { "echo", "display parameters", cmd_echo },
    1.43      { "disassemble", "disassemble memory", cmd_disassemble },
    1.44 +    { "dump", "dump memory", cmd_dump },
    1.45      { "break", "set a break point", cmd_break },
    1.46      { "watch", "set a watch point", cmd_watch },
    1.47      { "cb", "resume until branch", cmd_cb },