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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T16:43:45+00:00 2026-05-23T16:43:45+00:00

When a process is attached by gdb, the stat of the process is T,

  • 0

When a process is attached by gdb, the stat of the process is “T”, like:

root      6507  0.0  0.0  67896   952 ?        Ss   12:01   0:00 /mytest
root      6508  0.0  0.0 156472  7120 ?        Sl   12:01   0:00 /mytest
root     26994  0.0  0.0  67896   956 ?        Ss   19:59   0:00 /mytest
root     26995  0.0  0.0 156460  7116 ?        Tl   19:59   0:00 /mytest
root     27833  0.0  0.0  97972 24564 pts/2    S+   20:00   0:00 gdb /mytest

From the above, 26995 may be debuging. How can I know 26995 is debug or not? Or can I know which process is attached by gdb(27833)

pstree -p 27833 — show gdb(27833)

Another question: How to know a process(stat: T) is attached by which gdb(PID)?
In most siduation, I am not the peoson who is debuging the process.

  • 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-23T16:43:45+00:00Added an answer on May 23, 2026 at 4:43 pm

    The T in ps output stands for “being ptrace()d”. So that process (26995) is being traced by something. That something is most often either GDB, or strace.

    So yes, if you know that you are only running GDB and not strace, and if you see a single process in T state, then you know that you are debugging that process.

    You could also ask GDB which process(es) it is debugging:

    (gdb) info process
    (gdb) info inferior
    

    Update
    As Matthew Slattery correctly noted, T just means the process is stopped, and not that it is being ptrace()d.

    So a better solution is to do this:

     grep '^TracerPid:' /proc/*/status | grep -v ':.0'
     /proc/7657/status:TracerPid:    31069
    

    From above output you can tell that process 7657 is being traced by process 31069. This answers both “which process is being debugger” and “which debugger is debugging what”.

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

Sidebar

Related Questions

[root@woyo test]# strace -o /tmp/lsof.strace -p 5625 Process 5625 attached - interrupt to quit
I have GDB attached to a process that is currently inside a catch(...) block.
i want to get list of all application or Threads attached with a process.For
When the debugger is attached to a process on remote server - What locations
as title, my friend's environment is Windows 2003 server. He attached the IIS process
I'd like to configure a process that looks something like: Method Call -> Dynamic
I want to debug a process, hence I attached strace to the process and
Is it possible to break into debugger when the allocated memory of attached-to process
I have a command-line process I would like to automate and capture in C#.
I am using gdb to debug a process which runs in my m/c. I

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.