Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2005-03

FPC and valgrind

6 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

C Western

I tried out valgrind on lazaraus and one of my own lcl programs, and was able to get it working by after applying some small patches to valgrind (which I have sent to the valgrind mailing lists). valgrind found some uninitialised memory reads, which the attached patch fixes.

On a related matter, if I try and look at the stabs info, objdump -g gives errors such as:
Bad stab: defALTPROPNAME:c=s''; (My program)
Bad stab: 3391;-2147483647;2147483647; (lazarus)
though gdb is working fine. (System is Fedora Core 3) Colin

Reply by email

Florian Klaempfl
to C Western
C Western wrote
I tried out valgrind on lazaraus and one of my own lcl programs, and was able to get it working by after applying some small patches to valgrind (which I have sent to the valgrind mailing lists). valgrind found some uninitialised memory reads, which the attached patch fixes.

You could also use the -gv switch, it generates stabs accepted by valgrind.

Reply by email

Colin Western
to Florian Klaempfl
Florian Klaempfl wrote 11 lines
C Western wrote: > I tried out valgrind on lazaraus and one of my own lcl programs, and > was able to get it working by after applying some small patches to > valgrind (which I have sent to the valgrind mailing lists). valgrind > found some uninitialised memory reads, which the attached patch fixes. You could also use the -gv switch, it generates stabs accepted by valgrind.

That works fine also - I guess I should have read the online help. It doen't fix the problem with objdump though objdump -g still gives errors. Colin

Reply by email

Colin Western
to Colin Western

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

C. Western 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.

Show quoted text 10 lines
--- ./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.

Show quoted text 13 lines
--- ./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 () http://www.compton.nu/

Reply by email

Peter Vreman
to Colin Western
Show quoted text 5 lines
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.

Did you use -gv to generate valgrind compatible debuginfo?

Reply by email

Colin Western
to Peter Vreman
Peter Vreman wrote 12 lines
>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. > > Did you use -gv to generate valgrind compatible debuginfo?

No - the post to the valgrind list was before I found out (from the fpc-devel list) about the -gv switch. (I would hope the switch would eventually become uneccesary - it is documented, but I did not even think to look in the documentation for so specific a switch)

Colin

Reply by email