[fpc-devel] FPC and valgrind

Colin Western mftq75 at dsl.pipex.com
Mon Sep 19 21:48:29 CEST 2005


I thought the following message on the valgrind users list might be of 
interest - it is in response to a message I posted. (The reply came 
months after the original, so I didn't notice it immediately). I do not 
know how to respond to the question at the end. The first patch at least 
seems to have made it into the 2.4.1 release of valgrind.
Colin

(Original URL: 
<http://sourceforge.net/mailarchive/message.php?msg_id=12412006>)

In message <423D5A41.20408 at ds...>
         C. Western <mftq75 at ds...> wrote:
 
 > My knowledge of stabs is very limited, but with a bit of guess work
 > and some help from a bugzilla report I was able to get valgrind
 > working on my free pascal programs by applying the attached patch to
 > rc4.
 
 Thanks for the report.
 
 > --- ./coregrind/vg_stabs.c.orig	2005-03-12 08:22:46.000000000 +0000
 > +++ ./coregrind/vg_stabs.c	2005-03-19 19:25:21.813549592 +0000
 > @@ -646,6 +646,7 @@
 >        case -27:	type = VG_(st_mkint)(def, 1, True); break;
 >        case -28:	type = VG_(st_mkint)(def, 2, True); break;
 >        case -29:	type = VG_(st_mkint)(def, 4, True); break;
 > +      case -30:	type = VG_(st_mkint)(def, 2, False); break;
 >        case -31:	type = VG_(st_mkint)(def, 8, True); break;
 >        case -32:	type = VG_(st_mkint)(def, 8, False); break;
 >        case -33:	type = VG_(st_mkint)(def, 8, False); break;
 
 I"ve committed this to the valgrind 3.0 SVN repository.
 
 > --- ./coregrind/vg_stabs.c.orig	2005-03-19 21:33:03.000000000 +0000
 > +++ ./coregrind/vg_stabs.c	2005-03-19 21:33:29.000000000 +0000
 > @@ -1610,8 +1610,8 @@
 >  	    scope.nsyms = 0;
 >  	 }
 >  
 > -	 vg_assert(scope.addr != 0);
 > -	 VG_(addScopeInfo)(si, scope.addr, addr, scope.scope);
 > +	 if (scope.addr != 0)
 > +	    VG_(addScopeInfo)(si, scope.addr, addr, scope.scope);
 >  	 
 >  	 /* XXX LEAK: free scope if it or any of its inner scopes was
 >  	    never added to a scope range  */
 
 How did you manage to get a scope at address zero? why do you think
 such a scope should be ignored rather than added - maybe your program
 really does have code at address zero?
 
 Tom


 Tom
 
 -- 
 Tom Hughes (tom at co...)

 http://www.compton.nu/




More information about the fpc-devel mailing list