Author Topic: debugging program started from a script  (Read 2800 times)

Chuck Crisler

  • Community Member
  • Posts: 11
  • Hero Points: 0
debugging program started from a script
« on: July 10, 2012, 02:51:21 PM »
If I need to debug the initialization of a program that is started from a script so that script commands need to be executed to start the program, how can I setup SlickEdit to do that? I really need a pre- and post- execute script processor with the debugger started in between.

Thank you,
Chuck Crisler

Chuck Crisler

  • Community Member
  • Posts: 11
  • Hero Points: 0
Re: debugging program started from a script
« Reply #1 on: July 10, 2012, 03:15:53 PM »
A variant of this would be passing arguments to the executable that you are debugging.

Dennis

  • Senior Community Member
  • Posts: 3961
  • Hero Points: 517
Re: debugging program started from a script
« Reply #2 on: July 10, 2012, 03:33:02 PM »
If you use Debug > Attach Debugger > Debug other Executable, you can pass in arguments.  You can also configure arguments to be passed for debugging or running from Build > GNU C/C++ Options > Debug tab.

For a tool that has to be ran from a script, I would recommend starting it outside the editor and then attaching to the process using Debug > Attach Debugger > Attach to Running Process.  You can always insert a sleep() at the beginning of main() to give yourself time to attach before the process does anything interesting.

Chuck Crisler

  • Community Member
  • Posts: 11
  • Hero Points: 0
Re: debugging program started from a script
« Reply #3 on: July 10, 2012, 03:45:31 PM »
I found the first suggestion (debug other executable). For some reason that seems to have problems. I am not sure if it is me or something else. However, the second suggestion is what I was really looking for. However, putting the option under the 'Build' menu doesn't seem obvious. Perhaps it could be moved to the Debug menu?