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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T03:18:22+00:00 2026-06-13T03:18:22+00:00

In GDB, the command: list function will list all the source for the function.

  • 0

In GDB, the command:

list function

will list all the source for the function.

Is there a command that will list all of the source of the function you are currently in, without requiring you to manually type the function name?

  • 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-13T03:18:24+00:00Added an answer on June 13, 2026 at 3:18 am
    (gdb) help list
    List specified function or line.
    With no argument, lists ten more lines after or around previous listing.
    "list -" lists the ten lines before a previous ten-line listing.
    One argument specifies a line, and ten lines are listed around that line.
    Two arguments with comma between specify starting and ending lines to list.
    Lines can be specified in these ways:
      LINENUM, to list around that line in current file,
      FILE:LINENUM, to list around that line in that file,
      FUNCTION, to list around beginning of that function,
      FILE:FUNCTION, to distinguish among like-named static functions.
      *ADDRESS, to list around the line containing that address.
    With two args if one is empty it stands for ten lines away from the other arg.
    

    The *ADDRESS is what is interesting.

    On x86/x64 current pointer is in rip register so:

    (gdb) list *$pc
    0x7ffff7b018a0 is at ../sysdeps/unix/syscall-template.S:82.
    77  in ../sysdeps/unix/syscall-template.S
    

    The example is from cat command as I don’t have anything with debug info at hand.

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

Sidebar

Related Questions

Is there a command in gdb that I can use to (re)load / refresh
Is there any command in gdb by which one can apply breakpoint at the
When you debug C/C++ code in gdb, you can for example use list command
How can I set Emacs gdb so that it shows the most recent command
Is there a way to iterate over all my breakpoints in GDB and set
Using gdb, I can type 'info threads' or 'thread apply all backtrace' to get
I can step along with gdb, but I have to give the list command
I put this in my .emacs file: (custom-set-variables '(gud-gdb-command-name gdb --annotate=1) '(large-file-warning-threshold nil) '(menu-bar-mode
I'm currently writing a Python GDB script. The problem is that it has to
Is there any way how to pipe output of internal gdb command to some

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.