Insight-gdb crash + fix

Robert B. Scher r.scher at varilog.com
Wed Jun 5 20:28:20 CEST 2002


Hello.

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)
gpc-19990118.

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 
ftp://sources.redhat.com/pub/gdb/releases/insight-5.2.tar.bz2

I just submitted a problem report to the insight developers - we'll see
what they say.

Here's the patch:

1,12d0
< /* modified 5/31/02 Robert Scher.  Changes flagged with "RBS".  
<
Works around a problem encountered when reading executables produced
< by
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.
< */
<

1613c1601
< 	  {	
---
> 	  {
1641d1628
< 
1652a1640
> 
2767,2771c2755
< //
start RBS patch:  check to prevent popping garbage when depth is already
0
< 	  if (!context_stack_depth)
< 		break; // ignore it!
< // end RBS
patch
<   	  new = pop_context ();
---
> 	  new = pop_context ();


Bob Scher




More information about the Gpc mailing list