LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
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.

Notices

Reply
 
Search this Thread
Old 10-25-2007, 06:12 PM   #1
xeon123
Member
 
Registered: Sep 2006
Posts: 364

Rep: Reputation: 16
View inside a process?


Hi,

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?

Thanks,
 
Old 10-25-2007, 11:18 PM   #2
PatrickNew
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
zulfilee
Member
 
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.


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


Reply


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


All times are GMT -5. The time now is 06:42 AM.

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