aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/debug/kdb/kdb_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/debug/kdb/kdb_main.c')
-rw-r--r--kernel/debug/kdb/kdb_main.c35
1 files changed, 10 insertions, 25 deletions
diff --git a/kernel/debug/kdb/kdb_main.c b/kernel/debug/kdb/kdb_main.c
index bb4fe4e1a601..d72b32c66f7d 100644
--- a/kernel/debug/kdb/kdb_main.c
+++ b/kernel/debug/kdb/kdb_main.c
@@ -1192,7 +1192,7 @@ static int kdb_local(kdb_reason_t reason, int error, struct pt_regs *regs,
1192 if (reason == KDB_REASON_DEBUG) { 1192 if (reason == KDB_REASON_DEBUG) {
1193 /* special case below */ 1193 /* special case below */
1194 } else { 1194 } else {
1195 kdb_printf("\nEntering kdb (current=0x%p, pid %d) ", 1195 kdb_printf("\nEntering kdb (current=0x%px, pid %d) ",
1196 kdb_current, kdb_current ? kdb_current->pid : 0); 1196 kdb_current, kdb_current ? kdb_current->pid : 0);
1197#if defined(CONFIG_SMP) 1197#if defined(CONFIG_SMP)
1198 kdb_printf("on processor %d ", raw_smp_processor_id()); 1198 kdb_printf("on processor %d ", raw_smp_processor_id());
@@ -1208,7 +1208,7 @@ static int kdb_local(kdb_reason_t reason, int error, struct pt_regs *regs,
1208 */ 1208 */
1209 switch (db_result) { 1209 switch (db_result) {
1210 case KDB_DB_BPT: 1210 case KDB_DB_BPT:
1211 kdb_printf("\nEntering kdb (0x%p, pid %d) ", 1211 kdb_printf("\nEntering kdb (0x%px, pid %d) ",
1212 kdb_current, kdb_current->pid); 1212 kdb_current, kdb_current->pid);
1213#if defined(CONFIG_SMP) 1213#if defined(CONFIG_SMP)
1214 kdb_printf("on processor %d ", raw_smp_processor_id()); 1214 kdb_printf("on processor %d ", raw_smp_processor_id());
@@ -1493,6 +1493,7 @@ static void kdb_md_line(const char *fmtstr, unsigned long addr,
1493 char cbuf[32]; 1493 char cbuf[32];
1494 char *c = cbuf; 1494 char *c = cbuf;
1495 int i; 1495 int i;
1496 int j;
1496 unsigned long word; 1497 unsigned long word;
1497 1498
1498 memset(cbuf, '\0', sizeof(cbuf)); 1499 memset(cbuf, '\0', sizeof(cbuf));
@@ -1538,25 +1539,9 @@ static void kdb_md_line(const char *fmtstr, unsigned long addr,
1538 wc.word = word; 1539 wc.word = word;
1539#define printable_char(c) \ 1540#define printable_char(c) \
1540 ({unsigned char __c = c; isascii(__c) && isprint(__c) ? __c : '.'; }) 1541 ({unsigned char __c = c; isascii(__c) && isprint(__c) ? __c : '.'; })
1541 switch (bytesperword) { 1542 for (j = 0; j < bytesperword; j++)
1542 case 8:
1543 *c++ = printable_char(*cp++); 1543 *c++ = printable_char(*cp++);
1544 *c++ = printable_char(*cp++); 1544 addr += bytesperword;
1545 *c++ = printable_char(*cp++);
1546 *c++ = printable_char(*cp++);
1547 addr += 4;
1548 case 4:
1549 *c++ = printable_char(*cp++);
1550 *c++ = printable_char(*cp++);
1551 addr += 2;
1552 case 2:
1553 *c++ = printable_char(*cp++);
1554 addr++;
1555 case 1:
1556 *c++ = printable_char(*cp++);
1557 addr++;
1558 break;
1559 }
1560#undef printable_char 1545#undef printable_char
1561 } 1546 }
1562 } 1547 }
@@ -2048,7 +2033,7 @@ static int kdb_lsmod(int argc, const char **argv)
2048 if (mod->state == MODULE_STATE_UNFORMED) 2033 if (mod->state == MODULE_STATE_UNFORMED)
2049 continue; 2034 continue;
2050 2035
2051 kdb_printf("%-20s%8u 0x%p ", mod->name, 2036 kdb_printf("%-20s%8u 0x%px ", mod->name,
2052 mod->core_layout.size, (void *)mod); 2037 mod->core_layout.size, (void *)mod);
2053#ifdef CONFIG_MODULE_UNLOAD 2038#ifdef CONFIG_MODULE_UNLOAD
2054 kdb_printf("%4d ", module_refcount(mod)); 2039 kdb_printf("%4d ", module_refcount(mod));
@@ -2059,7 +2044,7 @@ static int kdb_lsmod(int argc, const char **argv)
2059 kdb_printf(" (Loading)"); 2044 kdb_printf(" (Loading)");
2060 else 2045 else
2061 kdb_printf(" (Live)"); 2046 kdb_printf(" (Live)");
2062 kdb_printf(" 0x%p", mod->core_layout.base); 2047 kdb_printf(" 0x%px", mod->core_layout.base);
2063 2048
2064#ifdef CONFIG_MODULE_UNLOAD 2049#ifdef CONFIG_MODULE_UNLOAD
2065 { 2050 {
@@ -2341,7 +2326,7 @@ void kdb_ps1(const struct task_struct *p)
2341 return; 2326 return;
2342 2327
2343 cpu = kdb_process_cpu(p); 2328 cpu = kdb_process_cpu(p);
2344 kdb_printf("0x%p %8d %8d %d %4d %c 0x%p %c%s\n", 2329 kdb_printf("0x%px %8d %8d %d %4d %c 0x%px %c%s\n",
2345 (void *)p, p->pid, p->parent->pid, 2330 (void *)p, p->pid, p->parent->pid,
2346 kdb_task_has_cpu(p), kdb_process_cpu(p), 2331 kdb_task_has_cpu(p), kdb_process_cpu(p),
2347 kdb_task_state_char(p), 2332 kdb_task_state_char(p),
@@ -2354,7 +2339,7 @@ void kdb_ps1(const struct task_struct *p)
2354 } else { 2339 } else {
2355 if (KDB_TSK(cpu) != p) 2340 if (KDB_TSK(cpu) != p)
2356 kdb_printf(" Error: does not match running " 2341 kdb_printf(" Error: does not match running "
2357 "process table (0x%p)\n", KDB_TSK(cpu)); 2342 "process table (0x%px)\n", KDB_TSK(cpu));
2358 } 2343 }
2359 } 2344 }
2360} 2345}
@@ -2687,7 +2672,7 @@ int kdb_register_flags(char *cmd,
2687 for_each_kdbcmd(kp, i) { 2672 for_each_kdbcmd(kp, i) {
2688 if (kp->cmd_name && (strcmp(kp->cmd_name, cmd) == 0)) { 2673 if (kp->cmd_name && (strcmp(kp->cmd_name, cmd) == 0)) {
2689 kdb_printf("Duplicate kdb command registered: " 2674 kdb_printf("Duplicate kdb command registered: "
2690 "%s, func %p help %s\n", cmd, func, help); 2675 "%s, func %px help %s\n", cmd, func, help);
2691 return 1; 2676 return 1;
2692 } 2677 }
2693 } 2678 }