I need to write a program that will halt the existing running program in the system and prompt for a question. After answering the question the running program will continue. [This halt will occur after a fixed interval of time.]
I need to implement the pause/resume feature.
Is it feasible?
If yes then what would be the approach?
Note: Please ask for any clarification, If I am unable express my problem statement.
Related
Recently, I've been trying to write to a .PAK file while it is being used by another process in ring 0. This has been a problem for quite a while and i haven't had much success. I am able to use any programming language necessary to accomplish this, but C#/VB.net is preferred. I originally wanted to use a find and replace system when editing, but I will just choose and offset to write to and such instead.
No, I can't just terminate the process then edit; the process must be running. Yes, I obviously know the process with the file handle attached.
No, I can't just run as admin because the process is established in ring 0/the kernel.
I've tried multiple methods including setting the process speed temporarily to 0 to edit then revert, and changing the FileShare and other parameters, none with any success.
One approach which I have been told a lot and which I have no experience in is creating a "Kernel Driver". I'm not sure how to go about this and I cant find much info online so if you think that's is the best method please inform me on how to get started. Any help is appreciated!
Always create a temporary file (a copy of your original file). If you need to process a file within your codes, create a temp file, use the temp file and process that file. So if you need another process, there will be no problem.
Suppose I am running a Sikuli program and I want to pause the program at a particular point and then after sometime I want to resume the program from that point where I paused, without affecting the process. And then I want to stop the process and exit from it. The point where I stopped till that it should be saved. Is it possible in Sikuli? If yes, then how?
Press Alt+Shift+c to kill a running Sikuli script.
No, Sikuli has no built-in capability to manage this for you. However, you can write all of these capabilities into your script or otherwise get them.
Pausing an resuming is most easily done on the Unix command-line, where you can use control-z to suspend a program and fg to resume it. Windows has similar capabilities. Look for "suspend and resume process " to find some ways of doing this (there are many).
Exiting from a program and then being able to re-start the program and have it resume (roughly) where it left off is called "checkpointing". The checkpointing packages I know of are intended for distributed computing and would probably be overkill for what you're doing, but you could take a look at the Wikipedia entry for suggestions. I suspect that implementing it yourself will be the easiest way to go.
For help with either of these topics, I recommend starting a new question specifying the language you're using (Jython or Java) and the operating system (Unix or Windows). The questions and answers to these aren't related to Sikuli.
For pause, you can use wait commands; if you want to resume, you need to have flags that you set at the beginning of the script, and change accordingly to what you want to wait for.
For closing the script; you can use the Type command wherever you want the script to quit; which is the equivalent of pressing CMD-Shift-C when using the IDE
type('c', KeyModifier.CMD + KeyModifier.SHIFT)
Hope this helps
I'd like Flash Builder to kill previous run instances when I run/debug.
It's driving me nuts that I can easily accumulate multiple instances of my project running outdated code if I don't go through and kill them individually each time I run.
Thank you
This is the best answer I was able to find thanks to Lee Burrows:
There is an unbound keybinding called "Terminate and Relaunch" in the general preferences which will terminate the run/debug that is currently connected to the debugger and start a new instance. So if you only use this you can avoid accumulating outdated instances.
Putting this as an answer, but I hope someone can make something that doesn't require a change in flow (still be able to use the debug button), and this will also not kill multiple instances if that somehow still happens.
I have a program witch is a xmpp client that connect to a server.
I use gloox library to do that.
When I run the program, it runs ok and connects to the server.
But when I run it under valgrind, the program never sends
<iq id='uid:4efa1893:327b23c6' type='set' from='user#server/ressource' xmlns='jabber:client'><session xmlns='urn:ietf:params:xml:ns:xmpp-session'/></iq>
to the server.
Had anybody experience such problem?
Are there any parameter I specially need to run valgrind with to make sure that it is the same environement as a normal program execution?
The very first question is: did Valgrind report any errors in the execution of your program?
If your program is well-defined, and Valgrind didn't report any errors in it, then the program is supposed to behave exactly the same way under Valgrind as without it (only slower); no special settings required.
It is somewhat more likely that Valgrind did report some errors, and if so, your program is likely not well-defined, in which case your question is mute -- your program doesn't work the same because it is not well-defined (i.e. depends on undefined behavior).
Whether this is possible I don't know, but it would mighty useful!
I have a process that fails periodically (running in Windows 2000). I then have just one chance to react to it before having to restart it and painfully wait for it to fail again. I didn't write the process so don't have the source to debug. The failure is seemingly random.
With a snapshot of the process I could repeatedly and quickly test reactions to the failure.
I had thought of running inside a VM but this isn't possible in this instance.
EDIT:
#Jon Cage asked:
When you say a snapshot, you mean capturing a process when it's about to fail (including memory, program state etc. etc.) ...and then replaying it's final few seconds repeatedly to see what effect it has on some other component?
This is exactly what I mean!
I think minidump is what you are looking for.
You can also used Userdump:
The User Mode Process Dumper
(userdump) dumps any running Win32
processes memory image (including
system processes such as csrss.exe,
winlogon.exe, services.exe, etc) on
the fly, without attaching a debugger,
or terminating target processes.
Generated dump file can be analyzed or
debugged by using the standard
debugging tools.
This article shows you how to use it.
My best bet is to start the process in a debugger (OllyDbg being my preferred tool).
The process will pause on an exception, and you can try to figure out what happened shortly before that.
This needs some understanding of assembler and does not allow to create a snapshot of the process for later analysis. You would need to write your own debugger for that - it should be theoretically possible.