--- crash-4.0-3.18/main.c 2007-02-07 14:05:51.000000000 -0500 +++ crash-4.0-3.19/main.c 2007-02-07 11:05:56.000000000 -0500 @@ -722,7 +722,6 @@ machdep->verify_paddr = generic_verify_paddr; pc->redhat_debug_loc = DEFAULT_REDHAT_DEBUG_LOCATION; pc->cmdgencur = 0; - pc->cmdgenspec = ~pc->cmdgencur; pc->cmd_table = linux_command_table; /* @@ -1140,7 +1139,6 @@ gdb_command_string(pc->last_gdb_cmd, buf, FALSE)); fprintf(fp, " cur_req: %lx\n", (ulong)pc->cur_req); fprintf(fp, " cmdgencur: %ld\n", pc->cmdgencur); - fprintf(fp, " cmdgenspec: %ld\n", pc->cmdgenspec); fprintf(fp, " curcmd_flags: %lx (", pc->curcmd_flags); others = 0; if (pc->curcmd_flags & XEN_MACHINE_ADDR) @@ -1151,7 +1149,14 @@ fprintf(fp, "%sIDLE_TASK_SHOWN", others ? "|" : ""); if (pc->curcmd_flags & TASK_SPECIFIED) fprintf(fp, "%sTASK_SPECIFIED", others ? "|" : ""); + if (pc->curcmd_flags & MEMTYPE_UVADDR) + fprintf(fp, "%sMEMTYPE_UVADDR", others ? "|" : ""); + if (pc->curcmd_flags & MEMTYPE_FILEADDR) + fprintf(fp, "%sMEMTYPE_FILEADDR", others ? "|" : ""); + if (pc->curcmd_flags & HEADER_PRINTED) + fprintf(fp, "%sHEADER_PRINTED", others ? "|" : ""); fprintf(fp, ")\n"); + fprintf(fp, " curcmd_private: %llx\n", pc->curcmd_private); fprintf(fp, " sigint_cnt: %d\n", pc->sigint_cnt); fprintf(fp, " sigaction: %lx\n", (ulong)&pc->sigaction); fprintf(fp, " gdb_sigaction: %lx\n", (ulong)&pc->gdb_sigaction); --- crash-4.0-3.18/memory.c 2007-02-07 14:05:51.000000000 -0500 +++ crash-4.0-3.19/memory.c 2007-02-07 11:25:24.000000000 -0500 @@ -1,8 +1,8 @@ /* memory.c - core analysis suite * * Copyright (C) 1999, 2000, 2001, 2002 Mission Critical Linux, Inc. - * Copyright (C) 2002, 2003, 2004, 2005, 2006 David Anderson - * Copyright (C) 2002, 2003, 2004, 2005, 2006 Red Hat, Inc. All rights reserved. + * Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 David Anderson + * Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Red Hat, Inc. All rights reserved. * Copyright (C) 2002 Silicon Graphics, Inc. * * This program is free software; you can redistribute it and/or modify @@ -153,6 +153,8 @@ static ulong next_online_pgdat(int); static int vm_stat_init(void); static int dump_vm_stat(char *, long *); +static int generic_read_dumpfile(ulonglong, void *, long, char *, ulong); +static int generic_write_dumpfile(ulonglong, void *, long, char *, ulong); /* * Memory display modes specific to this file. @@ -771,7 +773,7 @@ memtype = KVADDR; count = -1; - while ((c = getopt(argcnt, args, "xme:pudDuso:81:3:6:")) != EOF) { + while ((c = getopt(argcnt, args, "xme:pfudDuso:81:3:6:")) != EOF) { switch(c) { case '8': @@ -834,12 +836,12 @@ break; case 'p': - memtype &= ~(UVADDR|KVADDR|XENMACHADDR); + memtype &= ~(UVADDR|KVADDR|XENMACHADDR|FILEADDR); memtype = PHYSADDR; break; case 'u': - memtype &= ~(KVADDR|PHYSADDR|XENMACHADDR); + memtype &= ~(KVADDR|PHYSADDR|XENMACHADDR|FILEADDR); memtype = UVADDR; break; @@ -856,10 +858,18 @@ case 'm': if (!(kt->flags & ARCH_XEN)) error(FATAL, "-m option only applies to xen architecture\n"); - memtype &= ~(UVADDR|KVADDR); + memtype &= ~(UVADDR|KVADDR|FILEADDR); memtype = XENMACHADDR; break; + case 'f': + if (!pc->dumpfile) + error(FATAL, + "-f option requires a dumpfile\n"); + memtype &= ~(KVADDR|UVADDR|PHYSADDR|XENMACHADDR); + memtype = FILEADDR; + break; + case 'x': flag |= NO_ASCII; break; @@ -1002,6 +1012,9 @@ case XENMACHADDR: addrtype = "XENMACHADDR"; break; + case FILEADDR: + addrtype = "FILEADDR"; + break; } if (CRASHDEBUG(4)) @@ -1239,7 +1252,7 @@ size = sizeof(void*); addr_entered = value_entered = FALSE; - while ((c = getopt(argcnt, args, "ukp81:3:6:")) != EOF) { + while ((c = getopt(argcnt, args, "fukp81:3:6:")) != EOF) { switch(c) { case '8': @@ -1274,17 +1287,33 @@ break; case 'p': + memtype &= ~(UVADDR|KVADDR|FILEADDR); memtype = PHYSADDR; break; case 'u': + memtype &= ~(PHYSADDR|KVADDR|FILEADDR); memtype = UVADDR; break; case 'k': + memtype &= ~(PHYSADDR|UVADDR|FILEADDR); memtype = KVADDR; break; + case 'f': + /* + * Unsupported, but can be forcibly implemented + * by removing the DUMPFILE() check above and + * recompiling. + */ + if (!pc->dumpfile) + error(FATAL, + "-f option requires a dumpfile\n"); + memtype &= ~(PHYSADDR|UVADDR|KVADDR); + memtype = FILEADDR; + break; + default: argerrs++; break; @@ -1363,6 +1392,9 @@ case PHYSADDR: break; + case FILEADDR: + break; + case AMBIGUOUS: error(INFO, "ambiguous address: %llx (requires -p, -u or -k)\n", @@ -1410,6 +1442,8 @@ raw_data_dump(ulong addr, long count, int symbolic) { long wordcnt; + ulonglong address; + int memtype; switch (sizeof(long)) { @@ -1429,9 +1463,20 @@ break; } - display_memory(addr, wordcnt, + if (pc->curcmd_flags & MEMTYPE_FILEADDR) { + address = pc->curcmd_private; + memtype = FILEADDR; + } else if (pc->curcmd_flags & MEMTYPE_UVADDR) { + address = (ulonglong)addr; + memtype = UVADDR; + } else { + address = (ulonglong)addr; + memtype = KVADDR; + } + + display_memory(address, wordcnt, HEXADECIMAL|DISPLAY_DEFAULT|(symbolic ? SYMBOLIC : ASCII_ENDLINE), - KVADDR); + memtype); } /* @@ -1452,7 +1497,7 @@ * is appropriate: * * addr a user, kernel or physical memory address. - * memtype addr type: UVADDR, KVADDR or PHYSADDR. + * memtype addr type: UVADDR, KVADDR, PHYSADDR, XENMACHADDR or FILEADDR * buffer supplied buffer to read the data into. * size number of bytes to read. * type string describing the request -- helpful when the read fails. @@ -1528,6 +1573,9 @@ case PHYSADDR: case XENMACHADDR: break; + + case FILEADDR: + return generic_read_dumpfile(addr, buffer, size, type, error_handle); } while (size > 0) { @@ -1874,6 +1922,9 @@ case XENMACHADDR: sprintf(membuf, debug ? "XENMACHADDR" : "xen machine"); break; + case FILEADDR: + sprintf(membuf, debug ? "FILEADDR" : "dumpfile"); + break; default: if (debug) sprintf(membuf, "0x%x (?)", memtype); @@ -1969,6 +2020,10 @@ case PHYSADDR: break; + + + case FILEADDR: + return generic_write_dumpfile(addr, buffer, size, type, error_handle); } while (size > 0) { @@ -2066,6 +2121,77 @@ } /* + * Generic dumpfile read/write functions to handle FILEADDR + * memtype arguments to readmem() and writemem(). These are + * not to be confused with pc->readmem/writemem plug-ins. + */ +static int +generic_read_dumpfile(ulonglong addr, void *buffer, long size, char *type, + ulong error_handle) +{ + int fd; + int retval; + + retval = TRUE; + + if (!pc->dumpfile) + error(FATAL, "command requires a dumpfile\n"); + + if ((fd = open(pc->dumpfile, O_RDONLY)) < 0) + error(FATAL, "%s: %s\n", pc->dumpfile, + strerror(errno)); + + if (lseek(fd, addr, SEEK_SET) == -1) { + if (PRINT_ERROR_MESSAGE) + error(INFO, SEEK_ERRMSG, + memtype_string(FILEADDR, 0), addr, type); + retval = FALSE; + } else if (read(fd, buffer, size) != size) { + if (PRINT_ERROR_MESSAGE) + error(INFO, READ_ERRMSG, + memtype_string(FILEADDR, 0), addr, type); + retval = FALSE; + } + + close(fd); + + return retval; +} + +static int +generic_write_dumpfile(ulonglong addr, void *buffer, long size, char *type, + ulong error_handle) +{ + int fd; + int retval; + + retval = TRUE; + + if (!pc->dumpfile) + error(FATAL, "command requires a dumpfile\n"); + + if ((fd = open(pc->dumpfile, O_WRONLY)) < 0) + error(FATAL, "%s: %s\n", pc->dumpfile, + strerror(errno)); + + if (lseek(fd, addr, SEEK_SET) == -1) { + if (PRINT_ERROR_MESSAGE) + error(INFO, SEEK_ERRMSG, + memtype_string(FILEADDR, 0), addr, type); + retval = FALSE; + } else if (write(fd, buffer, size) != size) { + if (PRINT_ERROR_MESSAGE) + error(INFO, WRITE_ERRMSG, + memtype_string(FILEADDR, 0), addr, type); + retval = FALSE; + } + + close(fd); + + return retval; +} + +/* * Translates a kernel virtual address to its physical address. cmd_vtop() * sets the verbose flag so that the pte translation gets displayed; all * other callers quietly accept the translation. @@ -3340,8 +3466,6 @@ if (pflag) { meminfo.spec_addr = value[i]; meminfo.flags = ADDRESS_SPECIFIED; - if (meminfo.calls++) - fprintf(fp, "\n"); dump_mem_map(&meminfo); pflag++; } @@ -3390,8 +3514,6 @@ if (vflag) { meminfo.spec_addr = value[i]; meminfo.flags = ADDRESS_SPECIFIED; - if (meminfo.calls++) - fprintf(fp, "\n"); dump_vmlist(&meminfo); vflag++; } @@ -3747,7 +3869,15 @@ * to the section with that page */ if (mi->flags & ADDRESS_SPECIFIED) { - ulong pfn = mi->spec_addr >> PAGESHIFT(); + ulong pfn; + physaddr_t tmp; + + if (pg_spec) { + if (!page_to_phys(mi->spec_addr, &tmp)) + return; + pfn = tmp >> PAGESHIFT(); + } else + pfn = mi->spec_addr >> PAGESHIFT(); section_nr = pfn_to_section_nr(pfn); } @@ -3768,8 +3898,10 @@ } if (print_hdr) { - fprintf(fp, "%s", hdr); + if (!(pc->curcmd_flags & HEADER_PRINTED)) + fprintf(fp, "%s", hdr); print_hdr = FALSE; + pc->curcmd_flags |= HEADER_PRINTED; } pp = section_mem_map_addr(section); @@ -4209,8 +4341,10 @@ for (n = 0; n < vt->numnodes; n++) { if (print_hdr) { - fprintf(fp, "%s%s", n ? "\n" : "", hdr); + if (!(pc->curcmd_flags & HEADER_PRINTED)) + fprintf(fp, "%s%s", n ? "\n" : "", hdr); print_hdr = FALSE; + pc->curcmd_flags |= HEADER_PRINTED; } nt = &vt->node_table[n]; @@ -6293,7 +6427,7 @@ count = 0; while (next) { - if ((next == vmlist) && + if (!(pc->curcmd_flags & HEADER_PRINTED) && (next == vmlist) && !(vi->flags & (GET_HIGHEST|GET_PHYS_TO_VMALLOC| GET_VMLIST_COUNT|GET_VMLIST))) { fprintf(fp, "%s ", @@ -6302,6 +6436,7 @@ fprintf(fp, "%s SIZE\n", mkstring(buf, (VADDR_PRLEN * 2) + strlen(" - "), CENTER|LJUST, "ADDRESS RANGE")); + pc->curcmd_flags |= HEADER_PRINTED; } readmem(next+OFFSET(vm_struct_addr), KVADDR, @@ -9910,6 +10045,33 @@ ulong ppstart, ppend; struct node_table *nt; ulong pgnum, node_size; + ulong nr, sec_addr; + ulong nr_mem_sections; + ulong coded_mem_map, mem_map, end_mem_map; + physaddr_t section_paddr; + + if (IS_SPARSEMEM()) { + nr_mem_sections = NR_MEM_SECTIONS(); + for (nr = 0; nr <= nr_mem_sections ; nr++) { + if ((sec_addr = valid_section_nr(nr))) { + coded_mem_map = section_mem_map_addr(sec_addr); + mem_map = sparse_decode_mem_map(coded_mem_map, nr); + end_mem_map = mem_map + (PAGES_PER_SECTION() * SIZE(page)); + + if ((addr >= mem_map) && (addr < end_mem_map)) { + if ((addr - mem_map) % SIZE(page)) + return FALSE; + if (phys) { + section_paddr = PTOB(section_nr_to_pfn(nr)); + pgnum = (addr - mem_map) / SIZE(page); + *phys = section_paddr + (pgnum * PAGESIZE()); + } + return TRUE; + } + } + } + return FALSE; + } for (n = 0; n < vt->numnodes; n++) { nt = &vt->node_table[n]; --- crash-4.0-3.18/filesys.c 2007-02-07 14:05:51.000000000 -0500 +++ crash-4.0-3.19/filesys.c 2007-02-07 11:47:04.000000000 -0500 @@ -1,8 +1,8 @@ /* filesys.c - core analysis suite * * Copyright (C) 1999, 2000, 2001, 2002 Mission Critical Linux, Inc. - * Copyright (C) 2002, 2003, 2004, 2005, 2006 David Anderson - * Copyright (C) 2002, 2003, 2004, 2005, 2006 Red Hat, Inc. All rights reserved. + * Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 David Anderson + * Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Red Hat, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -1107,7 +1107,6 @@ char *arglist[MAXARGS*2]; ulong vfsmount = 0; int flags = 0; - int mh_flag = 1; int save_next; namespace_context = pid_to_context(1); @@ -1183,9 +1182,9 @@ show_mounts(vfsmount, flags, namespace_context); } else { - if (mh_flag) { + if (!(pc->curcmd_flags & HEADER_PRINTED)) { fprintf(fp, mount_hdr); - mh_flag = 0; + pc->curcmd_flags |= HEADER_PRINTED; } fprintf(fp, buf2); } --- crash-4.0-3.18/help.c 2007-02-07 14:05:51.000000000 -0500 +++ crash-4.0-3.19/help.c 2007-02-06 12:05:17.000000000 -0500 @@ -1089,7 +1089,7 @@ char *help_rd[] = { "rd", "read memory", -"[-dDsupxm][-8|-16|-32|-64][-o offs][-e addr] [address|symbol] [count]", +"[-dDsupxmf][-8|-16|-32|-64][-o offs][-e addr] [address|symbol] [count]", " This command displays the contents of memory, with the output formatted", " in several different manners. The starting address may be entered either", " symbolically or by address. The default output size is the size of a long", @@ -1099,6 +1099,7 @@ " -u address argument is a user virtual address; only required on", " processors with common user and kernel virtual address spaces.", " -m address argument is a xen host machine address.", +" -f address argument is a dumpfile offset.", " -d display output in signed decimal format (default is hexadecimal).", " -D display output in unsigned decimal format (default is hexadecimal).", " -s displays output symbolically when appropriate.", @@ -1118,7 +1119,8 @@ " 3. -u specifies a user virtual address, but is only necessary on", " processors with common user and kernel virtual address spaces.", " symbol symbol of starting address to read.", -" count number of memory locations to display (default is 1).", +" count number of memory locations to display (default is 1); if entered,", +" must be the last argument on the command line.", "\nEXAMPLES", " Display the kernel_version string:\n", " %s> rd kernel_version 4 ", @@ -3042,7 +3044,7 @@ char *help_struct[] = { "struct", "structure contents", -"struct_name[.member[,member]] [-o][-l offset][-r] [address | symbol]\n" +"struct_name[.member[,member]][-o][-l offset][-rfu] [address | symbol]\n" " [count | -c count]", " This command displays either a structure definition, or a formatted display", " of the contents of a structure at a specified address. When no address is", @@ -3061,6 +3063,9 @@ " 1. in \"structure.member\" format.", " 2. a number of bytes. ", " -r raw dump of structure data.", +" -f address argument is a dumpfile offset.", +" -u address argument is a user virtual address in the current", +" context.", " address hexadecimal address of a structure; if the address points", " to an embedded list_head structure contained within the", " target data structure, then the \"-l\" option must be used.", @@ -3274,7 +3279,7 @@ char *help_union[] = { "union", "union contents", -"union_name[.member[,member]] [-o][-l offset][-r] [address | symbol]\n" +"union_name[.member[,member]] [-o][-l offset][-rfu] [address | symbol]\n" " [count | -c count]", " This command displays either a union definition, or a formatted display", " of the contents of a union at a specified address. When no address is", @@ -3294,6 +3299,9 @@ " 1. in \"structure.member\" format.", " 2. a number of bytes. ", " -r raw dump of union data.", +" -f address argument is a dumpfile offset.", +" -u address argument is a user virtual address in the current", +" context.", " address hexadecimal address of a union; if the address points", " to an embedded list_head structure contained within the", " target union structure, then the \"-l\" option must be used.", @@ -4267,9 +4275,9 @@ " routine up to and including the designated address.", " -l displays source code line number data in addition to the ", " disassembly output.", -" -u address is a user virtual address; otherwise the address is ", -" assumed to be a kernel virtual address. If this option is", -" used, then -r and -l are ignored.", +" -u address is a user virtual address in the current context;", +" otherwise the address is assumed to be a kernel virtual address.", +" If this option is used, then -r and -l are ignored.", " address starting hexadecimal text address.", " symbol symbol of starting text address. On PPC64, the symbol", " preceded by '.' is used.", --- crash-4.0-3.18/kernel.c 2007-02-07 14:05:51.000000000 -0500 +++ crash-4.0-3.19/kernel.c 2007-02-06 09:37:14.000000000 -0500 @@ -942,7 +942,7 @@ if (user_mode) { sprintf(buf1, "x/%ldi 0x%lx", req->count ? req->count : 1, req->addr); - pc->cmdgenspec = pc->cmdgencur; + pc->curcmd_flags |= MEMTYPE_UVADDR; gdb_pass_through(buf1, NULL, 0); return; } --- crash-4.0-3.18/gdb_interface.c 2007-02-07 14:05:51.000000000 -0500 +++ crash-4.0-3.19/gdb_interface.c 2007-02-07 10:49:44.000000000 -0500 @@ -1,8 +1,8 @@ /* gdb_interface.c - core analysis suite * * Copyright (C) 1999, 2000, 2001, 2002 Mission Critical Linux, Inc. - * Copyright (C) 2002, 2003, 2004, 2005, 2006 David Anderson - * Copyright (C) 2002, 2003, 2004, 2005, 2006 Red Hat, Inc. All rights reserved. + * Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 David Anderson + * Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Red Hat, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -740,8 +740,10 @@ if (pc->cur_req->flags & GNU_NO_READMEM) return TRUE; - if (UNIQUE_COMMAND("dis")) + if (pc->curcmd_flags & MEMTYPE_UVADDR) memtype = UVADDR; + else if (pc->curcmd_flags & MEMTYPE_FILEADDR) + memtype = FILEADDR; else if (!IS_KVADDR(addr)) { if (STREQ(pc->curcmd, "gdb") && STRNEQ(pc->cur_req->buf, "x/")) { @@ -758,12 +760,11 @@ if (CRASHDEBUG(1)) console("gdb_readmem_callback[%d]: %lx %d\n", memtype, addr, len); - -#ifdef OLDWAY - return(readmem(addr, KVADDR, buf, len, - "gdb_readmem_callback", RETURN_ON_ERROR)); -#endif + if (memtype == FILEADDR) + return(readmem(pc->curcmd_private, memtype, buf, len, + "gdb_readmem_callback", RETURN_ON_ERROR)); + switch (len) { case SIZEOF_8BIT: --- crash-4.0-3.18/x86.c 2007-02-07 14:05:51.000000000 -0500 +++ crash-4.0-3.19/x86.c 2007-02-02 14:20:33.000000000 -0500 @@ -4396,12 +4396,15 @@ sizeof(ctrlreg)) error(FATAL, "cannot read vcpu_guest_context ctrlreg[8]\n"); + mfn = (ctrlreg[3] >> PAGESHIFT()) | (ctrlreg[3] << (BITS()-PAGESHIFT())); + for (i = 0; CRASHDEBUG(1) && (i < 8); i++) { - fprintf(xd->ofp, "ctrlreg[%d]: %lx\n", i, ctrlreg[i]); + fprintf(xd->ofp, "ctrlreg[%d]: %lx", i, ctrlreg[i]); + if (i == 3) + fprintf(xd->ofp, " -> mfn: %lx", mfn); + fprintf(xd->ofp, "\n"); } - mfn = ctrlreg[3] >> PAGESHIFT(); - if (!xc_core_mfn_to_page(mfn, machdep->pgd)) error(FATAL, "cannot read/find cr3 page\n"); --- crash-4.0-3.18/symbols.c 2007-02-07 14:05:51.000000000 -0500 +++ crash-4.0-3.19/symbols.c 2007-02-06 12:00:49.000000000 -0500 @@ -4009,7 +4009,7 @@ list_head_offset = 0; argc_members = 0; - while ((c = getopt(argcnt, args, "c:rvol:")) != EOF) { + while ((c = getopt(argcnt, args, "fuc:rvol:")) != EOF) { switch (c) { case 'c': @@ -4040,6 +4040,17 @@ optarg); break; + case 'f': + if (!pc->dumpfile) + error(FATAL, + "-f option requires a dumpfile\n"); + pc->curcmd_flags |= MEMTYPE_FILEADDR; + break; + + case 'u': + pc->curcmd_flags |= MEMTYPE_UVADDR; + break; + default: argerrs++; break; @@ -4071,15 +4082,20 @@ count = stol(args[optind], FAULT_ON_ERROR, NULL); else { - if (!IS_KVADDR(addr = htol(args[optind], + if (pc->curcmd_flags & MEMTYPE_FILEADDR) + pc->curcmd_private = stoll(args[optind], + FAULT_ON_ERROR, NULL); + else if (pc->curcmd_flags & MEMTYPE_UVADDR) { + addr = htol(args[optind], FAULT_ON_ERROR, + NULL); + } else if (!IS_KVADDR(addr = htol(args[optind], FAULT_ON_ERROR, NULL))) error(FATAL, "invalid kernel virtual address: %s\n", args[optind]); aflag++; } - } - else if ((sp = symbol_search(args[optind]))) { + } else if ((sp = symbol_search(args[optind]))) { addr = sp->value; aflag++; } else { @@ -4140,7 +4156,10 @@ addr += len; } - for (c = 0; c < abs(count); c++, addr += len) { + if (pc->curcmd_flags & MEMTYPE_FILEADDR) + addr = 0; /* unused, but parsed by gdb */ + + for (c = 0; c < abs(count); c++, addr += len, pc->curcmd_private += len) { if (c) fprintf(fp,"\n"); --- crash-4.0-3.18/cmdline.c 2007-02-07 14:05:51.000000000 -0500 +++ crash-4.0-3.19/cmdline.c 2007-02-06 10:07:27.000000000 -0500 @@ -929,6 +929,7 @@ pc->pipe_shell_pid = 0; pc->sbrk = sbrk(0); pc->curcmd_flags = 0; + pc->curcmd_private = 0; restore_gdb_sanity(); --- crash-4.0-3.18/defs.h 2007-02-07 14:05:51.000000000 -0500 +++ crash-4.0-3.19/defs.h 2007-02-07 12:08:23.000000000 -0500 @@ -352,12 +352,15 @@ char *curcmd; /* currently-executing command */ char *lastcmd; /* previously-executed command */ ulong cmdgencur; /* current command generation number */ - ulong cmdgenspec; /* specified command generation num */ ulong curcmd_flags; /* general purpose per-command flag */ -#define XEN_MACHINE_ADDR (0x1) -#define REPEAT (0x2) -#define IDLE_TASK_SHOWN (0x4) -#define TASK_SPECIFIED (0x8) +#define XEN_MACHINE_ADDR (0x1) +#define REPEAT (0x2) +#define IDLE_TASK_SHOWN (0x4) +#define TASK_SPECIFIED (0x8) +#define MEMTYPE_UVADDR (0x10) +#define MEMTYPE_FILEADDR (0x20) +#define HEADER_PRINTED (0x40) + ulonglong curcmd_private; /* general purpose per-command info */ int cur_gdb_cmd; /* current gdb command */ int last_gdb_cmd; /* previously-executed gdb command */ int sigint_cnt; /* number of ignored SIGINTs */ @@ -379,9 +382,6 @@ int (*writemem)(int, void *, int, ulong, physaddr_t);/* memory access */ }; -#define UNIQUE_COMMAND(s) \ - (STREQ(pc->curcmd, s) && (pc->cmdgencur == pc->cmdgenspec)) - #define READMEM pc->readmem typedef void (*cmd_func_t)(void); @@ -1841,6 +1841,7 @@ #define UVADDR (0x2) #define PHYSADDR (0x4) #define XENMACHADDR (0x8) +#define FILEADDR (0x10) #define AMBIGUOUS (~0) #define USE_USER_PGD (UVADDR << 2)