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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T23:15:33+00:00 2026-06-03T23:15:33+00:00

I have a linux running on VMWare, and I use gdb in the host

  • 0

I have a linux running on VMWare, and I use gdb in the host machine to attach to it when debugging. While running, my kernel will cause some of the processes hang, and I would like to investigate more.

What kernel gives me is the process id of the hung process along with a stack trace. However, without the arguments being passed, stack trace is not very useful. So I want to gather more information. So I have two questions:

  1. Given the pid, how can I get the task_struct corresponds to the process? I tried to do ” p find_task_by_pid_ns(2533, &init_pid_ns) ” under gdb, however it hangs.

  2. Once I got the task_struct and the stack pointer. My ultimate goal would be to reproduce the stack trace (with argument of each functioned called). Is there a tool to do that? Does gdb take a stack pointer and print the stack trace for me?

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-03T23:15:35+00:00Added an answer on June 3, 2026 at 11:15 pm

    KDB will be helpful in this case. I don’t know which kernel version you are using, but if you are using kernel on or after linux-2.6.35, you can switch to the kdb from gdb using the following command:

            maintenance packet 3
    

    Once you are in the kdb you can use ps command to get to know process descriptor address and can use bt command to trace a stack. Alternatively, you can run the kdb commands from the gdb using gdb ‘monitor’ command. For example, to use the ‘ps’ command of kdb, you can type the following command in your gdb.

           (gdb) monitor ps
    

    You can get the list of kdb command using the following command.

           (gdb) monitor help
    

    Once you know the process descriptor, you can use the following documentation to trace any process’s stack.

          http://www.emntech.com/documentation/debugging/kdb.pdf   
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I currently use a linux VM in VMWare running on a Windows machine. I
I have a question about debugging a running C++ program in Linux. If a
I have Riak (1.0.2) installed in my VMWare Workstation running Ubuntu Linux Natty. It's
I am running Linux Ubuntu 10.04 and I have a Windows 7 machine and
I have the following constellation here: I have running a VMware Linux Ubuntu image
I have a Linux Machine. Apache server is running and I need to deploy
I have a Linux host running Apache and a Windows host running IIS. I
With VMWare Server running under Linux (Debain), I would like to have the following
I have a Windows XP machine and a Linux machine running Ubuntu. I share
I have a Win7 running on my host machine and I want to do

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.