2

I'm trying to debug some code on Linux. There's an arbitrary memory location I need the program to jump to. This location is result of calling mmap with appropriate protection flags for executing a piece of code. When trying to set break point like this: b 0x00007ffff7fcf000 I get the following message:

Function "0x00007ffff7fcf000" not defined.
Make breakpoint pending on future shared library load? (y or [n])

If I answer no, then no breakpoint is triggered, and if I answer yes, then still no breakpoint is triggered. How can I make gdb set a breakpoint on this address?

  • Hi and welcome to RE.SE. While trying to set the bpx, you have already mapped the respective memory range? What does info mem give as output? Is GDB even aware of that memory? – 0xC0000022L Aug 19 at 11:46
  • actually, after I added the asterisk before the address as suggested by the accepted answer, it worked just fine. – Michael Kruglos Aug 19 at 13:35
4

You need to use syntax like *0x12345 with raw addresses, otherwise gdb tries to resolve it as a symbol.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.