Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/debug/symtab.c

    r0dee005 r7e752b2  
    3838#include <symtab.h>
    3939#include <byteorder.h>
    40 #include <string.h>
     40#include <str.h>
    4141#include <print.h>
    42 #include <arch/types.h>
     42#include <typedefs.h>
    4343#include <typedefs.h>
    4444#include <errno.h>
     
    4646/** Get name of a symbol that seems most likely to correspond to address.
    4747 *
    48  * @param addr          Address.
    49  * @param name          Place to store pointer to the symbol name.
    50  * @param offset        Place to store offset from the symbol address.
     48 * @param addr   Address.
     49 * @param name   Place to store pointer to the symbol name.
     50 * @param offset Place to store offset from the symbol address.
    5151 *
    5252 * @return Zero on success or negative error code, ENOENT if not found,
     
    5454 *
    5555 */
    56 int symtab_name_lookup(uintptr_t addr, char **name, uintptr_t *offset)
     56int symtab_name_lookup(uintptr_t addr, const char **name, uintptr_t *offset)
    5757{
    5858#ifdef CONFIG_SYMTAB
     
    8383/** Lookup symbol by address and format for display.
    8484 *
    85  * Returns name of closest corresponding symbol, "Not found" if none exists
    86  * or "N/A" if no symbol information is available.
     85 * Returns name of closest corresponding symbol,
     86 * "unknown" if none exists and "N/A" if no symbol
     87 * information is available.
    8788 *
    8889 * @param addr Address.
     
    9293 *
    9394 */
    94 char *symtab_fmt_name_lookup(uintptr_t addr)
    95 {
    96         char *name;
     95const char *symtab_fmt_name_lookup(uintptr_t addr)
     96{
     97        const char *name;
    9798        int rc = symtab_name_lookup(addr, &name, NULL);
    9899       
     
    101102                return name;
    102103        case ENOENT:
    103                 return "Not found";
     104                return "unknown";
    104105        default:
    105106                return "N/A";
     
    191192                uintptr_t addr = uint64_t_le2host(symbol_table[pos].address_le);
    192193                char *realname = symbol_table[pos].symbol_name;
    193                 printf("%p: %s\n", addr, realname);
     194                printf("%p: %s\n", (void *) addr, realname);
    194195                pos++;
    195196        }
     
    239240                printf("\n");
    240241                pos = 0;
    241                 while ((hint = symtab_search_one(name, &pos))) {
     242                while (symtab_search_one(name, &pos)) {
    242243                        printf("%s\n", symbol_table[pos].symbol_name);
    243244                        pos++;
Note: See TracChangeset for help on using the changeset viewer.