1
我有一個項目,我正在研究它,它有多個文件,我使用make來編譯項目。這裏是makefile文件使用gdb調試多個文件
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) $(FLAGS) $(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)
我們調試程序,我只使用GDB通過按時間順序運行以下命令:
gdb ./exec
run 2 database.info ./bloom
現在,如果我嘗試添加斷點在文件main.c中工作正常。但是,當我嘗試break bloom-filter.c:340
時,出現錯誤No source file named bloom-filter.c
。如何在除main.c
之外的源文件中添加斷點main.c