Re: Kill db_sym_t

2017-05-30 Thread Mark Kettenis
> X-Virus-Scanned: by XS4ALL Virus Scanner
> X-Originating-IP: 87.142.3.46
> Date: Tue, 30 May 2017 12:58:21 +0200
> From: Martin Pieuchot 
> 
> We are only supporting ELF so this abstraction type is no longer needed.
> 
> I'll make my life easier with CTF if I don't have to cast types when
> looking for type information.
> 
> Ok to kill this abstraction?

ok kettenis@

> Index: arch/amd64/amd64/db_trace.c
> ===
> RCS file: /cvs/src/sys/arch/amd64/amd64/db_trace.c,v
> retrieving revision 1.30
> diff -u -p -r1.30 db_trace.c
> --- arch/amd64/amd64/db_trace.c   29 May 2017 06:14:10 -  1.30
> +++ arch/amd64/amd64/db_trace.c   30 May 2017 10:26:12 -
> @@ -79,7 +79,7 @@ struct db_variable * db_eregs = db_regs 
>  #define  INTERRUPT   3
>  #define  AST 4
>  
> -int db_numargs(struct callframe *, db_sym_t);
> +int db_numargs(struct callframe *, Elf_Sym *);
>  void db_nextframe(struct callframe **, db_addr_t *, long *, int,
>  int (*) (const char *, ...));
>  
> @@ -92,7 +92,7 @@ void db_nextframe(struct callframe **, d
>   * reliably determine the values currently, just return 0.
>   */
>  int
> -db_numargs(struct callframe *fp, db_sym_t sym)
> +db_numargs(struct callframe *fp, Elf_Sym *sym)
>  {
>  #ifdef DDBCTF
>   int args;
> @@ -231,7 +231,7 @@ db_stack_trace_print(db_expr_t addr, boo
>   unsigned inti;
>   char *  name;
>   db_expr_t   offset;
> - db_sym_tsym;
> + Elf_Sym *   sym;
>  
>   sym = db_search_symbol(callpc, DB_STGY_ANY, &offset);
>   db_symbol_values(sym, &name, NULL);
> @@ -366,7 +366,7 @@ db_save_stack_trace(struct db_stack_trac
>   struct trapframe *tf;
>   char*name;
>   db_expr_t   offset;
> - db_sym_tsym;
> + Elf_Sym *   sym;
>   int is_trap;
>  
>   st->st_pc[st->st_count++] = callpc;
> Index: arch/arm64/arm64/db_trace.c
> ===
> RCS file: /cvs/src/sys/arch/arm64/arm64/db_trace.c,v
> retrieving revision 1.4
> diff -u -p -r1.4 db_trace.c
> --- arch/arm64/arm64/db_trace.c   17 Feb 2017 17:16:04 -  1.4
> +++ arch/arm64/arm64/db_trace.c   30 May 2017 10:26:17 -
> @@ -66,7 +66,7 @@ db_stack_trace_print(db_expr_t addr, int
>   u_int64_t   frame, lastframe, lr, lastlr, sp;
>   charc, *cp = modif;
>   db_expr_t   offset;
> - db_sym_tsym;
> + Elf_Sym *   sym;
>   char*name;
>   boolean_t   kernel_only = TRUE;
>   boolean_t   trace_thread = FALSE;
> Index: arch/hppa/hppa/db_interface.c
> ===
> RCS file: /cvs/src/sys/arch/hppa/hppa/db_interface.c,v
> retrieving revision 1.39
> diff -u -p -r1.39 db_interface.c
> --- arch/hppa/hppa/db_interface.c 30 Apr 2017 16:45:45 -  1.39
> +++ arch/hppa/hppa/db_interface.c 30 May 2017 10:26:24 -
> @@ -227,7 +227,7 @@ db_stack_trace_print(db_expr_t addr, int
>  char *modif, int (*pr)(const char *, ...))
>  {
>   register_t *fp, pc, rp, *argp;
> - db_sym_t sym;
> + Elf_Sym *sym;
>   db_expr_t off;
>   char *name;
>   int nargs;
> Index: arch/i386/i386/db_trace.c
> ===
> RCS file: /cvs/src/sys/arch/i386/i386/db_trace.c,v
> retrieving revision 1.27
> diff -u -p -r1.27 db_trace.c
> --- arch/i386/i386/db_trace.c 29 May 2017 06:14:10 -  1.27
> +++ arch/i386/i386/db_trace.c 30 May 2017 10:26:49 -
> @@ -74,7 +74,7 @@ struct db_variable *db_eregs = db_regs +
>  #define  INTERRUPT   3
>  #define  AST 4
>  
> -int db_numargs(struct callframe *, db_sym_t);
> +int db_numargs(struct callframe *, Elf_Sym *);
>  void db_nextframe(struct callframe **, db_addr_t *, int *, int,
>  int (*pr)(const char *, ...));
>  
> @@ -82,7 +82,7 @@ void db_nextframe(struct callframe **, d
>   * Figure out how many arguments were passed into the frame at "fp".
>   */
>  int
> -db_numargs(struct callframe *fp, db_sym_t sym)
> +db_numargs(struct callframe *fp, Elf_Sym *sym)
>  {
>   int *argp;
>   int inst;
> @@ -236,7 +236,7 @@ db_stack_trace_print(db_expr_t addr, boo
>   int narg;
>   char *  name;
>   db_expr_t   offset;
> - db_sym_tsym;
> + Elf_Sym *sym;
>  
>   sym = db_search_symbol(callpc, DB_STGY_ANY, &offset);
>   db_symbol_values(sym, &name, NULL);
> @@ -339,7 +339,7 @@ db_save_stack_trace(struct db_stack_trac
>   for (i = 0; i < DB_STACK_TRACE_MAX && frame != NULL; i++) {
>   char*name;
>   db_expr_t  

Kill db_sym_t

2017-05-30 Thread Martin Pieuchot
We are only supporting ELF so this abstraction type is no longer needed.

I'll make my life easier with CTF if I don't have to cast types when
looking for type information.

Ok to kill this abstraction?


Index: arch/amd64/amd64/db_trace.c
===
RCS file: /cvs/src/sys/arch/amd64/amd64/db_trace.c,v
retrieving revision 1.30
diff -u -p -r1.30 db_trace.c
--- arch/amd64/amd64/db_trace.c 29 May 2017 06:14:10 -  1.30
+++ arch/amd64/amd64/db_trace.c 30 May 2017 10:26:12 -
@@ -79,7 +79,7 @@ struct db_variable * db_eregs = db_regs 
 #defineINTERRUPT   3
 #defineAST 4
 
-int db_numargs(struct callframe *, db_sym_t);
+int db_numargs(struct callframe *, Elf_Sym *);
 void db_nextframe(struct callframe **, db_addr_t *, long *, int,
 int (*) (const char *, ...));
 
@@ -92,7 +92,7 @@ void db_nextframe(struct callframe **, d
  * reliably determine the values currently, just return 0.
  */
 int
-db_numargs(struct callframe *fp, db_sym_t sym)
+db_numargs(struct callframe *fp, Elf_Sym *sym)
 {
 #ifdef DDBCTF
int args;
@@ -231,7 +231,7 @@ db_stack_trace_print(db_expr_t addr, boo
unsigned inti;
char *  name;
db_expr_t   offset;
-   db_sym_tsym;
+   Elf_Sym *   sym;
 
sym = db_search_symbol(callpc, DB_STGY_ANY, &offset);
db_symbol_values(sym, &name, NULL);
@@ -366,7 +366,7 @@ db_save_stack_trace(struct db_stack_trac
struct trapframe *tf;
char*name;
db_expr_t   offset;
-   db_sym_tsym;
+   Elf_Sym *   sym;
int is_trap;
 
st->st_pc[st->st_count++] = callpc;
Index: arch/arm64/arm64/db_trace.c
===
RCS file: /cvs/src/sys/arch/arm64/arm64/db_trace.c,v
retrieving revision 1.4
diff -u -p -r1.4 db_trace.c
--- arch/arm64/arm64/db_trace.c 17 Feb 2017 17:16:04 -  1.4
+++ arch/arm64/arm64/db_trace.c 30 May 2017 10:26:17 -
@@ -66,7 +66,7 @@ db_stack_trace_print(db_expr_t addr, int
u_int64_t   frame, lastframe, lr, lastlr, sp;
charc, *cp = modif;
db_expr_t   offset;
-   db_sym_tsym;
+   Elf_Sym *   sym;
char*name;
boolean_t   kernel_only = TRUE;
boolean_t   trace_thread = FALSE;
Index: arch/hppa/hppa/db_interface.c
===
RCS file: /cvs/src/sys/arch/hppa/hppa/db_interface.c,v
retrieving revision 1.39
diff -u -p -r1.39 db_interface.c
--- arch/hppa/hppa/db_interface.c   30 Apr 2017 16:45:45 -  1.39
+++ arch/hppa/hppa/db_interface.c   30 May 2017 10:26:24 -
@@ -227,7 +227,7 @@ db_stack_trace_print(db_expr_t addr, int
 char *modif, int (*pr)(const char *, ...))
 {
register_t *fp, pc, rp, *argp;
-   db_sym_t sym;
+   Elf_Sym *sym;
db_expr_t off;
char *name;
int nargs;
Index: arch/i386/i386/db_trace.c
===
RCS file: /cvs/src/sys/arch/i386/i386/db_trace.c,v
retrieving revision 1.27
diff -u -p -r1.27 db_trace.c
--- arch/i386/i386/db_trace.c   29 May 2017 06:14:10 -  1.27
+++ arch/i386/i386/db_trace.c   30 May 2017 10:26:49 -
@@ -74,7 +74,7 @@ struct db_variable *db_eregs = db_regs +
 #defineINTERRUPT   3
 #defineAST 4
 
-int db_numargs(struct callframe *, db_sym_t);
+int db_numargs(struct callframe *, Elf_Sym *);
 void db_nextframe(struct callframe **, db_addr_t *, int *, int,
 int (*pr)(const char *, ...));
 
@@ -82,7 +82,7 @@ void db_nextframe(struct callframe **, d
  * Figure out how many arguments were passed into the frame at "fp".
  */
 int
-db_numargs(struct callframe *fp, db_sym_t sym)
+db_numargs(struct callframe *fp, Elf_Sym *sym)
 {
int *argp;
int inst;
@@ -236,7 +236,7 @@ db_stack_trace_print(db_expr_t addr, boo
int narg;
char *  name;
db_expr_t   offset;
-   db_sym_tsym;
+   Elf_Sym *sym;
 
sym = db_search_symbol(callpc, DB_STGY_ANY, &offset);
db_symbol_values(sym, &name, NULL);
@@ -339,7 +339,7 @@ db_save_stack_trace(struct db_stack_trac
for (i = 0; i < DB_STACK_TRACE_MAX && frame != NULL; i++) {
char*name;
db_expr_t   offset;
-   db_sym_tsym;
+   Elf_Sym *sym;
int is_trap = 0;
 
st->st_pc[st->st_count++] = callpc;
Index: arch/m88k/m88k/db_trace.c
===
RCS file: /cvs/src/sys/arch/m88k