Changes to support -Wall, -Wcast-qual. Had to make physical code changes
in db_lookup() to avoid the *cp = 0 / *cp = ':' combo ( temporary nul-terminate-then-restore-original ) on a const char * string.
This commit is contained in:
parent
cc6e054933
commit
a1c1e16ada
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=43289
@ -23,7 +23,7 @@
|
||||
* any improvements or extensions that they make and grant Carnegie the
|
||||
* rights to redistribute these changes.
|
||||
*
|
||||
* $Id: db_aout.c,v 1.21 1998/06/28 00:55:02 dfr Exp $
|
||||
* $Id: db_aout.c,v 1.22 1998/10/09 23:29:44 peter Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -123,7 +123,7 @@ X_db_sym_init(symtab, esymtab, name)
|
||||
db_sym_t
|
||||
X_db_lookup(stab, symstr)
|
||||
db_symtab_t *stab;
|
||||
char * symstr;
|
||||
const char * symstr;
|
||||
{
|
||||
register struct nlist *sp, *ep;
|
||||
|
||||
@ -201,7 +201,7 @@ void
|
||||
X_db_symbol_values(symtab, sym, namep, valuep)
|
||||
db_symtab_t *symtab;
|
||||
db_sym_t sym;
|
||||
char **namep;
|
||||
const char **namep;
|
||||
db_expr_t *valuep;
|
||||
{
|
||||
register struct nlist *sp;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $Id: db_elf.c,v 1.3 1998/08/17 08:06:31 dfr Exp $ */
|
||||
/* $Id: db_elf.c,v 1.4 1998/10/09 23:32:03 peter Exp $ */
|
||||
/* $NetBSD: db_elf.c,v 1.4 1998/05/03 18:49:54 thorpej Exp $ */
|
||||
|
||||
/*-
|
||||
@ -218,7 +218,7 @@ db_elf_find_strtab(stab)
|
||||
db_sym_t
|
||||
X_db_lookup(stab, symstr)
|
||||
db_symtab_t *stab;
|
||||
char *symstr;
|
||||
const char *symstr;
|
||||
{
|
||||
Elf_Sym *symp, *symtab_start, *symtab_end;
|
||||
char *strtab;
|
||||
@ -310,7 +310,7 @@ void
|
||||
X_db_symbol_values(symtab, sym, namep, valuep)
|
||||
db_symtab_t *symtab;
|
||||
db_sym_t sym;
|
||||
char **namep;
|
||||
const char **namep;
|
||||
db_expr_t *valuep;
|
||||
{
|
||||
Elf_Sym *symp = (Elf_Sym *)sym;
|
||||
|
@ -23,7 +23,7 @@
|
||||
* any improvements or extensions that they make and grant Carnegie the
|
||||
* rights to redistribute these changes.
|
||||
*
|
||||
* $Id: db_kld.c,v 1.3 1998/10/09 23:34:09 peter Exp $
|
||||
* $Id: db_kld.c,v 1.4 1998/10/15 02:01:50 peter Exp $
|
||||
* from db_aout.c,v 1.20 1998/06/07 17:09:36 dfr Exp
|
||||
*/
|
||||
|
||||
@ -49,7 +49,7 @@
|
||||
db_sym_t
|
||||
X_db_lookup(stab, symstr)
|
||||
db_symtab_t *stab;
|
||||
char * symstr;
|
||||
const char * symstr;
|
||||
{
|
||||
linker_sym_t sym;
|
||||
|
||||
@ -85,7 +85,7 @@ void
|
||||
X_db_symbol_values(symtab, dbsym, namep, valuep)
|
||||
db_symtab_t *symtab;
|
||||
db_sym_t dbsym;
|
||||
char **namep;
|
||||
const char **namep;
|
||||
db_expr_t *valuep;
|
||||
{
|
||||
linker_sym_t sym = (linker_sym_t) dbsym;
|
||||
@ -93,7 +93,7 @@ X_db_symbol_values(symtab, dbsym, namep, valuep)
|
||||
|
||||
linker_ddb_symbol_values(sym, &symval);
|
||||
if (namep)
|
||||
*namep = (char*) symval.name;
|
||||
*namep = (const char*) symval.name;
|
||||
if (valuep)
|
||||
*valuep = (db_expr_t) symval.value;
|
||||
}
|
||||
|
@ -30,7 +30,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: db_ps.c,v 1.15 1997/10/09 00:20:00 bde Exp $
|
||||
* $Id: db_ps.c,v 1.16 1998/07/08 06:43:55 bde Exp $
|
||||
*/
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
@ -93,7 +93,7 @@ db_ps(dummy1, dummy2, dummy3, dummy4)
|
||||
pp = p;
|
||||
|
||||
db_printf("%5d %8p %8p %4d %5d %5d %06x %d",
|
||||
p->p_pid, (void *)p, (void *)p->p_addr,
|
||||
p->p_pid, (volatile void *)p, (volatile void *)p->p_addr,
|
||||
p->p_cred ? p->p_cred->p_ruid : 0, pp->p_pid,
|
||||
p->p_pgrp ? p->p_pgrp->pg_id : 0, p->p_flag, p->p_stat);
|
||||
if (p->p_wchan) {
|
||||
|
@ -23,7 +23,7 @@
|
||||
* any improvements or extensions that they make and grant Carnegie the
|
||||
* rights to redistribute these changes.
|
||||
*
|
||||
* $Id: db_sym.c,v 1.26 1998/07/08 10:53:51 bde Exp $
|
||||
* $Id: db_sym.c,v 1.27 1998/12/04 22:54:43 archie Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -48,7 +48,7 @@ static int db_nsymtab = 0;
|
||||
|
||||
static db_symtab_t *db_last_symtab; /* where last symbol was found */
|
||||
|
||||
static db_sym_t db_lookup __P(( char *symstr));
|
||||
static db_sym_t db_lookup __P(( const char *symstr));
|
||||
static char *db_qualify __P((db_sym_t sym, char *symtabname));
|
||||
static boolean_t db_symbol_is_ambiguous __P((db_sym_t sym));
|
||||
static boolean_t db_line_at_pc __P((db_sym_t, char **, int *,
|
||||
@ -87,7 +87,7 @@ db_qualify(sym, symtabname)
|
||||
db_sym_t sym;
|
||||
register char *symtabname;
|
||||
{
|
||||
char *symname;
|
||||
const char *symname;
|
||||
static char tmp[256];
|
||||
|
||||
db_symbol_values(sym, &symname, 0);
|
||||
@ -111,7 +111,7 @@ db_eqname(src, dst, c)
|
||||
|
||||
boolean_t
|
||||
db_value_of_name(name, valuep)
|
||||
char *name;
|
||||
const char *name;
|
||||
db_expr_t *valuep;
|
||||
{
|
||||
db_sym_t sym;
|
||||
@ -132,28 +132,31 @@ db_value_of_name(name, valuep)
|
||||
*/
|
||||
static db_sym_t
|
||||
db_lookup(symstr)
|
||||
char *symstr;
|
||||
const char *symstr;
|
||||
{
|
||||
db_sym_t sp;
|
||||
register int i;
|
||||
int symtab_start = 0;
|
||||
int symtab_end = db_nsymtab;
|
||||
register char *cp;
|
||||
register const char *cp;
|
||||
|
||||
/*
|
||||
* Look for, remove, and remember any symbol table specifier.
|
||||
*/
|
||||
for (cp = symstr; *cp; cp++) {
|
||||
if (*cp == ':') {
|
||||
*cp = '\0';
|
||||
for (i = 0; i < db_nsymtab; i++) {
|
||||
if (! strcmp(symstr, db_symtabs[i].name)) {
|
||||
int n = strlen(db_symtabs[i].name);
|
||||
|
||||
if (
|
||||
n == (cp - symstr) &&
|
||||
strncmp(symstr, db_symtabs[i].name, n) == 0
|
||||
) {
|
||||
symtab_start = i;
|
||||
symtab_end = i + 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
*cp = ':';
|
||||
if (i == db_nsymtab) {
|
||||
db_error("invalid symbol table name");
|
||||
}
|
||||
@ -189,7 +192,7 @@ static boolean_t
|
||||
db_symbol_is_ambiguous(sym)
|
||||
db_sym_t sym;
|
||||
{
|
||||
char *sym_name;
|
||||
const char *sym_name;
|
||||
register int i;
|
||||
register
|
||||
boolean_t found_once = FALSE;
|
||||
@ -244,7 +247,7 @@ db_search_symbol( val, strategy, offp)
|
||||
void
|
||||
db_symbol_values(sym, namep, valuep)
|
||||
db_sym_t sym;
|
||||
char **namep;
|
||||
const char **namep;
|
||||
db_expr_t *valuep;
|
||||
{
|
||||
db_expr_t value;
|
||||
@ -288,7 +291,7 @@ db_printsym(off, strategy)
|
||||
{
|
||||
db_expr_t d;
|
||||
char *filename;
|
||||
char *name;
|
||||
const char *name;
|
||||
db_expr_t value;
|
||||
int linenum;
|
||||
db_sym_t cursym;
|
||||
|
@ -23,7 +23,7 @@
|
||||
* any improvements or extensions that they make and grant Carnegie the
|
||||
* rights to redistribute these changes.
|
||||
*
|
||||
* $Id: db_sym.h,v 1.14 1997/06/30 23:54:49 bde Exp $
|
||||
* $Id: db_sym.h,v 1.15 1998/06/28 00:55:01 dfr Exp $
|
||||
*/
|
||||
|
||||
#ifndef _DDB_DB_SYM_H_
|
||||
@ -73,7 +73,7 @@ void db_add_symbol_table __P((char *, char *, char *, char *));
|
||||
db_sym_t db_search_symbol __P((db_addr_t, db_strategy_t, db_expr_t *));
|
||||
/* find symbol given value */
|
||||
|
||||
void db_symbol_values __P((db_sym_t, char **, db_expr_t *));
|
||||
void db_symbol_values __P((db_sym_t, const char **, db_expr_t *));
|
||||
/* return name and value of symbol */
|
||||
|
||||
#define db_find_sym_and_offset(val,namep,offp) \
|
||||
@ -95,14 +95,14 @@ int db_sym_numargs __P((db_sym_t, int *, char **));
|
||||
boolean_t X_db_line_at_pc __P((db_symtab_t *symtab, db_sym_t cursym,
|
||||
char **filename, int *linenum,
|
||||
db_expr_t off));
|
||||
db_sym_t X_db_lookup __P((db_symtab_t *stab, char *symstr));
|
||||
db_sym_t X_db_lookup __P((db_symtab_t *stab, const char *symstr));
|
||||
db_sym_t X_db_search_symbol __P((db_symtab_t *symtab, db_addr_t off,
|
||||
db_strategy_t strategy,
|
||||
db_expr_t *diffp));
|
||||
int X_db_sym_numargs __P((db_symtab_t *, db_sym_t, int *,
|
||||
char **));
|
||||
void X_db_symbol_values __P((db_symtab_t *symtab,
|
||||
db_sym_t sym, char **namep,
|
||||
db_sym_t sym, const char **namep,
|
||||
db_expr_t *valuep));
|
||||
|
||||
#endif /* !_DDB_DB_SYM_H_ */
|
||||
|
@ -27,7 +27,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: ddb.h,v 1.19 1998/07/08 09:11:40 bde Exp $
|
||||
* $Id: ddb.h,v 1.20 1998/07/13 06:45:23 bde Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -100,7 +100,7 @@ void db_skip_to_eol __P((void));
|
||||
boolean_t db_stop_at_pc __P((boolean_t *is_breakpoint));
|
||||
#define db_strcpy strcpy
|
||||
void db_trap __P((int type, int code));
|
||||
int db_value_of_name __P((char *name, db_expr_t *valuep));
|
||||
int db_value_of_name __P((const char *name, db_expr_t *valuep));
|
||||
void db_write_bytes __P((vm_offset_t addr, size_t size, char *data));
|
||||
/* machine-dependent */
|
||||
void kdb_init __P((void));
|
||||
|
Loading…
Reference in New Issue
Block a user