简体   繁体   中英

Automatically attach gdb and continue when a process launches

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM