summaryrefslogtreecommitdiff
path: root/ddb/db_sym.c
diff options
context:
space:
mode:
authorJustus Winter <4winter@informatik.uni-hamburg.de>2014-09-14 13:35:50 +0200
committerJustus Winter <4winter@informatik.uni-hamburg.de>2014-09-17 11:39:55 +0200
commit86f60379f71ec6d0aa3b93eaacc55bc5f453bda5 (patch)
tree395ccb92281d5d198892ba478ffe5dbb0af23f42 /ddb/db_sym.c
parentffd4f3c8239b41d3fe9fa14403eb063e02b6a222 (diff)
ddb: add support for ELF symbol tables
* ddb/db_elf.c: New file. * ddb/db_elf.h: Likewise. * Makefrag.am (libkernel_a_SOURCES): Add db_elf.{c,h}. * ddb/db_sym.c (dummy_db_sym_init): New stub db_sym_init function. (db_sym_switch): Add ELF functions. * ddb/db_sym.h (SYMTAB_ELF): New macro. (elf_db_sym_init): New declaration. * i386/i386at/model_dep.c (c_boot_entry): Get ELF section header information from the multiboot structure, and call elf_db_sym_init.
Diffstat (limited to 'ddb/db_sym.c')
-rw-r--r--ddb/db_sym.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/ddb/db_sym.c b/ddb/db_sym.c
index 7d97d15..0179137 100644
--- a/ddb/db_sym.c
+++ b/ddb/db_sym.c
@@ -38,6 +38,7 @@
#include <ddb/db_sym.h>
#include <ddb/db_task_thread.h>
#include <ddb/db_aout.h>
+#include <ddb/db_elf.h>
#include <vm/vm_map.h> /* vm_map_t */
@@ -507,6 +508,10 @@ void db_free_symbol(db_sym_t s)
*/
void dummy_db_free_symbol(db_sym_t symbol) { }
+boolean_t dummy_db_sym_init(char *a, char *b, char *c, char *d) {
+ return FALSE;
+}
+
struct db_sym_switch x_db[] = {
@@ -521,7 +526,14 @@ struct db_sym_switch x_db[] = {
{ 0,},
/* Machdep, not inited here */
- { 0,}
+ { 0,},
+
+#ifdef DB_NO_ELF
+ { 0,},
+#else /* DB_NO_ELF */
+ { dummy_db_sym_init, elf_db_lookup, elf_db_search_symbol,
+ elf_db_line_at_pc, elf_db_symbol_values, dummy_db_free_symbol },
+#endif /* DB_NO_ELF */
};