summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authordg <dg@FreeBSD.org>1995-12-22 07:09:24 +0000
committerdg <dg@FreeBSD.org>1995-12-22 07:09:24 +0000
commitaedbbb89f51ff31512cf2de37ba6ad8becf26f31 (patch)
treeb516635a9695b3a10f60a458b200f897a0a912c0 /sys
parent8b1324427f0ff1e20693e95352e7729c998a5e47 (diff)
downloadFreeBSD-src-aedbbb89f51ff31512cf2de37ba6ad8becf26f31.zip
FreeBSD-src-aedbbb89f51ff31512cf2de37ba6ad8becf26f31.tar.gz
Fix a small logic bug that caused the arguments of the previous frame to
be used instead of the ones for the current frame if a breakpoint had been set at the entry to a function.
Diffstat (limited to 'sys')
-rw-r--r--sys/amd64/amd64/db_trace.c9
-rw-r--r--sys/i386/i386/db_trace.c9
2 files changed, 12 insertions, 6 deletions
diff --git a/sys/amd64/amd64/db_trace.c b/sys/amd64/amd64/db_trace.c
index 77fe236..9b95948 100644
--- a/sys/amd64/amd64/db_trace.c
+++ b/sys/amd64/amd64/db_trace.c
@@ -23,7 +23,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
- * $Id: db_trace.c,v 1.12 1995/11/24 13:27:24 bde Exp $
+ * $Id: db_trace.c,v 1.13 1995/12/21 19:20:55 davidg Exp $
*/
#include <sys/param.h>
@@ -255,7 +255,6 @@ db_stack_trace_cmd(addr, have_addr, count, modif)
sym = db_search_symbol(callpc, DB_STGY_ANY, &offset);
db_symbol_values(sym, &name, NULL);
- argp = &frame->f_arg0;
if (lastframe == NULL && sym == NULL) {
/* Symbol not found, peek at code */
int instr = db_get_value(callpc, 4, FALSE);
@@ -266,9 +265,13 @@ db_stack_trace_cmd(addr, have_addr, count, modif)
/* enter+1: movl %esp, %ebp */
(instr & 0x0000ffff) == 0x0000e589) {
offset = 0;
- argp = &((struct i386_frame *)(ddb_regs.tf_esp-4))->f_arg0;
}
}
+ if (lastframe == NULL && offset == 0 && !have_addr)
+ argp = &((struct i386_frame *)(ddb_regs.tf_esp-4))->f_arg0;
+ else
+ argp = &frame->f_arg0;
+
narg = MAXNARG;
if (sym != NULL && db_sym_numargs(sym, &narg, argnames)) {
argnp = argnames;
diff --git a/sys/i386/i386/db_trace.c b/sys/i386/i386/db_trace.c
index 77fe236..9b95948 100644
--- a/sys/i386/i386/db_trace.c
+++ b/sys/i386/i386/db_trace.c
@@ -23,7 +23,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
- * $Id: db_trace.c,v 1.12 1995/11/24 13:27:24 bde Exp $
+ * $Id: db_trace.c,v 1.13 1995/12/21 19:20:55 davidg Exp $
*/
#include <sys/param.h>
@@ -255,7 +255,6 @@ db_stack_trace_cmd(addr, have_addr, count, modif)
sym = db_search_symbol(callpc, DB_STGY_ANY, &offset);
db_symbol_values(sym, &name, NULL);
- argp = &frame->f_arg0;
if (lastframe == NULL && sym == NULL) {
/* Symbol not found, peek at code */
int instr = db_get_value(callpc, 4, FALSE);
@@ -266,9 +265,13 @@ db_stack_trace_cmd(addr, have_addr, count, modif)
/* enter+1: movl %esp, %ebp */
(instr & 0x0000ffff) == 0x0000e589) {
offset = 0;
- argp = &((struct i386_frame *)(ddb_regs.tf_esp-4))->f_arg0;
}
}
+ if (lastframe == NULL && offset == 0 && !have_addr)
+ argp = &((struct i386_frame *)(ddb_regs.tf_esp-4))->f_arg0;
+ else
+ argp = &frame->f_arg0;
+
narg = MAXNARG;
if (sym != NULL && db_sym_numargs(sym, &narg, argnames)) {
argnp = argnames;
OpenPOWER on IntegriCloud