User-defined macros and C string

Daniel Chiaramello dchiaramello@madwaves.com
Wed Jul 30 13:14:00 GMT 2003


Thanks, that's exactly what I needed!!!

Daniel.

Le mercredi, 30 juil 2003, à 14:56 Europe/Paris, Daniel Jacobowitz a 
écrit :

> 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
>



More information about the Gdb mailing list