Solved

Process's stack and date adress

Posted on 2000-04-26
5
193 Views
Last Modified: 2010-04-22
I want to find process's stack and date address when i stop it .
How can i take these variables?
  I start a process with another program then this program stop other and take it's stack and data address. This is the starting point of checkpointing. I have some problems with kernel 2.2 .
Thanks.
0
Comment
Question by:Parlakisik
5 Comments
 

Author Comment

by:Parlakisik
Comment Utility
Adjusted points from 75 to 250
0
 
LVL 4

Expert Comment

by:kiffney
Comment Utility
run it under gdb.  You have to compile the program with the -g option. then do
gdb myprogram.  You can also use gdb to attach to a running process by starting gdb, then  typing 'file myprogram' then 'attach process-id'.

To tell gdb to break at a certain point

break myproblemfunction

where myproblemfunction is the name of a function you want to stop at.

then do 'run'.

The stack commands include 'bt' which allow to you backtrack in the current stack frame; 'frame n' which allows you to switch frames, where 0 is the current frame, 1 is the next frame up, etc.

The print command will show you the contents of your data variables, and the x command will let you look at any area of memory available to the program.

There's a tutorial on gdb at
http://www.cs.utah.edu/dept/old/texinfo/gdb/gdb_toc.html
0
 

Author Comment

by:Parlakisik
Comment Utility
Edited text of question.
0
 
LVL 40

Expert Comment

by:jlevie
Comment Utility
If you are trying write code to "checkpoint" a task so that it can be resumed later, there's likely to be a bit more to it than just getting the program stack. You'd also have to deal with open file descriptors and possibly other things.

In the absense of system support for checkpointing, as was found on super-computers and large mainframes, most folks who need that capability build a form of checkpointing into their task, writing the "live internal data" to file so that it can be restored when the program is restarted. You do have to be careful with respect to how you handle any open files, but it's otherwise pretty straightforward. If the task is long running (days, weeks, etc) and there's a concern that a system or power failure might result in the loss of the run, the internal "checkpoint can be done a regular intervals. It can also be arrainged for the checkpoint to occur as the result of a signal being delivered to the process.
0
 

Accepted Solution

by:
liyang earned 250 total points
Comment Utility
If you just want to checkpoint processes, have a look at esky, here: http://freshmeat.net/appindex/1999/10/05/939182194.html

OTOH, if you want to learn about how to do checkpointing, then looking through its source code would be a good idea. (Open Source is great, isn't it?)

hth
/Liyang
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now