diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2007-02-20 00:38:53 +0000 |
---|---|---|
committer | Thomas Schwinge <tschwinge@gnu.org> | 2009-06-18 00:27:05 +0200 |
commit | 0bc0998d4226ba46cd564e919b51bbb4e4d784d7 (patch) | |
tree | 158a1e2b8de9d47cf4cfd4d3fc34acf943941dea /i386 | |
parent | bad9f4c53148a65138128ad8683d689535eca878 (diff) |
2007-02-20 Samuel Thibault <samuel.thibault@ens-lyon.org>
Fix ddb's trace command.
* i386/i386/db_trace.c (db_find_trace_symbols): Drop _ prefix on ELF
targets.
(db_i386_stack_trace): Check that adresses of known functions were
really found.
Diffstat (limited to 'i386')
-rw-r--r-- | i386/i386/db_trace.c | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/i386/i386/db_trace.c b/i386/i386/db_trace.c index d1c9512..aad305c 100644 --- a/i386/i386/db_trace.c +++ b/i386/i386/db_trace.c @@ -183,16 +183,22 @@ void db_find_trace_symbols(void) { db_expr_t value; - if (db_value_of_name("_user_trap", &value)) +#ifdef __ELF__ +#define P +#else +#define P "_" +#endif + if (db_value_of_name(P"user_trap", &value)) db_user_trap_symbol_value = (db_addr_t) value; - if (db_value_of_name("_kernel_trap", &value)) + if (db_value_of_name(P"kernel_trap", &value)) db_kernel_trap_symbol_value = (db_addr_t) value; - if (db_value_of_name("_interrupt", &value)) + if (db_value_of_name(P"interrupt", &value)) db_interrupt_symbol_value = (db_addr_t) value; - if (db_value_of_name("_return_to_iret", &value)) + if (db_value_of_name(P"return_to_iret", &value)) db_return_to_iret_symbol_value = (db_addr_t) value; - if (db_value_of_name("_syscall", &value)) + if (db_value_of_name(P"syscall", &value)) db_syscall_symbol_value = (db_addr_t) value; +#undef P db_trace_symbols_found = TRUE; } @@ -450,14 +456,14 @@ db_i386_stack_trace( DB_STGY_XTRN, (db_addr_t *)&offset, TASK_NULL), &name, (db_expr_t *)&call_func); - if (call_func == db_user_trap_symbol_value || - call_func == db_kernel_trap_symbol_value) { + if ((db_user_trap_symbol_value && call_func == db_user_trap_symbol_value) || + (db_kernel_trap_symbol_value && call_func == db_kernel_trap_symbol_value)) { frame_type = TRAP; narg = 1; - } else if (call_func == db_interrupt_symbol_value) { + } else if (db_interrupt_symbol_value && call_func == db_interrupt_symbol_value) { frame_type = INTERRUPT; goto next_frame; - } else if (call_func == db_syscall_symbol_value) { + } else if (db_syscall_symbol_value && call_func == db_syscall_symbol_value) { frame_type = SYSCALL; goto next_frame; } else { |