138
0x0000000000400448 <main+0>:    push   %rbp
0x0000000000400449 <main+1>:    mov    %rsp,%rbp
0x000000000040044c <main+4>:    mov    $0x6,%eax
0x0000000000400451 <main+9>:    leaveq 
0x0000000000400452 <main+10>:   retq   

I tried:

breaki 0x0000000000400448

but it seems that there not such command.

Does gdb have such a feature?

2
  • 3
    why breaki? is that a typo? Commented Jun 13, 2017 at 17:47
  • 2
    @Blauhirn Perhaps as a supposed analogy with stepi and nexti, which are used for single-stepping at the instruction level. Commented Dec 9, 2017 at 21:39

2 Answers 2

228

try break *0x0000000000400448

Sign up to request clarification or add additional context in comments.

4 Comments

Probably because * is required to specify an address. see sourceware.org/gdb/current/onlinedocs/gdb/…
And of course you can remove the leading zeroes and abbreviate break, give b *0x400448.
To disambiguate with function or data named 0x0000000000400448 (unusual as that would be!)
@compile-fan break *address Set a breakpoint at address address. You can use this to set breakpoints in parts of your program which do not have debugging information or source files. ftp.gnu.org/old-gnu/Manuals/gdb/html_node/gdb_28.html I was debugging a assembly code and reached here for the same question which you asked.
93

Another way:

break *main+4

This will add a breakpoint at 0x000000000040044c
I think this is easier than writing the whole address!

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.