summaryrefslogtreecommitdiffstats
path: root/sys/i386
diff options
context:
space:
mode:
authoryar <yar@FreeBSD.org>2006-06-16 11:49:37 +0000
committeryar <yar@FreeBSD.org>2006-06-16 11:49:37 +0000
commit4d78a1cd9f20ee572e3fab79bdc155c04a833f0e (patch)
tree372beb84edfc15709b8436a38eb8e0fef0501269 /sys/i386
parentc1070bda2aaf29c4127e1769285606e78e5f0a07 (diff)
downloadFreeBSD-src-4d78a1cd9f20ee572e3fab79bdc155c04a833f0e.zip
FreeBSD-src-4d78a1cd9f20ee572e3fab79bdc155c04a833f0e.tar.gz
Return -1 from db_numargs() if number of args couldn't be guessed.
Use this later to indicate in backtrace output that args shown are uncertain. Sponsored by: RiNet (Cronyx Plus LLC)
Diffstat (limited to 'sys/i386')
-rw-r--r--sys/i386/i386/db_trace.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/sys/i386/i386/db_trace.c b/sys/i386/i386/db_trace.c
index 91e91a0..99f941b 100644
--- a/sys/i386/i386/db_trace.c
+++ b/sys/i386/i386/db_trace.c
@@ -212,7 +212,7 @@ db_numargs(fp)
* may require better fault handling.
*/
if (argp < btext || argp >= etext) {
- args = 5;
+ args = -1;
} else {
retry:
inst = db_get_value((int)argp, 4, FALSE);
@@ -224,7 +224,7 @@ retry:
argp += 2;
goto retry;
} else
- args = 5;
+ args = -1;
}
return (args);
}
@@ -237,15 +237,19 @@ db_print_stack_entry(name, narg, argnp, argp, callpc)
int *argp;
db_addr_t callpc;
{
+ int n = narg >= 0 ? narg : 5;
+
db_printf("%s(", name);
- while (narg) {
+ while (n) {
if (argnp)
db_printf("%s=", *argnp++);
db_printf("%r", db_get_value((int)argp, 4, FALSE));
argp++;
- if (--narg != 0)
+ if (--n != 0)
db_printf(",");
}
+ if (narg < 0)
+ db_printf(",...");
db_printf(") at ");
db_printsym(callpc, DB_STGY_PROC);
db_printf("\n");
OpenPOWER on IntegriCloud