Gdb no such file or directory

I am following these lessons from OpenSecurityTraining .

I got to the lab where I have to train on the CMU bomb. They provide the x86_64 compiled CMU Bomb, which you can find here for training: CMU Bomb x86-64 originally from a 32-bit bomb from the CMU Lab for Computer Systems: Programmer's Perspective (CS: APP) 1st Edition .

I had a virtualized 64-bit Elementary OS distribution where I could easily parse CMU Bomb without using GDB. Now I have 64-bit Ubuntu 14.04 LTS (not virtualized), and when I try to reproduce why I did it on my Elementary OS, I got a known error.

I run the following commands:

gdb ./bomb-x64
(gdb) b main
Breakpoint 1 at 0x400dbd: file bomb.c, line 37. -- why bomb.c ?
(gdb) r
...
bomb.c: no such file or directory

Edit: I can create breakpoints for other CMU Bomb functions and it works as expected.
Example:

(gdb) b phase_1
Breakpoint 3 at 0x400f00
(gdb) r

Breakpoint 1, 0x0000000000400f00 in phase_1 ()
(gdb) disas
Dump of assembler code for function phase_1:
=> 0x0000000000400f00 <+0>: sub    $0x8,%rsp
   0x0000000000400f04 <+4>: mov    $0x4023b0,%esi
   0x0000000000400f09 <+9>: callq  0x401308 <strings_not_equal>
   0x0000000000400f0e <+14>:    test   %eax,%eax
   0x0000000000400f10 <+16>:    je     0x400f17 <phase_1+23>
   0x0000000000400f12 <+18>:    callq  0x40140a <explode_bomb>
   0x0000000000400f17 <+23>:    add    $0x8,%rsp
   0x0000000000400f1b <+27>:    retq   
End of assembler dump.

I heard about ia32-libs, but it doesn’t do anything, since I am on 64-bit Ubuntu and running a 64-bit compiled CMU Bomb, right?

+4
source share
2 answers

The executable file contains debugging symbols that indicate the file (and a specific line in the file) corresponding to each bit of the assembled code. This allows you to go through the C code in the debugger. Debugging symbols are placed there by the compiler (for example, using an argument -gin gcc).

C, , C, .

+4

dir

dir /usr/src/debug

. .

+3

Source: https://habr.com/ru/post/1570516/


All Articles