GDB in eclipse debug mode cannot find stdlib / rand.c

I am trying to start gdb using eclipse cdt on ubuntu to start debugging some simple programs. So I took the steps that I consider necessary to run it:

1. Create an executable project

2. Compile

3. Run

4. Create a .gdbinit file and place it in the main project folder

5. Install the debugger part of the configuration : enter image description hereenter image description here

5. I also tried to find the file . gdbinit , which looks something like this:

set schedule-multiple

dir ~/gcc_build/4.7.2/build/gcc
dir ~/gcc_build/4.7.2/gcc
dir ~/gcc_build/4.7.2/gcc/cp
dir ~/gcc_build/4.7.2/gcc/lto
source ~/gcc_build/4.7.2/build/gcc/gdbinit.in

But I did not find anything like this on my computer, even after execution

# find / -name .gdbinit

So, my .gdbinit file ends with simple content - just that:

set new-console on

Apply and Debug:

enter image description here

gdb , . "step over/F6", . , rand(), gdb :

Can't find a source file at "/build/buildd/eglibc-2.19/stdlib/rand.c" 
Locate the file or edit the source lookup path to include its location.

enter image description here

, rand.c, , :

# find / -name rand.c
# find / -name stdlib

GDB, , rand.c, ... , :

enter image description here

, - .gdbinit? - , GDB rand.c stdlib c99? , . , GDB.

: rand.c :

# apt-get install libc6-dbg
# apt-get source libc6

:

Can't find a source file at "/build/buildd/eglibc-2.19/csu/libc-start.c" 
Locate the file or edit the source lookup path to include its location.

gdb?

.

+4
2

, ... 4- 5- , , .

, GDB . , , , , , . , , , , , :

Debug Configurations > C/C++ Applications: (drop down it)

... , , "" - , , .

. , , .

+3

1:

https://www.gnu.org/software/libc/, glibc.

2:

, , eclipse " ... xxx.c", eclipse. .

0

All Articles