Mail Archives: djgpp/1999/07/17/07:03:20
Hello.
While trying to build and debug a program yesterday, I experienced a
strange problem with the debugging information. I compiled & linked with
gcc's -g flag, but gdb could not find the line number information for any
of the functions. I tried changing -g to -g3, but this made no difference.
Trying -ggdb allowed me to do 'l main' and similar successfully. Why is
this?
I couldn't see what I was doing wrong, because all my other programs use
-g to add debug info! I don't know if this is relevant, but the source
code, httpsync.c, is ~48K.
Here is the Makefile, with -g changed to -ggdb:
# Makefile for httpsync
# Written by Richard Dawe <richdawe AT bigfoot DOT com>
CFLAGS = -Wall -ggdb -I../lsck/include
LDFLAGS = -ggdb -L../lsck/lib
LIBS = -lsocket
httpsync: httpsync.o
$(CC) $(LDFLAGS) -o $@ $< $(LIBS)
%.o: %.c
$(CC) $(CFLAGS) -c $<
[ BTW: libsocket is installed in the directory specified by the -I & -L
options. ]
Please reply by mail too, because I do not have newsgroup access right
now.
Bye, yours confusedly,
--
--------------+----------------------+------------------------------------
Richard Dawe | richdawe AT bigfoot DOT com | http://www.bigfoot.com/~richdawe/
--------------+----------------------+------------------------------------
- Raw text -