summaryrefslogtreecommitdiffstats
path: root/sys/ddb
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>2002-09-15 20:48:08 +0000
committerbde <bde@FreeBSD.org>2002-09-15 20:48:08 +0000
commit0e22cfe38ec471fefe5b3025d1263645e1a6edff (patch)
tree162bb2121922b02d5ba3051f2ee365e5521e4fe9 /sys/ddb
parent9c29b6417765f0e8a1066883a28f74e1a7f08be2 (diff)
downloadFreeBSD-src-0e22cfe38ec471fefe5b3025d1263645e1a6edff.zip
FreeBSD-src-0e22cfe38ec471fefe5b3025d1263645e1a6edff.tar.gz
Made this compile (but not work). This involved mainly const poisoning
and renaming ALIGNED_POINTER() to _ALIGNED_POINTER() plus the following hacks for i386's: - define _ALIGNED_POINTER() if it is not already defined. Most non-i386 arches define it <machine/param.h> define it in <machine/param.h>, although none actually used it in the kernel. - define ksym_start and ksym_end. Most non-i386 arches still define and initialize these in machdep.c although they didn't used them. Here is a better place to define them but not to initialize them.
Diffstat (limited to 'sys/ddb')
-rw-r--r--sys/ddb/db_elf.c26
1 files changed, 18 insertions, 8 deletions
diff --git a/sys/ddb/db_elf.c b/sys/ddb/db_elf.c
index 792a759..3a77089 100644
--- a/sys/ddb/db_elf.c
+++ b/sys/ddb/db_elf.c
@@ -51,11 +51,16 @@
#include <machine/db_machdep.h>
+#include <ddb/ddb.h>
#include <ddb/db_sym.h>
#include <ddb/db_output.h>
#include <machine/elf.h>
+#ifndef _ALIGNED_POINTER
+#define _ALIGNED_POINTER(ptr, type) 1
+#endif
+
static char *db_elf_find_strtab(db_symtab_t *);
#define STAB_TO_SYMSTART(stab) ((Elf_Sym *)((stab)->start))
@@ -82,7 +87,7 @@ X_db_sym_init(symtab, esymtab, name)
char *strtab_start, *strtab_end;
int i;
- if (ALIGNED_POINTER(symtab, long) == 0) {
+ if (_ALIGNED_POINTER(symtab, long) == 0) {
printf("DDB: bad symbol table start address %p\n", symtab);
return;
}
@@ -164,8 +169,8 @@ X_db_sym_init(symtab, esymtab, name)
* Now, sanity check the symbols against the string table.
*/
if (symtab_start == NULL || strtab_start == NULL ||
- ALIGNED_POINTER(symtab_start, long) == 0 ||
- ALIGNED_POINTER(strtab_start, long) == 0)
+ _ALIGNED_POINTER(symtab_start, long) == 0 ||
+ _ALIGNED_POINTER(strtab_start, long) == 0)
goto badheader;
for (symp = symtab_start; symp < symtab_end; symp++)
if (symp->st_name + strtab_start > strtab_end)
@@ -217,7 +222,7 @@ db_elf_find_strtab(stab)
/*
* Lookup the symbol with the given name.
*/
-db_sym_t
+c_db_sym_t
X_db_lookup(stab, symstr)
db_symtab_t *stab;
const char *symstr;
@@ -245,7 +250,7 @@ X_db_lookup(stab, symstr)
* Search for the symbol with the given address (matching within the
* provided threshold).
*/
-db_sym_t
+c_db_sym_t
X_db_search_symbol(symtab, off, strategy, diffp)
db_symtab_t *symtab;
db_addr_t off;
@@ -311,11 +316,11 @@ X_db_search_symbol(symtab, off, strategy, diffp)
void
X_db_symbol_values(symtab, sym, namep, valuep)
db_symtab_t *symtab;
- db_sym_t sym;
+ c_db_sym_t sym;
const char **namep;
db_expr_t *valuep;
{
- Elf_Sym *symp = (Elf_Sym *)sym;
+ const Elf_Sym *symp = (const Elf_Sym *)sym;
char *strtab;
if (namep) {
@@ -337,7 +342,7 @@ X_db_symbol_values(symtab, sym, namep, valuep)
boolean_t
X_db_line_at_pc(symtab, cursym, filename, linenum, off)
db_symtab_t *symtab;
- db_sym_t cursym;
+ c_db_sym_t cursym;
char **filename;
int *linenum;
db_expr_t off;
@@ -370,7 +375,12 @@ X_db_sym_numargs(symtab, cursym, nargp, argnamep)
/*
* Initialization routine for Elf files.
*/
+
+#ifdef __i386__
+void *ksym_start, *ksym_end;
+#else
extern void *ksym_start, *ksym_end;
+#endif
void
kdb_init(void)
OpenPOWER on IntegriCloud