[m-dev.] using gdb on the compiler

Julien Fischer juliensf at cs.mu.OZ.AU
Tue Jul 26 01:37:10 AEST 2005



On Tue, 26 Jul 2005, Ian MacLarty wrote:

> I can't seem to get C level debugging working on the compiler.
> I've got the following in my Mmake.params file:
> GRADE=asm_fast.gc.decldebug
> EXTRA_CFLAGS=-O0 -g
> EXTRA_LDFLAGS=-g
> and I run the compiler using the lmc script with MMC_UNDER_GDB=true,
> but I get "no debugging symbols found" messages and no context
> (line no/filenames) in gdb.

Have you told gdb where to find the source files?

> It does know the function names though, but that seems to be all.
>
> I swear I've done the same in the past and it's worked.
> Can anyone tell me what I've missed.

For debugging the deep profiled debugging version of the compiler under
gdb I have the following in my Mmake.params file:

MCFLAGS+=--c-debug
MLFLAGS+=-g
EXTRA_CFLAGS=-g -O0

I'm pretty sure that '--c-debug' is redundant there (in any case I'm
not sure that the '--c-debug' option is working properly at the moment.)

According to a diff of that workspace I've also added '-g' to the LDFLAGS
in trace/Mmakefile (although that may also be redundant.)

Julien.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list