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 7057471
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T03:59:24+00:00 2026-05-28T03:59:24+00:00

I currently have a tricky bug that occurs in a place where I don’t

  • 0

I currently have a tricky bug that occurs in a place where I don’t have access to source or symbols, i.e. I can see the instruction and its address where the crash occurs, but that’s about it. What I’d like to do is have gdb run without requiring interaction and display every instruction as it does so, but I’ve yet to find a way to do it.

What I’m hoping to achieve is something like this:

(gdb) /* some command */
0x2818a7c0: push   %ebp
0x2818a7c1: mov    %esp,%ebp
0x2818a7c3: push   %ebx
0x2818a7c4: sub    $0x4,%esp
...
0x28563622: mov    %esi,0x0(%eax)
Program received signal SIGSEGV, Segmentation fault.

What I’ve been doing is setting up a display for the program counter, like so:

(gdb) display/i $pc

And then running through the code with stepi:

(gdb) stepi
1: x/i $pc  0x2818a7c0: push   %ebp

However, the crash is hundreds or thousands of instructions away, and I’d like a way to see each one (together, if preferable), without having to hit “enter” that many times. Also, if I were to do it manually, I’d see a (gdb) prompt between each instruction, which is less than desirable.

One route I’ve briefly looked into is scripting, but my only thought is to setup at main(), have it display and another break (for the next instruction), and then continue, but then I can’t use commands within a commands block, so it wouldn’t work the way I’m imagining it.

In case it matters, I’m working on FreeBSD.

  • 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-05-28T03:59:25+00:00Added an answer on May 28, 2026 at 3:59 am

    The following should do what you asked for:

    # not strictly required, but you'll likely want the log anyway
    (gdb) set logging on
    
    # ask gdb to not stop every screen-full
    (gdb) set height 0
    
    (gdb) while 1
     > x/i $pc
     > stepi
     > end
    

    However, this approach to debugging will likely prove futile: there are simply too many instructions executed even in most trivial programs.

    A better approach might be to run the program until crash, attempt to understand what current function is doing and who calls it, and setting breakpoints appropriately.

    On x86, you can often deduce function boundaries even in fully stripped executable.

    Another thing you’ll want to look at is strace/truss output, so you can see what system calls immediately precede the crash point.

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

Sidebar

Related Questions

I currently have a query that looks like this: SELECT NON EMPTY ([Measures].[TOTAL]) ON
I currently have links w/ class=ajax that I want to retrieve the element with
I currently have a UINavigationController based application that works just fine. I'd like to
This is a bit of a tricky one. I have Document entities that are
I am currently working on a problem that I have an inelegant solution for.
I currently have an application where I create a series of Tasks that execute
I have a tricky problem that I've been messing about with for a few
I have what I consider a bit of a tricky question. I am currently
Currently have password protection on my main and sub directories, however I'd like to
I currently have 4 textboxes which will be used to store an ip address.

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.