Changeset e16e0d59 in mainline for kernel/arch


Ignore:
Timestamp:
2009-03-17T20:33:18Z (17 years ago)
Author:
Jiri Svoboda <jirik.svoboda@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
5eb90cb
Parents:
b1c8dc0
Message:

Make optionality of symbol information less intrusive per Jakub's request. Also, improve symtab function names and update their semantics.

Location:
kernel/arch
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/amd64/src/debugger.c

    rb1c8dc0 re16e0d59  
    4444#include <func.h>
    4545#include <smp/ipi.h>
    46 
    47 #ifdef CONFIG_SYMTAB
    4846#include <symtab.h>
    49 #endif
    5047
    5148typedef struct  {
     
    234231        }
    235232
    236 #ifdef CONFIG_SYMTAB
    237         printf("Reached breakpoint %d:%lx(%s)\n", slot, getip(istate),
    238             get_symtab_entry(getip(istate)));
    239 #else
    240         printf("Reached breakpoint %d:%lx\n", slot, getip(istate));
    241 #endif
     233        printf("Reached breakpoint %d:%lx (%s)\n", slot, getip(istate),
     234            symtab_fmt_name_lookup(getip(istate)));
    242235
    243236#ifdef CONFIG_KCONSOLE
     
    364357        for (i = 0; i < BKPOINTS_MAX; i++)
    365358                if (breakpoints[i].address) {
    366 #ifdef CONFIG_SYMTAB
    367                         symbol = get_symtab_entry(breakpoints[i].address);
    368 #else
    369                         symbol = "n/a";
    370 #endif
     359                        symbol = symtab_fmt_name_lookup(
     360                            breakpoints[i].address);
    371361
    372362#ifdef __32_BITS__
  • kernel/arch/amd64/src/interrupt.c

    rb1c8dc0 re16e0d59  
    5252#include <interrupt.h>
    5353#include <ddi/irq.h>
    54 
    55 #ifdef CONFIG_SYMTAB
    5654#include <symtab.h>
    57 #endif
    5855
    5956/*
     
    6865{
    6966        char *symbol;
    70 /*      uint64_t *x = &istate->stack[0]; */
    71 
    72 #ifdef CONFIG_SYMTAB
    73         if (!(symbol = get_symtab_entry(istate->rip)))
    74                 symbol = "";
    75 #else
    76         symbol = "";
    77 #endif
     67
     68        symbol = symtab_fmt_name_lookup((istate->rip);
    7869
    7970        printf("-----EXCEPTION(%d) OCCURED----- ( %s )\n", n, __func__);
  • kernel/arch/ia32/src/interrupt.c

    rb1c8dc0 re16e0d59  
    5252#include <interrupt.h>
    5353#include <ddi/irq.h>
    54 
    55 #ifdef CONFIG_SYMTAB
    5654#include <symtab.h>
    57 #endif
    5855
    5956/*
     
    6966        char *symbol;
    7067
    71 #ifdef CONFIG_SYMTAB
    72         symbol = get_symtab_entry(istate->eip);
    73         if (!symbol)
    74                 symbol = "";
    75 #else
    76         symbol = "";
    77 #endif
     68        symbol = symtab_fmt_name_lookup(istate->eip);
    7869
    7970        if (CPU)
  • kernel/arch/ia64/src/interrupt.c

    rb1c8dc0 re16e0d59  
    5454#include <synch/spinlock.h>
    5555#include <mm/tlb.h>
    56 
    57 #ifdef CONFIG_SYMTAB
    5856#include <symtab.h>
    59 #endif
    6057
    6158#define VECTORS_64_BUNDLE       20
     
    141138        char *ifa, *iipa, *iip;
    142139
    143 #ifdef CONFIG_SYMTAB
    144         ifa = get_symtab_entry(istate->cr_ifa);
    145         iipa = get_symtab_entry(istate->cr_iipa);
    146         iip = get_symtab_entry(istate->cr_iip);
    147 #else
    148         ifa = iipa = iip = "n/a";
    149 #endif
     140        ifa = symtab_fmt_name_lookup(istate->cr_ifa);
     141        iipa = symtab_fmt_name_lookup(istate->cr_iipa);
     142        iip = symtab_fmt_name_lookup(istate->cr_iip);
    150143
    151144        putchar('\n');
  • kernel/arch/mips32/src/debugger.c

    rb1c8dc0 re16e0d59  
    4343#include <arch/cp0.h>
    4444#include <func.h>
    45 
    46 #ifdef CONFIG_SYMTAB
    4745#include <symtab.h>
    48 #endif
    4946
    5047bpinfo_t breakpoints[BKPOINTS_MAX];
     
    263260        for (i = 0; i < BKPOINTS_MAX; i++)
    264261                if (breakpoints[i].address) {
    265 #ifdef CONFIG_SYMTAB
    266                         symbol = get_symtab_entry(breakpoints[i].address);
    267 #else
    268                         symbol = "n/a";
    269 #endif
    270                        
     262                        symbol = symtab_fmt_name_lookup(
     263                            breakpoints[i].address);
     264
    271265                        printf("%-2u %-5d %#10zx %-6s %-7s %-8s %s\n", i,
    272266                            breakpoints[i].counter, breakpoints[i].address,
     
    357351               
    358352                if (!(cur->flags & BKPOINT_FUNCCALL)) {
    359 #ifdef CONFIG_SYMTAB
    360353                        printf("***Breakpoint %d: %p in %s.\n", i, fireaddr,
    361                             get_symtab_entry(istate->epc));
    362 #else
    363                         printf("***Breakpoint %d: %p.\n", i, fireaddr);
    364 #endif
     354                            symtab_fmt_name_lookup(istate->epc));
    365355                }
    366356
     
    376366                cur->flags |= BKPOINT_INPROG;
    377367        } else {
    378 #ifdef CONFIG_SYMTAB
    379                 printf("***Breakpoint %p in %s.\n", fireaddr,
    380                        get_symtab_entry(fireaddr));
    381 #else
    382                 printf("***Breakpoint %p.\n", fireaddr);       
    383 #endif
     368                printf("***Breakpoint %d: %p in %s.\n", i, fireaddr,
     369                    symtab_fmt_name_lookup(fireaddr));
     370
    384371                /* Move on to next instruction */
    385372                istate->epc += 4;
  • kernel/arch/mips32/src/exception.c

    rb1c8dc0 re16e0d59  
    4747#include <ddi/irq.h>
    4848#include <arch/debugger.h>
    49 
    50 #ifdef CONFIG_SYMTAB
    5149#include <symtab.h>
    52 #endif
    5350
    5451static char * exctable[] = {
     
    7774static void print_regdump(istate_t *istate)
    7875{
    79         char *pcsymbol = "";
    80         char *rasymbol = "";
     76        char *pcsymbol, *rasymbol;
    8177
    82 #ifdef CONFIG_SYMTAB
    83         char *s = get_symtab_entry(istate->epc);
    84         if (s)
    85                 pcsymbol = s;
    86         s = get_symtab_entry(istate->ra);
    87         if (s)
    88                 rasymbol = s;
    89 #endif
    90        
    91         printf("PC: %#x(%s) RA: %#x(%s), SP(%p)\n", istate->epc, pcsymbol, istate->ra, rasymbol, istate->sp);
     78        pcsymbol = symtab_fmt_name_lookup(istate->epc);
     79        rasymbol = symtab_fmt_name_lookup(istate->ra);
     80
     81        printf("PC: %#x(%s) RA: %#x(%s), SP(%p)\n", istate->epc, pcsymbol,
     82            istate->ra, rasymbol, istate->sp);
    9283}
    9384
  • kernel/arch/mips32/src/mm/tlb.c

    rb1c8dc0 re16e0d59  
    4646#include <align.h>
    4747#include <interrupt.h>
    48 
    49 #ifdef CONFIG_SYMTAB
    5048#include <symtab.h>
    51 #endif
    5249
    5350static void tlb_refill_fail(istate_t *);
     
    324321void tlb_refill_fail(istate_t *istate)
    325322{
    326         char *symbol = "";
    327         char *sym2 = "";
    328 
    329 #ifdef CONFIG_SYMTAB
    330         char *s = get_symtab_entry(istate->epc);
    331         if (s)
    332                 symbol = s;
    333         s = get_symtab_entry(istate->ra);
    334         if (s)
    335                 sym2 = s;
    336 #endif
    337 
     323        char *symbol, *sym2;
     324
     325        symbol = symtab_fmt_name_lookup(istate->epc);
     326        sym2 = symtab_fmt_name_lookup(istate->ra);
     327       
    338328        fault_if_from_uspace(istate, "TLB Refill Exception on %p.",
    339329            cp0_badvaddr_read());
    340         panic("%x: TLB Refill Exception at %x(%s<-%s).", cp0_badvaddr_read(),
     330        panic("%x: TLB Refill Exception at %x (%s<-%s).", cp0_badvaddr_read(),
    341331            istate->epc, symbol, sym2);
    342332}
     
    345335void tlb_invalid_fail(istate_t *istate)
    346336{
    347         char *symbol = "";
    348 
    349 #ifdef CONFIG_SYMTAB
    350         char *s = get_symtab_entry(istate->epc);
    351         if (s)
    352                 symbol = s;
    353 #endif
     337        char *symbol;
     338
     339        symbol = symtab_fmt_name_lookup(istate->epc);
    354340
    355341        fault_if_from_uspace(istate, "TLB Invalid Exception on %p.",
    356342            cp0_badvaddr_read());
    357         panic("%x: TLB Invalid Exception at %x(%s).", cp0_badvaddr_read(),
     343        panic("%x: TLB Invalid Exception at %x (%s).", cp0_badvaddr_read(),
    358344            istate->epc, symbol);
    359345}
     
    361347void tlb_modified_fail(istate_t *istate)
    362348{
    363         char *symbol = "";
    364 
    365 #ifdef CONFIG_SYMTAB
    366         char *s = get_symtab_entry(istate->epc);
    367         if (s)
    368                 symbol = s;
    369 #endif
     349        char *symbol;
     350
     351        symbol = symtab_fmt_name_lookup(istate->epc);
    370352
    371353        fault_if_from_uspace(istate, "TLB Modified Exception on %p.",
    372354            cp0_badvaddr_read());
    373         panic("%x: TLB Modified Exception at %x(%s).", cp0_badvaddr_read(),
     355        panic("%x: TLB Modified Exception at %x (%s).", cp0_badvaddr_read(),
    374356            istate->epc, symbol);
    375357}
  • kernel/arch/ppc32/src/mm/tlb.c

    rb1c8dc0 re16e0d59  
    4141#include <print.h>
    4242#include <macros.h>
    43 
    44 #ifdef CONFIG_SYMTAB
    4543#include <symtab.h>
    46 #endif
    4744
    4845static unsigned int seed = 10;
     
    121118static void pht_refill_fail(uintptr_t badvaddr, istate_t *istate)
    122119{
    123         char *symbol = "";
    124         char *sym2 = "";
    125 
    126 #ifdef CONFIG_SYMTAB
    127         char *str = get_symtab_entry(istate->pc);
    128         if (str)
    129                 symbol = str;
    130         str = get_symtab_entry(istate->lr);
    131         if (str)
    132                 sym2 = str;
    133 #endif
     120        char *symbol;
     121        char *sym2;
     122
     123        symbol = symtab_fmt_name_lookup(istate->pc);
     124        sym2 = symtab_fmt_name_lookup(istate->lr);
    134125
    135126        fault_if_from_uspace(istate,
  • kernel/arch/sparc64/src/trap/exception.c

    rb1c8dc0 re16e0d59  
    4242#include <debug.h>
    4343#include <print.h>
    44 
    45 #ifdef CONFIG_SYMTAB
    4644#include <symtab.h>
    47 #endif
    4845
    4946void dump_istate(istate_t *istate)
     
    5148        char *tpcs, *tnpcs;
    5249
    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
     50        tpcs = symtab_fmt_name_lookup(istate->tpc);
     51        tnpcs = symtab_fmt_name_lookup(istate->tnpc);
     52
    5953        printf("TSTATE=%#" PRIx64 "\n", istate->tstate);
    6054        printf("TPC=%#" PRIx64 " (%s)\n", istate->tpc, tpcs);
Note: See TracChangeset for help on using the changeset viewer.