Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Single stepping until exit from function gdb

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

like image 473
Aman Deep Gautam Avatar asked Jun 29 '12 16:06

Aman Deep Gautam


People also ask

How do you step out in GDB?

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.

How do you continue the program after stopping at a breakpoint?

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.

What does NI do in GDB?

nexti - (abbreviation ni) Executes one machine instruction. If it is a function call, the command proceeds until the function returns.

What is continue in debugging?

Continuing means resuming program execution until your program completes normally.


1 Answers

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.

like image 89
arrowd Avatar answered Oct 23 '22 22:10

arrowd