Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9034505
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T08:29:49+00:00 2026-06-16T08:29:49+00:00

I have the assembly code of some code that will be executed at a

  • 0

I have the assembly code of some code that will be executed at a point in the program.
I don’t know the address of the code in memory.

Is it possible to make gdb break when the current instruction matches with an inputted instruction?

For example I want gdb to break whenever gdb reaches this instruction:

leaq        0x000008eb(%rip),%rax
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T08:29:50+00:00Added an answer on June 16, 2026 at 8:29 am

    No, this is not possible and it would also be very inefficient to implement.

    Debugger’s typically support two kinds of breakpoints:

    • Hardware Breakpoints: The debugger asks the CPU to raise a special exception interrupt when some event occurs, like some location in memory is changed.
    • Software Breakpoints: The debugger replaces the opcode at the breakpoint’s address with a special “trap” instruction (int 3 / 0xcc on the x86 architecture).

    Matching the current instruction’s opcode would either require CPU support to insert a hardware breakpoint or the debugger needs to know the address to use a software breakpoint.

    In theory, the debugger could just search the entire memory for the instruction’s byte sequence, but since the byte sequence could also occur in the middle of an instruction or in data, it may get false positives.

    Since assembly instructions are variable-length, control could jump to any arbitrary address or code could modify itself, it’s also not trivial to disassemble an entire region of memory to find some particular instruction.

    So basically, the only way of reliably finding the instruction in arbitrary assembly code would be by single-stepping on the instruction level. And this would be extremely expensive, even a trivial library call such as printf() could take minutes on today’s hardware if you single-step every instruction.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some Javascript code that will programmatically register an COM interop assembly by
I have some C# code that loads an assembly from a certain path like
I have some code that references an outside DLL which in production will be
I have some assembly code that I want to assemble for injection into a
I have some 8086 assembly code that's going to be calling interrupts for reading
I have a simple assembly code file called exit.s that looks like the following:
I have a .net assembly that contains data access code (a bunch of Typed
I have a .NET assembly DLL that is created on-the-fly from pre-compiled code in
I have an assembly that provides an API and is used by some other
I am assuimg the code will be written in C. I have studied that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.