On Mon, Jul 12, 2021 at 08:18:20PM +0200, Mark Kettenis wrote:
> > Date: Mon, 12 Jul 2021 20:11:30 +0200
> > From: Jasper Lievisse Adriaanse <j...@jasper.la>
> > 
> > On Sun, Jul 11, 2021 at 03:58:05PM +0200, Jasper Lievisse Adriaanse wrote:
> > > Hi,
> > > 
> > > When printing a trace from ddb, some architectures are limited by the 
> > > number of
> > > registers which are used to pass arguments. If the number of arguments to 
> > > a function
> > > exceeded this number, the code in db_stack_trace_print() would print that 
> > > many arguments
> > > without any indication that one or more arguments aren't printed.
> > > 
> > > Here's a diff that tweaks the output to make it clear there were more 
> > > arguments.
> > > Do we want to print ',...' for each ommited argument (like this diff does)
> > > or perhaps just a single ',...'?
> > 
> > I think just printing a single instance of ',...' gets the point across.
> > OK?
> 
> Actually, since we use -msave-args on amd64 the arguments are saved on
> the stack.  I think this means there is no limit on the number of
> arguments we can print...
Good point, there's no reason to cap narg at 6 any longer unless 
db_ctf_func_numargs()
failed. Here's the diff for amd64. Other platforms could benefit from the
",..." approach but those'll be separate diffs.

OK?

Index: db_trace.c
===================================================================
RCS file: /cvs/src/sys/arch/amd64/amd64/db_trace.c,v
retrieving revision 1.53
diff -u -p -r1.53 db_trace.c
--- db_trace.c  14 May 2020 06:58:54 -0000      1.53
+++ db_trace.c  30 Aug 2021 08:44:36 -0000
@@ -164,8 +164,7 @@ db_stack_trace_print(db_expr_t addr, int
                        }
                }
 
-               narg = db_ctf_func_numargs(sym);
-               if (narg < 0 || narg > 6)
+               if ((narg = db_ctf_func_numargs(sym)) < 0)
                        narg = 6;
 
                if (name == NULL)

Reply via email to