Changeset e2b762ec in mainline
- Timestamp:
- 2009-03-16T21:58:05Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f36c061
- Parents:
- d9167a1c
- Files:
-
- 22 edited
Legend:
- Unmodified
- Added
- Removed
-
HelenOS.config
rd9167a1c re2b762ec 318 318 ! CONFIG_KCONSOLE (y/n) 319 319 320 % Kernel symbol information 321 ! CONFIG_SYMTAB (y/n) 322 320 323 % Detailed kernel logging 321 324 ! CONFIG_LOG (n/y) -
defaults/amd64/Makefile.config
rd9167a1c re2b762ec 29 29 CONFIG_KCONSOLE = y 30 30 31 # Kernel symbol information 32 CONFIG_SYMTAB = y 33 31 34 # Detailed kernel logging 32 35 CONFIG_LOG = n -
defaults/arm32/Makefile.config
rd9167a1c re2b762ec 17 17 CONFIG_KCONSOLE = y 18 18 19 # Kernel symbol information 20 CONFIG_SYMTAB = y 21 19 22 # Detailed kernel logging 20 23 CONFIG_LOG = n -
defaults/ia32/Makefile.config
rd9167a1c re2b762ec 35 35 CONFIG_KCONSOLE = y 36 36 37 # Kernel symbol information 38 CONFIG_SYMTAB = y 39 37 40 # Detailed kernel logging 38 41 CONFIG_LOG = n -
defaults/ia64/Makefile.config
rd9167a1c re2b762ec 29 29 CONFIG_KCONSOLE = y 30 30 31 # Kernel symbol information 32 CONFIG_SYMTAB = y 33 31 34 # Detailed kernel logging 32 35 CONFIG_LOG = n -
defaults/mips32/Makefile.config
rd9167a1c re2b762ec 23 23 CONFIG_KCONSOLE = y 24 24 25 # Kernel symbol information 26 CONFIG_SYMTAB = y 27 25 28 # Detailed kernel logging 26 29 CONFIG_LOG = n -
defaults/ppc32/Makefile.config
rd9167a1c re2b762ec 17 17 CONFIG_KCONSOLE = y 18 18 19 # Kernel symbol information 20 CONFIG_SYMTAB = y 21 19 22 # Detailed kernel logging 20 23 CONFIG_LOG = n -
defaults/sparc64/Makefile.config
rd9167a1c re2b762ec 32 32 CONFIG_KCONSOLE = y 33 33 34 # Kernel symbol information 35 CONFIG_SYMTAB = y 36 34 37 # Detailed kernel logging 35 38 CONFIG_LOG = n -
kernel/Makefile
rd9167a1c re2b762ec 196 196 generic/src/printf/vsprintf.c \ 197 197 generic/src/printf/vsnprintf.c \ 198 generic/src/debug/symtab.c \199 198 generic/src/time/clock.c \ 200 199 generic/src/time/timeout.c \ … … 225 224 generic/src/console/kconsole.c \ 226 225 generic/src/console/cmd.c 226 endif 227 228 ## Kernel symbol information 229 # 230 231 ifeq ($(CONFIG_SYMTAB),y) 232 GENERIC_SOURCES += \ 233 generic/src/debug/symtab.c 227 234 endif 228 235 … … 322 329 GENARCH_OBJECTS := $(addsuffix .o,$(basename $(GENARCH_SOURCES))) 323 330 331 ifeq ($(CONFIG_SYMTAB),y) 332 SYMTAB_OBJECTS := generic/src/debug/real_map.o 333 else 334 SYMTAB_OBJECTS := 335 endif 336 324 337 .PHONY: all build clean archlinks depend disasm 325 338 … … 364 377 echo $(SYMTAB_SECTION)" .incbin \"$<\"" | $(AS) $(AFLAGS) -o $@ 365 378 366 kernel.raw: depend arch/$(KARCH)/_link.ld $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) generic/src/debug/real_map.o367 $(LD) -T arch/$(KARCH)/_link.ld $(LFLAGS) $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) $(EXTRA_OBJECTS) generic/src/debug/real_map.o-o $@ -Map kernel.map379 kernel.raw: depend arch/$(KARCH)/_link.ld $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) $(SYMTAB_OBJECTS) 380 $(LD) -T arch/$(KARCH)/_link.ld $(LFLAGS) $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) $(EXTRA_OBJECTS) $(SYMTAB_OBJECTS) -o $@ -Map kernel.map 368 381 369 382 kernel.bin: kernel.raw -
kernel/arch/amd64/src/debugger.c
rd9167a1c re2b762ec 36 36 #include <console/kconsole.h> 37 37 #include <console/cmd.h> 38 #include <symtab.h>39 38 #include <print.h> 40 39 #include <panic.h> … … 45 44 #include <func.h> 46 45 #include <smp/ipi.h> 46 47 #ifdef CONFIG_SYMTAB 48 #include <symtab.h> 49 #endif 47 50 48 51 typedef struct { … … 230 233 } 231 234 } 235 236 #ifdef CONFIG_SYMTAB 232 237 printf("Reached breakpoint %d:%lx(%s)\n", slot, getip(istate), 233 238 get_symtab_entry(getip(istate))); 239 #else 240 printf("Reached breakpoint %d:%lx\n", slot, getip(istate)); 241 #endif 234 242 235 243 #ifdef CONFIG_KCONSOLE … … 356 364 for (i = 0; i < BKPOINTS_MAX; i++) 357 365 if (breakpoints[i].address) { 366 #ifdef CONFIG_SYMTAB 358 367 symbol = get_symtab_entry(breakpoints[i].address); 368 #else 369 symbol = "n/a"; 370 #endif 359 371 360 372 #ifdef __32_BITS__ -
kernel/arch/amd64/src/interrupt.c
rd9167a1c re2b762ec 44 44 #include <mm/as.h> 45 45 #include <arch.h> 46 #include <symtab.h>47 46 #include <arch/asm.h> 48 47 #include <proc/scheduler.h> … … 54 53 #include <ddi/irq.h> 55 54 55 #ifdef CONFIG_SYMTAB 56 #include <symtab.h> 57 #endif 58 56 59 /* 57 60 * Interrupt and exception dispatching. … … 67 70 /* uint64_t *x = &istate->stack[0]; */ 68 71 72 #ifdef CONFIG_SYMTAB 69 73 if (!(symbol = get_symtab_entry(istate->rip))) 70 74 symbol = ""; 75 #else 76 symbol = ""; 77 #endif 71 78 72 79 printf("-----EXCEPTION(%d) OCCURED----- ( %s )\n", n, __func__); -
kernel/arch/ia32/src/interrupt.c
rd9167a1c re2b762ec 45 45 #include <mm/as.h> 46 46 #include <arch.h> 47 #include <symtab.h>48 47 #include <proc/thread.h> 49 48 #include <proc/task.h> … … 54 53 #include <ddi/irq.h> 55 54 55 #ifdef CONFIG_SYMTAB 56 #include <symtab.h> 57 #endif 58 56 59 /* 57 60 * Interrupt and exception dispatching. … … 64 67 void decode_istate(istate_t *istate) 65 68 { 66 char *symbol = get_symtab_entry(istate->eip); 67 69 char *symbol; 70 71 #ifdef CONFIG_SYMTAB 72 symbol = get_symtab_entry(istate->eip); 68 73 if (!symbol) 69 74 symbol = ""; 75 #else 76 symbol = ""; 77 #endif 70 78 71 79 if (CPU) -
kernel/arch/ia64/src/interrupt.c
rd9167a1c re2b762ec 39 39 #include <panic.h> 40 40 #include <print.h> 41 #include <symtab.h>42 41 #include <debug.h> 43 42 #include <console/console.h> … … 56 55 #include <mm/tlb.h> 57 56 57 #ifdef CONFIG_SYMTAB 58 #include <symtab.h> 59 #endif 60 58 61 #define VECTORS_64_BUNDLE 20 59 62 #define VECTORS_16_BUNDLE 48 … … 138 141 char *ifa, *iipa, *iip; 139 142 143 #ifdef CONFIG_SYMTAB 140 144 ifa = get_symtab_entry(istate->cr_ifa); 141 145 iipa = get_symtab_entry(istate->cr_iipa); 142 146 iip = get_symtab_entry(istate->cr_iip); 147 #else 148 ifa = iipa = iip = "n/a"; 149 #endif 143 150 144 151 putchar('\n'); -
kernel/arch/mips32/src/debugger.c
rd9167a1c re2b762ec 38 38 #include <console/kconsole.h> 39 39 #include <console/cmd.h> 40 #include <symtab.h>41 40 #include <print.h> 42 41 #include <panic.h> … … 44 43 #include <arch/cp0.h> 45 44 #include <func.h> 45 46 #ifdef CONFIG_SYMTAB 47 #include <symtab.h> 48 #endif 46 49 47 50 bpinfo_t breakpoints[BKPOINTS_MAX]; … … 260 263 for (i = 0; i < BKPOINTS_MAX; i++) 261 264 if (breakpoints[i].address) { 265 #ifdef CONFIG_SYMTAB 262 266 symbol = get_symtab_entry(breakpoints[i].address); 267 #else 268 symbol = "n/a"; 269 #endif 263 270 264 271 printf("%-2u %-5d %#10zx %-6s %-7s %-8s %s\n", i, … … 349 356 printf("Warning: breakpoint recursion\n"); 350 357 351 if (!(cur->flags & BKPOINT_FUNCCALL)) 358 if (!(cur->flags & BKPOINT_FUNCCALL)) { 359 #ifdef CONFIG_SYMTAB 352 360 printf("***Breakpoint %d: %p in %s.\n", i, fireaddr, 353 361 get_symtab_entry(istate->epc)); 362 #else 363 printf("***Breakpoint %d: %p.\n", i, fireaddr); 364 #endif 365 } 354 366 355 367 /* Return first instruction back */ … … 364 376 cur->flags |= BKPOINT_INPROG; 365 377 } else { 366 printf("***Breakpoint %p in %s.\n", fireaddr, 378 #ifdef CONFIG_SYMTAB 379 printf("***Breakpoint %p in %s.\n", fireaddr, 367 380 get_symtab_entry(fireaddr)); 381 #else 382 printf("***Breakpoint %p.\n", fireaddr); 383 #endif 368 384 /* Move on to next instruction */ 369 385 istate->epc += 4; -
kernel/arch/mips32/src/exception.c
rd9167a1c re2b762ec 42 42 #include <debug.h> 43 43 #include <proc/thread.h> 44 #include <symtab.h>45 44 #include <print.h> 46 45 #include <interrupt.h> … … 48 47 #include <ddi/irq.h> 49 48 #include <arch/debugger.h> 49 50 #ifdef CONFIG_SYMTAB 51 #include <symtab.h> 52 #endif 50 53 51 54 static char * exctable[] = { … … 77 80 char *rasymbol = ""; 78 81 82 #ifdef CONFIG_SYMTAB 79 83 char *s = get_symtab_entry(istate->epc); 80 84 if (s) … … 83 87 if (s) 84 88 rasymbol = s; 89 #endif 85 90 86 91 printf("PC: %#x(%s) RA: %#x(%s), SP(%p)\n", istate->epc, pcsymbol, istate->ra, rasymbol, istate->sp); -
kernel/arch/mips32/src/mm/tlb.c
rd9167a1c re2b762ec 41 41 #include <panic.h> 42 42 #include <arch.h> 43 #include <symtab.h>44 43 #include <synch/mutex.h> 45 44 #include <print.h> … … 47 46 #include <align.h> 48 47 #include <interrupt.h> 48 49 #ifdef CONFIG_SYMTAB 50 #include <symtab.h> 51 #endif 49 52 50 53 static void tlb_refill_fail(istate_t *); … … 324 327 char *sym2 = ""; 325 328 329 #ifdef CONFIG_SYMTAB 326 330 char *s = get_symtab_entry(istate->epc); 327 331 if (s) … … 330 334 if (s) 331 335 sym2 = s; 336 #endif 332 337 333 338 fault_if_from_uspace(istate, "TLB Refill Exception on %p.", … … 342 347 char *symbol = ""; 343 348 349 #ifdef CONFIG_SYMTAB 344 350 char *s = get_symtab_entry(istate->epc); 345 351 if (s) 346 352 symbol = s; 353 #endif 354 347 355 fault_if_from_uspace(istate, "TLB Invalid Exception on %p.", 348 356 cp0_badvaddr_read()); … … 355 363 char *symbol = ""; 356 364 365 #ifdef CONFIG_SYMTAB 357 366 char *s = get_symtab_entry(istate->epc); 358 367 if (s) 359 368 symbol = s; 369 #endif 370 360 371 fault_if_from_uspace(istate, "TLB Modified Exception on %p.", 361 372 cp0_badvaddr_read()); -
kernel/arch/ppc32/src/mm/tlb.c
rd9167a1c re2b762ec 40 40 #include <arch.h> 41 41 #include <print.h> 42 #include <macros.h> 43 44 #ifdef CONFIG_SYMTAB 42 45 #include <symtab.h> 43 #include <macros.h> 44 46 #endif 45 47 46 48 static unsigned int seed = 10; … … 122 124 char *sym2 = ""; 123 125 126 #ifdef CONFIG_SYMTAB 124 127 char *str = get_symtab_entry(istate->pc); 125 128 if (str) … … 128 131 if (str) 129 132 sym2 = str; 133 #endif 130 134 131 135 fault_if_from_uspace(istate, -
kernel/arch/sparc64/src/trap/exception.c
rd9167a1c re2b762ec 41 41 #include <arch/register.h> 42 42 #include <debug.h> 43 #include <print.h> 44 45 #ifdef CONFIG_SYMTAB 43 46 #include <symtab.h> 44 # include <print.h>47 #endif 45 48 46 49 void dump_istate(istate_t *istate) 47 50 { 51 char *tpcs, *tnpcs; 52 53 #ifdef CONFIG_SYMTAB 54 tpcs = get_symtab_entry(istate->tpc); 55 tnpcs = get_symtab_entry(istate->tnpc); 56 #else 57 tpcs = tnpcs = "n/a"; 58 #endif 48 59 printf("TSTATE=%#" PRIx64 "\n", istate->tstate); 49 printf("TPC=%#" PRIx64 " (%s)\n", istate->tpc, get_symtab_entry(istate->tpc));50 printf("TNPC=%#" PRIx64 " (%s)\n", istate->tnpc, get_symtab_entry(istate->tnpc));60 printf("TPC=%#" PRIx64 " (%s)\n", istate->tpc, tpcs); 61 printf("TNPC=%#" PRIx64 " (%s)\n", istate->tnpc, tnpcs); 51 62 } 52 63 -
kernel/generic/src/console/cmd.c
rd9167a1c re2b762ec 54 54 #include <macros.h> 55 55 #include <debug.h> 56 #include <symtab.h>57 56 #include <cpu.h> 58 57 #include <mm/tlb.h> … … 67 66 #include <ipc/irq.h> 68 67 68 #ifdef CONFIG_SYMTAB 69 #include <symtab.h> 70 #endif 71 69 72 #ifdef CONFIG_TEST 70 73 #include <test.h> … … 168 171 }; 169 172 173 #ifdef CONFIG_SYMTAB 170 174 /* Data and methods for 'symaddr' command. */ 171 175 static int cmd_symaddr(cmd_arg_t *argv); … … 183 187 .argv = &symaddr_argv 184 188 }; 189 #endif 185 190 186 191 static char set_buf[MAX_CMDLINE+1]; … … 459 464 &set4_info, 460 465 &slabs_info, 466 #ifdef CONFIG_SYMTAB 461 467 &symaddr_info, 468 #endif 462 469 &sched_info, 463 470 &threads_info, … … 606 613 } 607 614 615 #ifdef CONFIG_SYMTAB 616 608 617 /** Search symbol table */ 609 618 int cmd_symaddr(cmd_arg_t *argv) … … 614 623 } 615 624 625 #endif 626 616 627 /** Call function with zero parameters */ 617 628 int cmd_call0(cmd_arg_t *argv) 618 629 { 630 #ifdef CONFIG_SYMTAB 619 631 uintptr_t symaddr; 620 char *symbol;621 632 unative_t (*fnc)(void); 622 633 fncptr_t fptr; 623 634 624 635 symaddr = get_symbol_addr((char *) argv->buffer); 625 636 if (!symaddr) … … 629 640 printf("Duplicate symbol, be more specific.\n"); 630 641 } else { 631 symbol = get_symtab_entry(symaddr);632 642 fnc = (unative_t (*)(void)) arch_construct_function(&fptr, (void *) symaddr, (void *) cmd_call0); 633 printf("Calling %s() (%p)\n", symbol, symaddr);643 printf("Calling %s() (%p)\n", argv->buffer, symaddr); 634 644 printf("Result: %#" PRIxn "\n", fnc()); 635 645 } 636 646 #endif 637 647 return 1; 638 648 } … … 670 680 int cmd_call1(cmd_arg_t *argv) 671 681 { 682 #ifdef CONFIG_SYMTAB 672 683 uintptr_t symaddr; 673 684 char *symbol; … … 677 688 678 689 symaddr = get_symbol_addr((char *) argv->buffer); 690 679 691 if (!symaddr) 680 692 printf("Symbol %s not found.\n", argv->buffer); … … 688 700 printf("Result: %#" PRIxn "\n", fnc(arg1)); 689 701 } 690 702 #endif 691 703 return 1; 692 704 } … … 695 707 int cmd_call2(cmd_arg_t *argv) 696 708 { 709 #ifdef CONFIG_SYMTAB 697 710 uintptr_t symaddr; 698 711 char *symbol; … … 714 727 arg1, arg2, symaddr, symbol); 715 728 printf("Result: %#" PRIxn "\n", fnc(arg1, arg2)); 716 } 717 729 } 730 #endif 718 731 return 1; 719 732 } … … 722 735 int cmd_call3(cmd_arg_t *argv) 723 736 { 737 #ifdef CONFIG_SYMTAB 724 738 uintptr_t symaddr; 725 739 char *symbol; … … 743 757 printf("Result: %#" PRIxn "\n", fnc(arg1, arg2, arg3)); 744 758 } 745 759 #endif 746 760 return 1; 747 761 } … … 798 812 799 813 if (((char *)argv->buffer)[0] == '*') { 814 #ifdef CONFIG_SYMTAB 800 815 addr = (uint32_t *) get_symbol_addr((char *) argv->buffer + 1); 816 #else 817 addr = 0; 818 #endif 801 819 pointer = true; 802 820 } else if (((char *) argv->buffer)[0] >= '0' && 803 ((char *)argv->buffer)[0] <= '9') 821 ((char *)argv->buffer)[0] <= '9') { 804 822 addr = (uint32_t *)atoi((char *)argv->buffer); 805 else 823 } else { 824 #ifdef CONFIG_SYMTAB 806 825 addr = (uint32_t *)get_symbol_addr((char *) argv->buffer); 826 #else 827 addr = 0; 828 #endif 829 } 807 830 808 831 if (!addr) 809 832 printf("Symbol %s not found.\n", argv->buffer); 810 833 else if (addr == (uint32_t *) -1) { 834 #ifdef CONFIG_SYMTAB 811 835 symtab_print_search((char *) argv->buffer); 836 #endif 812 837 printf("Duplicate symbol, be more specific.\n"); 813 838 } else { -
kernel/generic/src/console/kconsole.c
rd9167a1c re2b762ec 51 51 #include <func.h> 52 52 #include <string.h> 53 #include <symtab.h>54 53 #include <macros.h> 55 54 #include <sysinfo/sysinfo.h> 56 55 #include <ddi/device.h> 56 57 #ifdef CONFIG_SYMTAB 58 #include <symtab.h> 59 #endif 57 60 58 61 /** Simple kernel console. … … 259 262 static int cmdtab_compl(char *name) 260 263 { 261 static char output[ MAX_SYMBOL_NAME+ 1];264 static char output[/*MAX_SYMBOL_NAME*/128 + 1]; 262 265 link_t *startpos = NULL; 263 266 const char *foundtxt; … … 291 294 } 292 295 } 293 strncpy(name, output, MAX_SYMBOL_NAME);296 strncpy(name, output, 128/*MAX_SYMBOL_NAME*/); 294 297 return found; 295 296 298 } 297 299 … … 348 350 found = cmdtab_compl(tmp); 349 351 } else { /* Symtab completion */ 352 #ifdef CONFIG_SYMTAB 350 353 found = symtab_compl(tmp); 354 #else 355 found = 0; 356 #endif 351 357 } 352 358 … … 516 522 static int parse_int_arg(char *text, size_t len, unative_t *result) 517 523 { 518 static char symname[MAX_SYMBOL_NAME];519 524 uintptr_t symaddr; 520 525 bool isaddr = false; 521 526 bool isptr = false; 527 528 #ifdef CONFIG_SYMTAB 529 static char symname[MAX_SYMBOL_NAME]; 530 #endif 522 531 523 532 /* If we get a name, try to find it in symbol table */ … … 532 541 } 533 542 if (text[0] < '0' || text[0] > '9') { 543 #ifdef CONFIG_SYMTAB 534 544 strncpy(symname, text, min(len + 1, MAX_SYMBOL_NAME)); 535 545 symaddr = get_symbol_addr(symname); … … 543 553 return -1; 544 554 } 555 #else 556 symaddr = 0; 557 #endif 545 558 if (isaddr) 546 559 *result = (unative_t)symaddr; -
kernel/generic/src/interrupt/interrupt.c
rd9167a1c re2b762ec 46 46 #include <panic.h> 47 47 #include <print.h> 48 49 #ifdef CONFIG_SYMTAB 48 50 #include <symtab.h> 51 #endif 49 52 50 53 static struct { … … 131 134 132 135 for (i = 0; i < IVT_ITEMS; i++) { 136 #ifdef CONFIG_SYMTAB 133 137 symbol = get_symtab_entry((unative_t) exc_table[i].f); 134 138 if (!symbol) 135 139 symbol = "not found"; 140 #else 141 symbol = "n/a"; 142 #endif 136 143 137 144 #ifdef __32_BITS__ -
kernel/generic/src/synch/spinlock.c
rd9167a1c re2b762ec 43 43 #include <print.h> 44 44 #include <debug.h> 45 46 #ifdef CONFIG_SYMTAB 45 47 #include <symtab.h> 48 #endif 46 49 47 50 #ifdef CONFIG_FB … … 77 80 { 78 81 count_t i = 0; 82 bool deadlock_reported = false; 83 #ifdef CONFIG_SYMTAB 79 84 char *symbol; 80 bool deadlock_reported = false; 85 #endif 81 86 82 87 preemption_disable(); … … 109 114 printf("cpu%u: looping on spinlock %" PRIp ":%s, caller=%" PRIp, 110 115 CPU->id, sl, sl->name, CALLER); 116 #ifdef CONFIG_SYMTAB 111 117 symbol = get_symtab_entry(CALLER); 112 118 if (symbol) 113 119 printf("(%s)", symbol); 120 #endif 114 121 printf("\n"); 115 122 i = 0;
Note:
See TracChangeset
for help on using the changeset viewer.