[Rd] is there a dump complete object c routine ?

Kevin B. Hendricks kevin.hendricks at sympatico.ca
Sun Jun 4 18:35:00 CEST 2006


Hi,

I am working my way through R-exts.pdf and have found R_PV but it  
does not do a full dump of an object.

So I was wondering since I can call C code from with gdb (with call)  
if there was a routine someplace that somebody has that would dump  
all of the objects and fields and any important values for all of the  
subobjects in a main object.

What I am looking for is something that would print out more than the  
one level generated by
print * (SEXP) v  in gdb and that would point out relevant addresses  
in hex, actual symbol values and addresses of the strings, string  
values, etc.  It would then do the same for any and all objects that  
make up the entire structure.

This would certainly help in understanding the relationships and  
walking the list of v->u.listsxp.carval and the like it really not  
fun after a while.

I think the code in compute_identical which walks the object lists  
and checks for equality would be a good starting point for making  
such a routine if it does not already exist.

Then using the call() function in gdb, I could see the named values  
and the like for all of the objects tied to the main object in some way.

Does anyone have a snippet of code that does something like this?

I can think of a number of debug helper routines (like having a  
DEBUG_SET_NAMED and the like) that could be created and a dump  
complete object routine, that would make life inside the low levels  
much easier to follow.

Thanks,

Kevin



More information about the R-devel mailing list