0

I am trying to setup a way to debug several C applications on windows. The problem I am running into is that the design of these applications is such where the first application (starter.exe) runs another application (launch.exe) using a call to system("launch.exe"). This launch.exe application may then run other applications using calls to CreateProcess().

Some of these applications may run only briefly, or possibly crash quickly, which results in me being unable to manually attach gdb to the process in time. I am also only looking to use gdb for the subset of applications compiled with gcc (starter.exe, some of the applications created by launch.exe), the rest are compiled within VS2012. Preferably gdb would have the default behavior of running "continue" instantly so as not to disrupt the control flow.

Is there any reasonable way to accomplish this within Windows? If possible I would like to avoid changing the applications.

In searching, I have come across the --waitfor command for gdb, but unfortunately this doesn't seem to be supported for my platform.

1 Answer 1

1

Yes. You're looking for the Image File Execution Options registry key.

You want to set the "Debugger" value to be your gdb command line for the process.

Sign up to request clarification or add additional context in comments.

4 Comments

Something I'm coming across is some trouble with the windows "start" command used in conjunction with the Image File Execution Options. It seems that including start in the debugger value results in receiving the error "The system cannot find the file C:\...\test.exe." Do you have a suggestion on how to get around this?
Sorry, I don't actually have a windows machine anymore. Can you post the full value you're using for debugger?
When testing here, I only had the value "start" for the debugger, and I received the error I mentioned. I had previously been trying with a much longer value including gdb and gdb arguments, but I wanted to try only "start" for simplicity sake and get more evidence that it was the culprit
Hmm, I dunno. Start may be special. I've mainly used it with ntsd or windbg.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.