Insight-gdb crash + fix
Robert B. Scher
r.scher at varilog.com
Wed Jun 5 20:28:20 CEST 2002
Hopefully this will be of interest to some of you - if not, my apologies if
I am off-topic.
I found that when trying to use the "insight gdb" visual debugger on a
binary made using (my locally built) GPC 2.1, the debugger crashes while
performing an initial read of the "stabs" info in the binary. But it
doesn't crash on binaries made from the (Redhat distributed binary)
I'm not 100% sure that this is an insight gdb problem - it might take a
stabs expert to decide whether insight's logic is correct here or whether
there's anything invalid about the stabs sequence emitted by gpc. In any
case, below is a simple patch of insight to work around the problem. It
works for a couple of multi-module gpc programs that I've tried it with.
BTW, the debugger source is
I just submitted a problem report to the insight developers - we'll see
what they say.
Here's the patch:
< /* modified 5/31/02 Robert Scher. Changes flagged with "RBS".
Works around a problem encountered when reading executables produced
gpc (Gnu Pascal) version 2.1. Without this change - or hopefully
< a more
proper correction that attacks the problem head-on,
< the "insight"
(graphical) variant of gdb crashes at the point where it
< reads the stabs
section associated with the file error.pas in the
< gpc 2.1 support files
set. This is a problem peculiar to the graphical
< mode (and has been seen
on several versions of "insight").
< insight running in non-graphical mode
(with the --nowin flag ) does
< not exhibit this problem.
start RBS patch: check to prevent popping garbage when depth is already
< if (!context_stack_depth)
< break; // ignore it!
< // end RBS
< new = pop_context ();
> new = pop_context ();
More information about the Gpc