I have a project which I am working on and it has multiple files and I use make to compile the project. Here is the makefile
CC = /opt/gcc-4.7-cilkplus/bin/gcc
CFLAGS = -ggdb3 -Wall
COMPLILEFLAGS = `mysql_config --include` -I/opt/gcc-4.7-cilkplus/include/
LINKERINFO = `mysql_config --cflags --libs` -lrt -lm -lz
CILKFLAGS = -lcilkrts
# To be provided at the commandline
DIR = './bloom'
MODE = '2'
FILENAME = 'database.info'
exec: main.o mysql-client.o databaseConnection-common.o murmurhash3.o bloom-filter.o md5.o auxilary-functions.o
$(CC) $(CFLAGS) -o exec main.o mysql-client.o databaseConnection-common.o murmurhash3.o bloom-filter.o \
md5.o auxilary-functions.c $(LINKERINFO) $(CILKFLAGS)
main.o: main.c mysql-client.h databaseConnection-common.h bloom-filter.h
$(CC) $(CFLAGS) $(COMPLILEFLAGS) -c main.c $(CILKFLAGS)
bloom-filter.o: bloom-filter.c bloom-filter.h murmurhash3.h auxilary-functions.h
$(CC) $(CFLAGS) $(COMPLILEFLAGS) -c bloom-filter.c
murmurhash3.o: murmurhash3.c murmurhash3.h
$(CC) $(CFLAGS) -c murmurhash3.c
md5.o: md5.c md5.h
$(CC) $(CFLAGS) -c md5.c
mysql-client.o: mysql-client.c mysql-client.h databaseConnection-common.h
$(CC) $(CFLAGS) $(COMPLILEFLAGS) -c mysql-client.c
databaseConnection-common.o: databaseConnection-common.c databaseConnection-common.h
$(CC) $(CFLAGS) $(COMPLILEFLAGS) -c databaseConnection-common.c
auxilary-functions.o: auxilary-functions.h auxilary-functions.c
$(CC) $(CFLAGS) -c auxilary-functions.c
run:
./exec $(MODE) $(FILENAME) $(DIR)
I set breakpoint
at some location and then do next
form there but I get
Single stepping until exit from function bf_dup_eleminate_read,
which has no line number information.
bf_dup_eleminate_read
is a function in bloom-filter.c
. I cannot understand why this is happening even if bloom-filter.c
is compiled with proper options
To stop your program while it is running, type "(ctrl) + c" (hold down the ctrl key and press c). gdb will stop your program at whatever line it has just executed. From here you can examine variables and move through your program. To specify other places where gdb should stop, see the section on breakpoints below.
You can use breakpoint commands to start your program up again. Simply use the continue command, or step , or any other command that resumes execution. Any other commands in the command list, after a command that resumes execution, are ignored.
nexti - (abbreviation ni) Executes one machine instruction. If it is a function call, the command proceeds until the function returns.
Continuing means resuming program execution until your program completes normally.
I don not see anywhere the -g
flag. It informs compiler to emit debugging info, so you need to add it to compilation line, if you wish gdb to show you line numbers.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With