Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

Journal of jjore (6662)

Sunday March 22, 2009
01:06 AM

Feeding types to gdb

[ #38682 ]

Recently I've been frustrated that it's inconvenient to debug non-debugging perl. I just learned that as long as I compile something with XS code with -g, then gdb does get the info anyway.

gdb -q /opt/perl-5.10.0/bin/perl
Reading symbols for shared libraries .... done
(gdb) run -MSomething -edump
Starting program: /opt/perl-5.10.0/bin/perl -Mblib -MSomething -edump
Reading symbols for shared libraries +++. done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
 
Program received signal SIGABRT, Aborted.
0x93c24e42 in __kill ()
(gdb) p PL_sv_arenaroot
$1 = <unknown type>
(gdb) p *(struct sv*)PL_sv_arenaroot
$3 = {
  sv_any = 0x833200,
  sv_refcnt = 128,
  sv_flags = 0,
  sv_u = {
    svu_iv = 0,
    svu_uv = 0,
    svu_rv = 0x0,
    svu_pv = 0x0,
    svu_array = 0x0,
    svu_hash = 0x0,
    svu_gp = 0x0
  }
}

I never figured out how to manually create a symbol file for perl. That'd be nice. You know, without just recompiling.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.