This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: User-defined macros and C string


On Wed, Jul 30, 2003 at 01:47:41PM +0200, Daniel Chiaramello wrote:
> Hi gdb gurus.
> 
> Well, I'm a total gdb newbie, so sorry if the question sounds stupid... 
> I failed to find a forum on which I could post it, so... Here is it!
> 
> I try to define a user-defined macro, to display parameters used when a 
> specific function is called.
> 
> IE there a the following function:
> 
> void dosomething (long theValue, char *theString) {...}
> 
> I want to put a breakpoint on that function and display a line like 
> that:
> "dosomething(10, "coucou");\n"
> each time that function is called.
> 
> Of course, that function is not in my code, and the caller is not 
> either.
> 
> I tried the following:
> define DisplayFunctionCall
> echo dosomething(
> output $r3
> output , \"
> output $r4
> echo \");\n
> end

Try "help printf".  Works just like the C version.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]