This is the mail archive of the 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: reversible debugging, enhancements, proposals


yes, I understand that you have mentioned.
perhaps this can be achieved by 'source' command, macros and even probably a 
shell script.

but my point is: it becomes cumbesome for user to go and modify the 
file/.gdbinit macro or script.
it does not provide that facility right on the live terminal (inspecting sort of 
direct machinism such as prin command).

say, for a case,
you have losts of data streuctures like linked list, complex tree, btree etc....
and most of the user is not predetermined to se where he wants to 
would be more comfortable for him if everything he can look on the fly as fast 
and as conveniently as possiblle.


----- Original Message ----
From: Jan Kratochvil <>
To: paawan oza <>
Sent: Fri, October 15, 2010 6:45:34 PM
Subject: Re: reversible debugging, enhancements, proposals

On Fri, 15 Oct 2010 11:30:47 +0200, paawan oza wrote:
> 1) if we want to debug the long linked list chain, we need to to move manually 

> next, next, and so on...
> so if you want to to see 100th node's value, or want to know cerain field's 
> value in all nodes.... (there also could be level of nesting in the list also, 

> for e.g. list->some_field->next  and so on...) then it becomes cumbersome and 
> difficult.
> I am not sure whether that facility is available, but I think it is a very 
> useful feature, if it is not there.

Using this .gdbinit macro:

define plist
    set var $plist_iter=$arg0
    while ($plist_iter)
        if $argc==1
            print *$plist_iter
            if $argc==2
                print $plist_iter->$arg1
                print$arg2 $plist_iter->$arg1
        set var $plist_iter=$plist_iter->next
document plist
List dumper iterating by `->next':
plist <head pointer> [<data field to display>] [/<format>]



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