Re: [Rd] Viewing R objects in gdb

From: Luke Tierney <luke_at_stat.uiowa.edu>
Date: Wed 29 Jun 2005 - 18:06:39 GMT

On Wed, 29 Jun 2005, Duncan Murdoch wrote:

> I'm trying to track down a bug in some experimental code, where an
> object's attribute is getting messed up. This means I'd like to examine
> R objects while within gdb.
>
> One of the things I'd like to do is to examine the names of all the
> attributes. This is exactly what an example in the R Extensions manual
> section 4.11.2 "Inspecting R objects when debugging" does, but the code
> there doesn't work, presumably because the R internals have changed
> since it was written.
>
> Specifically, I get
>
> (gdb) p $a->u.listsxp.tagval->u.symsxp.pname->u.vecsxp.type.c
> Error: There is no member named vecsxp.
>

Something like this I think (untested):

         p ((VECSEXP)$a->u.listsxp.tagval->u.symsxp.pname)->vecsxp.type.c

luke

> where $a was set to be the attrib member of an SEXP.
>
> Could someone let me know what needs to be fixed for this to work? I
> imagine it's a typecast, but I haven't been able to put it together.
>
> (An example using R_PV to print the attributes of an SEXP would also be
> welcome, but I can probably figure that one out once I get this...)
>
> Duncan Murdoch
>
> ______________________________________________
> R-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>

-- 
Luke Tierney
Chair, Statistics and Actuarial Science
Ralph E. Wareham Professor of Mathematical Sciences
University of Iowa                  Phone:             319-335-3386
Department of Statistics and        Fax:               319-335-3017
    Actuarial Science
241 Schaeffer Hall                  email:      luke@stat.uiowa.edu
Iowa City, IA 52242                 WWW:  http://www.stat.uiowa.edu

______________________________________________
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Received on Thu Jun 30 04:09:05 2005

This archive was generated by hypermail 2.1.8 : Mon 20 Feb 2006 - 03:21:09 GMT