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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T04:59:21+00:00 2026-06-01T04:59:21+00:00

Do we have a way to view assembly and c code both using gdb.

  • 0

Do we have a way to view assembly and c code both using gdb.

disassemble function_name shows only assembly, I was trying to find a way to easliy map c code to assembly.
Thanks

  • 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-01T04:59:23+00:00Added an answer on June 1, 2026 at 4:59 am

    You can run gdb in Text User Interface (TUI) mode:

    gdb -tui <your-binary>
    (gdb) b main
    (gdb) r
    (gdb) layout split
    

    The layout split command divides the window into two parts – one of them displaying the source code, the other one the corresponding assembly.
    A few others tricks:

    • set disassembly-flavor intel – if your prefer intel notation
    • set print asm-demangle – demangles C++ names in assembly view
    • ni – next instruction
    • si – step instruction

    If you do not want to use the TUI mode (e.g. your terminal does not like it), you can always do:

    x /12i $pc
    

    which means print 12 instructions from current program counter address – this also works with the tricks above (demangling, stepping instructions, etc.).

    The “x /12i $pc” trick works in both gdb and cgdb, whereas “layout split” only works in gdb.

    Enjoy 🙂

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

Sidebar

Related Questions

I use ClearCase. I have a snapshot view. Is there a way to compare
I'm trying to port some ASP.Net code to mono. I am testing it using
I have created a website using MVC3 along with the Razor view engine. What
I'm generating a dynamic assembly using Reflection.Emit which includes a single class. I have
I have created segues in the following way: view controller VC1 is the root
I have spent way too much time looking for the files owner icon to
I need to have two way communication between threads in Tcl and all I
Does .net have a way to determine whether the local filesystem is case-sensitive?
Can I have any way to know which is the depth of a child
Does gettext have a way to warn me about strings that have not been

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.