Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 10-25-2007, 06:12 PM   #1
Registered: Sep 2006
Posts: 374

Rep: Reputation: 16
View inside a process?


Is there any program that allow us to view inside a process.

For example, if I'm debugging a program, and in a certain moment I would like to see how my stack is, what registers I'm using, which file descriptors I've open, etc...

And, is it possible programatically?

Old 10-25-2007, 11:18 PM   #2
Senior Member
Registered: Jan 2006
Location: Charleston, SC, USA
Distribution: Debian, Gentoo, Ubuntu, RHEL
Posts: 1,148
Blog Entries: 1

Rep: Reputation: 48
Most if not all of that can be done with gdb. I assume that by "programmatically" you mean, is there a language binding? Within the program, sure there's ways of displaying the current state - printf. I'm not sure I understand that last question, but definitely look up gdb.
Old 10-26-2007, 01:46 AM   #3
Registered: Apr 2004
Location: India
Distribution: Redhat,Fedora
Posts: 430

Rep: Reputation: 39
Gdb should do that.

Just open the process exe with GDB and once inside GDB attach the process with the process pid.
$ gdb file.exe
gdb > attach <pid_of_file.exe>

If you want to see the system calls the process is making while running try this

$ strace -p <pid>

This will giv a cool output of the system calls the process is making,files being opened,sockets being connected etc.

$ ltrace -p <pid>

Will give info on library call the process makes.[like fprint,printf,etc...]

$ lsof | grep processname

Will give list of all files opened by that process.

Will have some info on process like the segments [code,data,stack] info , env info of that process.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Inside the Linux Boot Process LXer Syndicated Linux News 2 01-28-2007 11:55 AM
Can you view mounted shares inside konqueror? Thaidog Linux - General 2 09-11-2004 07:32 PM
how do i kill a process from inside a bash script? mikaelo Programming 4 05-28-2004 08:51 AM
How to view inside an image file wisdom Linux - Software 1 02-17-2004 03:00 PM
How to View Threads per Process Shashi Linux - Software 0 08-01-2003 01:37 AM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:27 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration