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

  • Home
  • SEARCH
  • 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 353845
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T11:52:06+00:00 2026-05-12T11:52:06+00:00

Is there a way to get the instruction pointer of a running application Unix?

  • 0

Is there a way to get the instruction pointer of a running application Unix?

I have a running process (C++) and want to get its current location, and thereafter in GDB (on a different machine) map the location to source location (‘list’ command).

  • 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-12T11:52:06+00:00Added an answer on May 12, 2026 at 11:52 am

    On Linux, there is /proc/[pid]/stat.
    From "man proc":

     stat   Status information about the process. This is used by
           ps(1). It is defined in /usr/src/linux/fs/proc/array.c.
           ...
           kstkeip %lu
           The current EIP (instruction pointer).
    

    AFAICT, the 29th field of the output corresponds to the current instruction pointer of the process. For example:

    gdb date
    GNU gdb Red Hat Linux (6.0post-0.20040223.20rh)
    Copyright 2004 Free Software Foundation, Inc.
    GDB is free software, covered by the GNU General Public License, and you are
    welcome to change it and/or distribute copies of it under certain conditions.
    Type "show copying" to see the conditions.
    There is absolutely no warranty for GDB.  Type "show warranty" for details.
    This GDB was configured as "x86_64-redhat-linux-gnu"...(no debugging symbols found)...Using host libthread_db library "/lib64/tls/libthread_db.so.1".
    
    (gdb) set stop-on-solib-events 1
    (gdb) run
    (no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...[Thread debugging using libthread_db enabled]
    [New Thread 182896391360 (LWP 27968)]
    (no debugging symbols found)...Stopped due to shared library event
    (gdb) c
    [Switching to Thread 182896391360 (LWP 27968)]
    Stopped due to shared library event
    (gdb) where
    #0  0x00000036b060bb20 in _dl_debug_state_internal () from /lib64/ld-linux-x86-64.so.2
    #1  0x00000036b060b51c in _dl_init_internal () from /lib64/ld-linux-x86-64.so.2
    #2  0x00000036b0600f72 in _dl_start_user () from /lib64/ld-linux-x86-64.so.2
    #3  0x0000000000000001 in ?? ()
    #4  0x0000007fbff62728 in ?? ()
    #5  0x0000000000000000 in ?? ()
    (gdb) shell cat /proc/27968/stat
    27968 (date) T 27839 27968 8955 34817 27839 4194304 42 0 330 0 0 0 0 0 18 0 0 0 1881668573 6144000 78 18446744073709551615 4194304 4234416 548680739552 18446744073709551615 234887363360 0 0 0 0 18446744071563322838 0 0 17 0 0 0 0 0 0 0
    (gdb) p/a 234887363360  <--- the value of 29th field
    $1 = 0x36b060bb20 <_dl_debug_state_internal>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there any way to get the effect of running python -u from within
Is there any way to get correct rounding with the i387 fsqrt instruction?... ...
So lets say I have access to a process and its mm_struct, is there
is there way how to get name ov event from Lambda expression like with
Is there a way to get Windows audio mixer levels using WMI? For example,
Is there a way to get all versions of list item(s) using a CAML
Is there a way to get the IP address of a client in Silverlight
Is there a way to get session management or security programatically in Jersey, e.g.
Is there a way to get a list of all open sockets ( socket
Is there a way to get the value of a HashMap randomly in Java?

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.