Path: utzoo!utgpu!attcan!uunet!husc6!cmcl2!nrl-cmf!ames!amdahl!pyramid!hplabs!hp-pcd!hpcvlx!nathanm
From: nathanm@hpcvlx.HP.COM (Nathan K. Meyers)
Newsgroups: comp.sys.hp
Subject: Re: cdb debugger on HP9000/300
Message-ID: <101950004@hpcvlx.HP.COM>
Date: 28 Sep 88 23:50:24 GMT
References: <13705@joyce.istc.sri.com>
Organization: Hewlett-Packard Co., Corvallis, OR, USA
Lines: 20

>   I'm wondering (among other things) why a stack trace (`t' command)
>   shows that all functions other than those declared within the program
>   being debugged take 5 paramaters.  I have routines I've written and
>   made into a library being shown as having 5 paramaters, when I know
>   they have less than that.  Is this a bug or a feature?

A feature.  If cdb doesn't have the debugging information on a routine,
it defaults to showing 5 parameters.  There's nothing in C to identify
at run time how much of the stack is devoted to arguments or what type
the arguments are, so cdb just shows you the top 5 integers on the
stack.

If you want, you can put debuggable code into libraries.  The ar(1)
utility works just as well on object files compiled with the -g option
as on any other -- the result will be a much bigger library, of course.
You will then get meaningful stack trace information for the library
files (whether or not cdb finds the library sources).

Nathan Meyers
nathanm@hp-pcd.hp.com