openlang

Can gdb set a breakpoint for an assembly instruction using its address?

0x0000000000400558 <main+0>:    push   %rbp
0x0000000000400559 <main+1>:    mov    %rsp,%rbp
0x000000000040055c <main+4>:    mov    $0x7,%eax
0x0000000000400561 <main+9>:    leaveq
0x0000000000400562 <main+10>:   retq

My attempt:

breaki 0x0000000000400558

apparently this command does not exist, though.

Can gdb do something like this?

The conversation continues 2

Follow the reasoning
  1. Permalink

    An alternative:

    break *main+4

    A breakpoint gets placed at 0x000000000040055c

    To me, that beats typing out the entire address!

Other sides of the same question

  1. Can Playwright assertions allow either of two possible text values?

    I'd like to verify that the text contains either one or two: Can this be made to work in Playwright? Could the same thing als…

    Replies 2Latest activity typescript
  2. Why is TsLint requesting a return type for this function's callSignature?

    My code includes the following function: TsLint reports this error for it: Could somebody clarify the message for me?

    Replies 2Latest activity typescript
  3. Getting Godot system time for a digital clock?

    I'm building a digital clock for my game, so I need the present time (hours and minutes) displayed like this: HH:MM:SS Where…

    Replies 2Latest activity gdscript