===== arch/ppc64/xmon/xmon.c 1.35 vs edited ===== --- 1.35/arch/ppc64/xmon/xmon.c Sun Feb 15 15:23:37 2004 +++ edited/arch/ppc64/xmon/xmon.c Tue Feb 24 14:25:34 2004 @@ -83,6 +83,7 @@ static void dump(void); static void prdump(unsigned long, long); static int ppc_inst_dump(unsigned long, long); +static void lookupsymbol(void); void print_address(unsigned long); static int getsp(void); static void backtrace(struct pt_regs *); @@ -167,6 +168,7 @@ ml locate a block of memory\n\ mz zero a block of memory\n\ mi show information about memory allocation\n\ + n lookup address -> symbol name\n\ p show the task list\n\ r print registers\n\ s single step\n\ @@ -537,6 +539,9 @@ case 'd': dump(); break; + case 'n': + lookupsymbol(); + break; case 'r': if (excp != NULL) prregs(excp); /* print regs */ @@ -1644,6 +1649,23 @@ printf("0x%lx", addr); } + +void +lookupsymbol(void) +{ + int c; + + c = inchar(); + if (c == '\n') + termch = c; + scanhex((void *)&adrs); + if( termch != '\n') + termch = 0; + printf("%016lx: ", adrs); + xmon_print_symbol("%s\n", adrs); +} + + /* * Memory operations - move, set, print differences */ @@ -1820,6 +1842,14 @@ } printf("invalid register name '%%%s'\n", regname); return 0; + } + + /* skip leading "0x" if any */ + + if (c == '0') { + c = inchar(); + if (c == 'x') + c = inchar(); } d = hexdigit(c);