This is the mail archive of the gdb@sourceware.org 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: automated trace output with gdb


Ok, I'm trying it, and it seems to be working - so far, speed isn't
really that great (ie: perl's tracemode in *its* debugger is faster,
line per line, in tracing perl code), but it's workable, with caveat.
For some things it'd be really painful (eg: debugging vim)

Just for future record, here are the commands that I used, and they
have to be done in the right order:

(gdb) set logging redirect on
(gdb) set logging file 'myfile'
(gdb) set logging on
(gdb) set pagination off
(gdb) b <certain_point>
(gdb) while 1
> step
> end

If they aren't in this order, then the behavior is indeterminate, and
if pagination isn't set off, you get 'hit <return> to continue' even
though everything else goes to the file..

I don't know - all in all, IMO this should be a feature of gdb itself,
just for simplicity's sake, and to avoid the overhead of the scripting
language. I'm just guessing, but I'd bet that if this was done in a
tight loop, it would be an order of magnitude faster..

Thanks,

Ed

On Wed, Oct 29, 2008 at 10:57 AM, Michael Snyder <msnyder@vmware.com> wrote:
> Edward Peschko wrote:
>>
>> Michael,
>>
>> Just curious, but how do you redirect the output to a file using that
>> script?
>
> Set logging, set logging file...
>
>> And how fast is it (ie: say I'm stepping through thousands of
>>
>> steps.)
>
> Well... it's as fast as it is.  The only way to find out
> if it's fast enough to suit you is to try it.
>
>
>
>


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