Reputation: 67
I tried to run a program which is not compiled with the -g option inside gdb
in Linux (e.g. /bin/ls). gdb
runs the program (BTW lldb
does not). I wonder whether it is possible to execute the program stepping through the machine instructions with si
(I don't see why not, in principle). But the question is: how do you set breakpoints? If you simply run the program, it executes and exits.
Upvotes: 0
Views: 602
Reputation: 123400
Yes, of course:
starti
to start the program but break on the first instructiondisassemble
to show the instructions for the current functionbreak *0x00007ffff7ec3f2d
to set a breakpoint by addressUpvotes: 5