2007-02-22 09:34:42 +03:00
|
|
|
/* $NetBSD: db_elf.c,v 1.24 2007/02/22 06:41:00 thorpej Exp $ */
|
1997-07-01 22:36:36 +04:00
|
|
|
|
|
|
|
/*-
|
|
|
|
* Copyright (c) 1997 The NetBSD Foundation, Inc.
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* This code is derived from software contributed to The NetBSD Foundation
|
|
|
|
* by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,
|
|
|
|
* NASA Ames Research Center.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
|
|
|
* 3. All advertising materials mentioning features or use of this software
|
|
|
|
* must display the following acknowledgement:
|
|
|
|
* This product includes software developed by the NetBSD
|
|
|
|
* Foundation, Inc. and its contributors.
|
|
|
|
* 4. Neither the name of The NetBSD Foundation nor the names of its
|
|
|
|
* contributors may be used to endorse or promote products derived
|
|
|
|
* from this software without specific prior written permission.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
|
|
|
|
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
|
|
|
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
|
|
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
|
|
|
|
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
|
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
|
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
|
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
|
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
|
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
|
|
* POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
*/
|
|
|
|
|
2001-11-13 01:54:03 +03:00
|
|
|
#include <sys/cdefs.h>
|
2007-02-22 09:34:42 +03:00
|
|
|
__KERNEL_RCSID(0, "$NetBSD: db_elf.c,v 1.24 2007/02/22 06:41:00 thorpej Exp $");
|
2001-11-13 01:54:03 +03:00
|
|
|
|
1997-07-01 22:36:36 +04:00
|
|
|
#include <sys/param.h>
|
2002-02-15 10:33:48 +03:00
|
|
|
#include <sys/systm.h>
|
1997-07-01 22:36:36 +04:00
|
|
|
#include <sys/proc.h>
|
|
|
|
|
|
|
|
#include <machine/db_machdep.h>
|
|
|
|
|
|
|
|
#include <ddb/db_sym.h>
|
|
|
|
#include <ddb/db_output.h>
|
|
|
|
#include <ddb/db_extern.h>
|
|
|
|
|
|
|
|
#ifdef DB_ELF_SYMBOLS
|
|
|
|
|
|
|
|
#ifndef DB_ELFSIZE
|
|
|
|
#error Must define DB_ELFSIZE!
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define ELFSIZE DB_ELFSIZE
|
|
|
|
|
|
|
|
#include <sys/exec_elf.h>
|
|
|
|
|
2002-02-15 10:33:48 +03:00
|
|
|
static char *db_elf_find_strtab(db_symtab_t *);
|
1997-07-01 22:36:36 +04:00
|
|
|
|
|
|
|
#define STAB_TO_SYMSTART(stab) ((Elf_Sym *)((stab)->start))
|
|
|
|
#define STAB_TO_SYMEND(stab) ((Elf_Sym *)((stab)->end))
|
|
|
|
#define STAB_TO_EHDR(stab) ((Elf_Ehdr *)((stab)->private))
|
|
|
|
#define STAB_TO_SHDR(stab, e) ((Elf_Shdr *)((stab)->private + (e)->e_shoff))
|
|
|
|
|
2007-02-22 01:59:35 +03:00
|
|
|
static bool db_elf_sym_init(int, void *, void *, const char *);
|
2002-02-15 10:33:48 +03:00
|
|
|
static db_sym_t db_elf_lookup(db_symtab_t *, char *);
|
|
|
|
static db_sym_t db_elf_search_symbol(db_symtab_t *, db_addr_t, db_strategy_t,
|
|
|
|
db_expr_t *);
|
|
|
|
static void db_elf_symbol_values(db_symtab_t *, db_sym_t, char **,
|
|
|
|
db_expr_t *);
|
2007-02-22 01:59:35 +03:00
|
|
|
static bool db_elf_line_at_pc(db_symtab_t *, db_sym_t, char **, int *,
|
2002-02-15 10:33:48 +03:00
|
|
|
db_expr_t);
|
2007-02-22 01:59:35 +03:00
|
|
|
static bool db_elf_sym_numargs(db_symtab_t *, db_sym_t, int *, char **);
|
2002-02-15 10:33:48 +03:00
|
|
|
static void db_elf_forall(db_symtab_t *, db_forall_func_t db_forall_func,
|
|
|
|
void *);
|
1998-12-04 23:18:05 +03:00
|
|
|
|
2001-01-17 22:50:03 +03:00
|
|
|
const db_symformat_t db_symformat_elf = {
|
1998-12-04 23:18:05 +03:00
|
|
|
"ELF",
|
|
|
|
db_elf_sym_init,
|
|
|
|
db_elf_lookup,
|
|
|
|
db_elf_search_symbol,
|
|
|
|
db_elf_symbol_values,
|
|
|
|
db_elf_line_at_pc,
|
|
|
|
db_elf_sym_numargs,
|
2000-05-22 18:49:10 +04:00
|
|
|
db_elf_forall
|
1998-12-04 23:18:05 +03:00
|
|
|
};
|
|
|
|
|
1997-07-01 22:36:36 +04:00
|
|
|
/*
|
|
|
|
* Find the symbol table and strings; tell ddb about them.
|
|
|
|
*/
|
2007-02-22 01:59:35 +03:00
|
|
|
static bool
|
2002-02-15 10:33:48 +03:00
|
|
|
db_elf_sym_init(
|
|
|
|
int symsize, /* size of symbol table */
|
|
|
|
void *symtab, /* pointer to start of symbol table */
|
|
|
|
void *esymtab, /* pointer to end of string table,
|
1997-07-01 22:36:36 +04:00
|
|
|
for checking - rounded up to integer
|
|
|
|
boundary */
|
2002-02-15 10:33:48 +03:00
|
|
|
const char *name
|
|
|
|
)
|
1997-07-01 22:36:36 +04:00
|
|
|
{
|
|
|
|
Elf_Ehdr *elf;
|
|
|
|
Elf_Shdr *shp;
|
|
|
|
Elf_Sym *symp, *symtab_start, *symtab_end;
|
2001-07-31 23:14:18 +04:00
|
|
|
char *strtab_start, *strtab_end;
|
|
|
|
int i, j;
|
1997-07-01 22:36:36 +04:00
|
|
|
|
|
|
|
if (ALIGNED_POINTER(symtab, long) == 0) {
|
1998-12-04 23:18:05 +03:00
|
|
|
printf("[ %s symbol table has bad start address %p ]\n",
|
|
|
|
name, symtab);
|
2007-02-22 09:34:42 +03:00
|
|
|
return (false);
|
1997-07-01 22:36:36 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
symtab_start = symtab_end = NULL;
|
|
|
|
strtab_start = strtab_end = NULL;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* The format of the symbols loaded by the boot program is:
|
|
|
|
*
|
|
|
|
* Elf exec header
|
|
|
|
* first section header
|
|
|
|
* . . .
|
|
|
|
* . . .
|
|
|
|
* last section header
|
|
|
|
* first symbol or string table section
|
|
|
|
* . . .
|
|
|
|
* . . .
|
|
|
|
* last symbol or string table section
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Validate the Elf header.
|
|
|
|
*/
|
|
|
|
elf = (Elf_Ehdr *)symtab;
|
1999-10-25 17:55:06 +04:00
|
|
|
if (memcmp(elf->e_ident, ELFMAG, SELFMAG) != 0 ||
|
|
|
|
elf->e_ident[EI_CLASS] != ELFCLASS)
|
1997-07-01 22:36:36 +04:00
|
|
|
goto badheader;
|
|
|
|
|
|
|
|
switch (elf->e_machine) {
|
|
|
|
|
1999-10-22 01:17:08 +04:00
|
|
|
ELFDEFNNAME(MACHDEP_ID_CASES)
|
1997-07-01 22:36:36 +04:00
|
|
|
|
|
|
|
default:
|
|
|
|
goto badheader;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
2001-07-31 23:14:18 +04:00
|
|
|
* Find the first (and, we hope, only) SHT_SYMTAB section in
|
|
|
|
* the file, and the SHT_STRTAB section that goes with it.
|
1997-07-01 22:36:36 +04:00
|
|
|
*/
|
2001-08-01 02:31:47 +04:00
|
|
|
if (elf->e_shoff == 0)
|
|
|
|
goto badheader;
|
1999-01-08 21:10:35 +03:00
|
|
|
shp = (Elf_Shdr *)((char *)symtab + elf->e_shoff);
|
1997-07-01 22:36:36 +04:00
|
|
|
for (i = 0; i < elf->e_shnum; i++) {
|
2001-07-31 23:14:18 +04:00
|
|
|
if (shp[i].sh_type == SHT_SYMTAB) {
|
2001-08-01 02:31:47 +04:00
|
|
|
if (shp[i].sh_offset == 0)
|
|
|
|
continue;
|
2001-07-31 23:14:18 +04:00
|
|
|
/* Got the symbol table. */
|
2002-02-15 10:33:48 +03:00
|
|
|
symtab_start = (Elf_Sym *)((char *)symtab +
|
1999-01-08 21:10:35 +03:00
|
|
|
shp[i].sh_offset);
|
2002-02-15 10:33:48 +03:00
|
|
|
symtab_end = (Elf_Sym *)((char *)symtab +
|
1999-01-08 21:10:35 +03:00
|
|
|
shp[i].sh_offset + shp[i].sh_size);
|
2001-07-31 23:14:18 +04:00
|
|
|
/* Find the string table to go with it. */
|
|
|
|
j = shp[i].sh_link;
|
2001-08-01 02:31:47 +04:00
|
|
|
if (shp[j].sh_offset == 0)
|
|
|
|
continue;
|
2001-07-31 23:14:18 +04:00
|
|
|
strtab_start = (char *)symtab + shp[j].sh_offset;
|
|
|
|
strtab_end = (char *)symtab + shp[j].sh_offset +
|
|
|
|
shp[j].sh_size;
|
|
|
|
/* There should only be one symbol table. */
|
|
|
|
break;
|
1997-07-01 22:36:36 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Now, sanity check the symbols against the string table.
|
|
|
|
*/
|
1997-09-06 01:46:59 +04:00
|
|
|
if (symtab_start == NULL || strtab_start == NULL ||
|
|
|
|
ALIGNED_POINTER(symtab_start, long) == 0 ||
|
|
|
|
ALIGNED_POINTER(strtab_start, long) == 0)
|
1997-07-01 22:36:36 +04:00
|
|
|
goto badheader;
|
|
|
|
for (symp = symtab_start; symp < symtab_end; symp++)
|
|
|
|
if (symp->st_name + strtab_start > strtab_end)
|
|
|
|
goto badheader;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Link the symbol table into the debugger.
|
|
|
|
*/
|
|
|
|
if (db_add_symbol_table((char *)symtab_start,
|
1998-12-04 23:18:05 +03:00
|
|
|
(char *)symtab_end, name, (char *)symtab) != -1) {
|
2000-07-08 01:55:18 +04:00
|
|
|
printf("[ using %lu bytes of %s ELF symbol table ]\n",
|
2002-02-15 10:33:48 +03:00
|
|
|
(u_long)roundup(((char *)esymtab - (char *)symtab),
|
|
|
|
sizeof(u_long)), name);
|
2007-02-22 09:34:42 +03:00
|
|
|
return (true);
|
1998-12-04 23:18:05 +03:00
|
|
|
}
|
|
|
|
|
2007-02-22 09:34:42 +03:00
|
|
|
return (false);
|
1997-07-01 22:36:36 +04:00
|
|
|
|
|
|
|
badheader:
|
1998-12-04 23:18:05 +03:00
|
|
|
printf("[ %s ELF symbol table not valid ]\n", name);
|
2007-02-22 09:34:42 +03:00
|
|
|
return (false);
|
1997-07-01 22:36:36 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Internal helper function - return a pointer to the string table
|
|
|
|
* for the current symbol table.
|
|
|
|
*/
|
|
|
|
static char *
|
2002-02-15 10:33:48 +03:00
|
|
|
db_elf_find_strtab(db_symtab_t *stab)
|
1997-07-01 22:36:36 +04:00
|
|
|
{
|
|
|
|
Elf_Ehdr *elf = STAB_TO_EHDR(stab);
|
|
|
|
Elf_Shdr *shp = STAB_TO_SHDR(stab, elf);
|
|
|
|
int i;
|
|
|
|
|
2001-11-08 18:01:35 +03:00
|
|
|
/*
|
|
|
|
* We don't load ELF header for ELF modules.
|
|
|
|
* Find out if this is a loadable module. If so,
|
|
|
|
* string table comes right after symbol table.
|
|
|
|
*/
|
|
|
|
if ((Elf_Sym *)elf == STAB_TO_SYMSTART(stab)) {
|
|
|
|
return ((char *)STAB_TO_SYMEND(stab));
|
|
|
|
}
|
1997-07-01 22:36:36 +04:00
|
|
|
for (i = 0; i < elf->e_shnum; i++) {
|
2001-07-31 23:14:18 +04:00
|
|
|
if (shp[i].sh_type == SHT_SYMTAB)
|
|
|
|
return ((char*)elf + shp[shp[i].sh_link].sh_offset);
|
1997-07-01 22:36:36 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
return (NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Lookup the symbol with the given name.
|
|
|
|
*/
|
2002-02-15 10:33:48 +03:00
|
|
|
static db_sym_t
|
|
|
|
db_elf_lookup(db_symtab_t *stab, char *symstr)
|
1997-07-01 22:36:36 +04:00
|
|
|
{
|
|
|
|
Elf_Sym *symp, *symtab_start, *symtab_end;
|
|
|
|
char *strtab;
|
|
|
|
|
|
|
|
symtab_start = STAB_TO_SYMSTART(stab);
|
|
|
|
symtab_end = STAB_TO_SYMEND(stab);
|
|
|
|
|
|
|
|
strtab = db_elf_find_strtab(stab);
|
|
|
|
if (strtab == NULL)
|
|
|
|
return ((db_sym_t)0);
|
|
|
|
|
|
|
|
for (symp = symtab_start; symp < symtab_end; symp++) {
|
|
|
|
if (symp->st_name != 0 &&
|
|
|
|
db_eqname(strtab + symp->st_name, symstr, 0))
|
|
|
|
return ((db_sym_t)symp);
|
|
|
|
}
|
|
|
|
|
|
|
|
return ((db_sym_t)0);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Search for the symbol with the given address (matching within the
|
|
|
|
* provided threshold).
|
|
|
|
*/
|
2002-02-15 10:33:48 +03:00
|
|
|
static db_sym_t
|
|
|
|
db_elf_search_symbol(db_symtab_t *symtab, db_addr_t off, db_strategy_t strategy,
|
|
|
|
db_expr_t *diffp)
|
1997-07-01 22:36:36 +04:00
|
|
|
{
|
|
|
|
Elf_Sym *rsymp, *symp, *symtab_start, *symtab_end;
|
2002-11-13 08:59:28 +03:00
|
|
|
db_addr_t diff = *diffp;
|
1997-07-01 22:36:36 +04:00
|
|
|
|
|
|
|
symtab_start = STAB_TO_SYMSTART(symtab);
|
|
|
|
symtab_end = STAB_TO_SYMEND(symtab);
|
|
|
|
|
|
|
|
rsymp = NULL;
|
|
|
|
|
|
|
|
for (symp = symtab_start; symp < symtab_end; symp++) {
|
|
|
|
if (symp->st_name == 0)
|
|
|
|
continue;
|
1998-08-13 06:10:37 +04:00
|
|
|
#if 0
|
|
|
|
/* This prevents me from seeing anythin in locore.s -- eeh */
|
1997-07-01 22:36:36 +04:00
|
|
|
if (ELF_SYM_TYPE(symp->st_info) != Elf_estt_object &&
|
|
|
|
ELF_SYM_TYPE(symp->st_info) != Elf_estt_func)
|
|
|
|
continue;
|
1998-08-13 06:10:37 +04:00
|
|
|
#endif
|
1997-07-01 22:36:36 +04:00
|
|
|
|
|
|
|
if (off >= symp->st_value) {
|
2002-11-13 08:59:28 +03:00
|
|
|
if (off - symp->st_value < diff) {
|
1997-07-01 22:36:36 +04:00
|
|
|
diff = off - symp->st_value;
|
|
|
|
rsymp = symp;
|
|
|
|
if (diff == 0) {
|
|
|
|
if (strategy == DB_STGY_PROC &&
|
1999-10-25 17:55:06 +04:00
|
|
|
ELFDEFNNAME(ST_TYPE)(symp->st_info)
|
|
|
|
== STT_FUNC &&
|
|
|
|
ELFDEFNNAME(ST_BIND)(symp->st_info)
|
|
|
|
!= STB_LOCAL)
|
1997-07-01 22:36:36 +04:00
|
|
|
break;
|
|
|
|
if (strategy == DB_STGY_ANY &&
|
1999-10-25 17:55:06 +04:00
|
|
|
ELFDEFNNAME(ST_BIND)(symp->st_info)
|
|
|
|
!= STB_LOCAL)
|
1997-07-01 22:36:36 +04:00
|
|
|
break;
|
|
|
|
}
|
2002-11-13 08:59:28 +03:00
|
|
|
} else if (off - symp->st_value == diff) {
|
1997-07-01 22:36:36 +04:00
|
|
|
if (rsymp == NULL)
|
|
|
|
rsymp = symp;
|
1999-10-25 17:55:06 +04:00
|
|
|
else if (ELFDEFNNAME(ST_BIND)(rsymp->st_info)
|
|
|
|
== STB_LOCAL &&
|
|
|
|
ELFDEFNNAME(ST_BIND)(symp->st_info)
|
|
|
|
!= STB_LOCAL) {
|
1997-07-01 22:36:36 +04:00
|
|
|
/* pick the external symbol */
|
|
|
|
rsymp = symp;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (rsymp == NULL)
|
|
|
|
*diffp = off;
|
|
|
|
else
|
|
|
|
*diffp = diff;
|
|
|
|
|
|
|
|
return ((db_sym_t)rsymp);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Return the name and value for a symbol.
|
|
|
|
*/
|
2002-02-15 10:33:48 +03:00
|
|
|
static void
|
|
|
|
db_elf_symbol_values(db_symtab_t *symtab, db_sym_t sym, char **namep,
|
|
|
|
db_expr_t *valuep)
|
1997-07-01 22:36:36 +04:00
|
|
|
{
|
|
|
|
Elf_Sym *symp = (Elf_Sym *)sym;
|
|
|
|
char *strtab;
|
|
|
|
|
|
|
|
if (namep) {
|
|
|
|
strtab = db_elf_find_strtab(symtab);
|
|
|
|
if (strtab == NULL)
|
|
|
|
*namep = NULL;
|
|
|
|
else
|
|
|
|
*namep = strtab + symp->st_name;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (valuep)
|
|
|
|
*valuep = symp->st_value;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Return the file and line number of the current program counter
|
|
|
|
* if we can find the appropriate debugging symbol.
|
|
|
|
*/
|
2007-02-22 01:59:35 +03:00
|
|
|
static bool
|
1998-12-04 23:18:05 +03:00
|
|
|
db_elf_line_at_pc(symtab, cursym, filename, linenum, off)
|
1997-07-01 22:36:36 +04:00
|
|
|
db_symtab_t *symtab;
|
|
|
|
db_sym_t cursym;
|
|
|
|
char **filename;
|
|
|
|
int *linenum;
|
|
|
|
db_expr_t off;
|
|
|
|
{
|
|
|
|
|
|
|
|
/*
|
|
|
|
* XXX We don't support this (yet).
|
|
|
|
*/
|
2007-02-22 09:34:42 +03:00
|
|
|
return (false);
|
1997-07-01 22:36:36 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Returns the number of arguments to a function and their
|
|
|
|
* names if we can find the appropriate debugging symbol.
|
|
|
|
*/
|
2007-02-22 01:59:35 +03:00
|
|
|
static bool
|
2002-02-15 10:33:48 +03:00
|
|
|
db_elf_sym_numargs(db_symtab_t *symtab, db_sym_t cursym, int *nargp,
|
|
|
|
char **argnamep)
|
1997-07-01 22:36:36 +04:00
|
|
|
{
|
|
|
|
|
|
|
|
/*
|
|
|
|
* XXX We don't support this (yet).
|
|
|
|
*/
|
2007-02-22 09:34:42 +03:00
|
|
|
return (false);
|
1997-07-01 22:36:36 +04:00
|
|
|
}
|
2000-05-22 18:49:10 +04:00
|
|
|
|
2002-02-15 10:33:48 +03:00
|
|
|
static void
|
|
|
|
db_elf_forall(db_symtab_t *stab, db_forall_func_t db_forall_func, void *arg)
|
2000-05-22 18:49:10 +04:00
|
|
|
{
|
|
|
|
char *strtab;
|
|
|
|
static char suffix[2];
|
|
|
|
Elf_Sym *symp, *symtab_start, *symtab_end;
|
|
|
|
|
|
|
|
symtab_start = STAB_TO_SYMSTART(stab);
|
|
|
|
symtab_end = STAB_TO_SYMEND(stab);
|
|
|
|
|
|
|
|
strtab = db_elf_find_strtab(stab);
|
|
|
|
if (strtab == NULL)
|
|
|
|
return;
|
|
|
|
|
|
|
|
for (symp = symtab_start; symp < symtab_end; symp++)
|
|
|
|
if (symp->st_name != 0) {
|
|
|
|
suffix[1] = '\0';
|
|
|
|
switch (ELFDEFNNAME(ST_TYPE)(symp->st_info)) {
|
|
|
|
case STT_OBJECT:
|
|
|
|
suffix[0] = '+';
|
|
|
|
break;
|
|
|
|
case STT_FUNC:
|
|
|
|
suffix[0] = '*';
|
|
|
|
break;
|
|
|
|
case STT_SECTION:
|
|
|
|
suffix[0] = '&';
|
|
|
|
break;
|
|
|
|
case STT_FILE:
|
|
|
|
suffix[0] = '/';
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
suffix[0] = '\0';
|
|
|
|
}
|
|
|
|
(*db_forall_func)(stab, (db_sym_t)symp,
|
|
|
|
strtab + symp->st_name, suffix, 0, arg);
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
1997-07-01 22:36:36 +04:00
|
|
|
#endif /* DB_ELF_SYMBOLS */
|