[mercury-users] Re: Valgrind

Ondrej Bojar oboj7042 at ss1000.ms.mff.cuni.cz
Fri Mar 28 19:34:46 AEDT 2003


Hi.

I've installed valgrind, but it doesn't do anything when used on the
Mercury binary, it gets never called. (It works on plain C program.)

What options should I use to link the binary with the hooks for valgrind?
(I have no experience with dynamic linking etc...)

This is the mmake of a hello_world program in Mercury:

klokan:clipmerc$mmake hello
mmc --compile-to-c --high-level-code          hello > hello.err 2>&1
mgnuc --high-level-code     -v   --      -c hello.c -o hello.o
gcc -I/usr/local/mercury-rotd-2003-03-03/lib/mercury/conf
-I/usr/local/mercury-rotd-2003-03-03/lib/mercury/inc
-I/usr/local/mercury-rotd-2003-03-03/lib/mercury/lib/hlc.gc/i686-pc-linux-gnu/inc
-ansi -Wall -Wwrite-strings -Wshadow -Wstrict-prototypes
-Wmissing-prototypes -Wno-unused -Wno-uninitialized -O2
-fomit-frame-pointer -DMR_HIGHLEVEL_CODE -DMR_CONSERVATIVE_GC
-DMR_BOEHM_GC -DNO_SIGNALS -c hello.c -o hello.o
ml --high-level-code     -v         --    -o hello hello_init.o \
        hello.o \

ml: using grade `hlc.gc'
gcc -s -static -Wl-defsym -Wl_DYNAMIC=0 -o hello hello_init.o hello.o
-L/usr/local/mercury-rotd-2003-03-03/lib/mercury/lib/hlc.gc/i686-pc-linux-gnu
-L/usr/local/mercury-rotd-2003-03-03/lib/mercury/lib/i686-pc-linux-gnu
-L/usr/local/lib
/usr/local/mercury-rotd-2003-03-03/lib/mercury/lib/hlc.gc/i686-pc-linux-gnu/libmer_std.a
/usr/local/mercury-rotd-2003-03-03/lib/mercury/lib/hlc.gc/i686-pc-linux-gnu/libmer_rt.a
/usr/local/mercury-rotd-2003-03-03/lib/mercury/lib/i686-pc-linux-gnu/libgc.a
-lm |
mdemangle
klokan:clipmerc$valgrind ./hello
Hello.

As you see, there is no message from valgrind.

Thanks for help, Andrew.



On Thu, 27 Mar 2003, Nicholas Nethercote wrote:
> > I'd be very grateful to anybody who would wish to try to reproduce the bug
> > or possibly suggest any hint. I've tried to use mpatrol or efence to watch
> > for any heap misuse, but I was not able to link any of the libraries
> > together with the code from Mercury. Is anybody aware of any library
> > compatible with Mercury to perform such checks?
>
> Have you tried Valgrind?  See developer.kde.org/~sewardj/
>
> You won't have any linking problems because it does all that stuff for you
> dynamically -- you just have to run:
>
>   valgrind <name-of-prog>
>
> It should give more information than mpatrol and efence.  I recommend
> version 1.9.4 rather than the "stable" 1.0.4;  1.9.4 is actually more
> stable.
>
> N
>
>
>
>
> --------------------------------------------------------------------------
> mercury-users mailing list
> post:  mercury-users at cs.mu.oz.au
> administrative address: owner-mercury-users at cs.mu.oz.au
> unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
> subscribe:   Address: mercury-users-request at cs.mu.oz.au Message: subscribe
> --------------------------------------------------------------------------
>

--------------------------------------------------------------------------
mercury-users mailing list
post:  mercury-users at cs.mu.oz.au
administrative address: owner-mercury-users at cs.mu.oz.au
unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-users-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the users mailing list