Changes in kernel/generic/src/debug/symtab.c [7e752b2:0dee005] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/debug/symtab.c
r7e752b2 r0dee005 38 38 #include <symtab.h> 39 39 #include <byteorder.h> 40 #include <str .h>40 #include <string.h> 41 41 #include <print.h> 42 #include < typedefs.h>42 #include <arch/types.h> 43 43 #include <typedefs.h> 44 44 #include <errno.h> … … 46 46 /** Get name of a symbol that seems most likely to correspond to address. 47 47 * 48 * @param addr 49 * @param name 50 * @param offset 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. 51 51 * 52 52 * @return Zero on success or negative error code, ENOENT if not found, … … 54 54 * 55 55 */ 56 int symtab_name_lookup(uintptr_t addr, c onst char **name, uintptr_t *offset)56 int symtab_name_lookup(uintptr_t addr, char **name, uintptr_t *offset) 57 57 { 58 58 #ifdef CONFIG_SYMTAB … … 83 83 /** Lookup symbol by address and format for display. 84 84 * 85 * Returns name of closest corresponding symbol, 86 * "unknown" if none exists and "N/A" if no symbol 87 * information is available. 85 * Returns name of closest corresponding symbol, "Not found" if none exists 86 * or "N/A" if no symbol information is available. 88 87 * 89 88 * @param addr Address. … … 93 92 * 94 93 */ 95 c onst char *symtab_fmt_name_lookup(uintptr_t addr)96 { 97 c onst char *name;94 char *symtab_fmt_name_lookup(uintptr_t addr) 95 { 96 char *name; 98 97 int rc = symtab_name_lookup(addr, &name, NULL); 99 98 … … 102 101 return name; 103 102 case ENOENT: 104 return " unknown";103 return "Not found"; 105 104 default: 106 105 return "N/A"; … … 192 191 uintptr_t addr = uint64_t_le2host(symbol_table[pos].address_le); 193 192 char *realname = symbol_table[pos].symbol_name; 194 printf("%p: %s\n", (void *)addr, realname);193 printf("%p: %s\n", addr, realname); 195 194 pos++; 196 195 } … … 240 239 printf("\n"); 241 240 pos = 0; 242 while ( symtab_search_one(name, &pos)) {241 while ((hint = symtab_search_one(name, &pos))) { 243 242 printf("%s\n", symbol_table[pos].symbol_name); 244 243 pos++;
Note:
See TracChangeset
for help on using the changeset viewer.