Re: [GD-Linux] signals and exceptions
Brought to you by:
vexxed72
|
From: Mads B. D. <ma...@ch...> - 2001-11-17 10:55:37
|
On Fri, 16 Nov 2001, D. Stimits wrote:
> Now maybe someone could answer this; I added -rdynamic and it improved
> the output by naming functions, but the arguments to the function were
> still not useful, they still look like offsets rather than what my
> sample had (like calling a function with an int of 1, then 2, then 3, so
> on...and showing up as something far different). Is there some way to
> expand on this debugging to get even more information, such as local
> variable values and formatted (meaningful) argument call values?
I am sorry I do not know the answer to your question. gdb can do this, so
I suppose there is a way to do it, although I do not know if there are any
built in functions you can use.
I did write a simple perl script to demangle c++ names and get file:line
information, which follows here:
#!/usr/bin/perl -w
# Get the program name for the addr2line program
$program = shift(@ARGV);
if (!defined $program || "" eq $program) {
print STDERR "Usage: $0 <program>\n";
exit 1;
}
while(<>) {
if (m/\((.+)\+0x[[:xdigit:]]+\) \[(0x[[:xdigit:]]+)\]/) {
$function = `c++filt $1`;
chop($function);
$line = `addr2line -e $program $2`;
chop($line);
print "$function ($line)\n";
} else {
print STDERR "Warning: No match for $_";
}
}
Maybe it can be useful to you (or someone else).
Mads
--
Mads Bondo Dydensborg. ma...@ch...
A few months ago, I was talking to Raymond on the phone, when I called a
computer criminal a "hacker" instead of a "cracker." He hung up on me.
- John Marcotte
|