lbartnik / rgdbprinter

Pretty-printer for R in GDB
MIT License
7 stars 2 forks source link

gdb.error There is no member named sxpinfo #1

Open AndreMikulec opened 5 years ago

AndreMikulec commented 5 years ago

Hi , I am trying to run "printer.py" I am getting an error. I am lost on how to fix it.

gdb> show directories

[debug]> show directories
[debug]Source directories searched: W:/R-3.5._/codeblocksMeta/CodeBlocks/out;$cdir;$cwd
[debug]>>>>>>cb_gdb:

Source directories searched: W:/R-3.5._/codeblocksMeta/CodeBlocks/out;$cdir;$cwd

I put the file there and source it

gdb> source printer.py

I debug through my code Just AFTER I execute the following statement . . .

#include <R.h>
#include <Rinternals.h>
. . . 
SEXP ans = PROTECT(allocMatrix(REALSXP, nx, ny));

I try to print. I get the following error.

[debug]> print ans
[debug]Python Exception <class 'gdb.error'> There is no member named sxpinfo.: 
[debug]Python Exception <class 'gdb.error'> There is no member named sxpinfo.: 
[debug]$4 = (SEXP) 0xb4f5e30
[debug]>>>>>>cb_gdb:

Python Exception <class 'gdb.error'> There is no member named sxpinfo.: 
Python Exception <class 'gdb.error'> There is no member named sxpinfo.: 
$4 = (SEXP) 0xb4f5e30

I try to source back in printer.py. I get the following error.

[debug]> source printer.py
[debug]Traceback (most recent call last):
[debug]  File "printer.py", line 48, in <module>
[debug]    class Types:
[debug]  File "printer.py", line 55, in Types
[debug]    sexp_ptr_t    = gdb.lookup_type('SEXP').pointer()
[debug]gdb.error: No type named SEXP.
[debug]>>>>>>cb_gdb:

Traceback (most recent call last):
  File "printer.py", line 48, in <module>
    class Types:
  File "printer.py", line 55, in Types
    sexp_ptr_t    = gdb.lookup_type('SEXP').pointer()
gdb.error: No type named SEXP.

What am I doing wrong?

I am a python-gdb newbie.

Thanks, Andre

lbartnik commented 5 years ago

Hi Andre, which OS are you using? I tested this only in Linux. I believe that it worked with the release build of R (no debug symbols) but at the same time the binary wasn't completely stripped. Where do you get your R binaries from?

AndreMikulec commented 5 years ago

Łukasz,

Thanks for the response. My platform is windows.

I also, compiled from source with many debugging symbols. I may have narrowed down the problem to "not getting debugging symbols (from R.exe). I submitted the question to r-devel.

Thanks, Andre

lbartnik commented 5 years ago

TBH, I don't know if it will even work in Windows. I think R is still compiled with gdb but I don't know if gdb uses the same internal Python API to inspect debugee. I'm sorry, I have just never tested this little script under Windows.