Sign in to follow this  
webwraith

of EXternal EXecutables

Recommended Posts

I've recently been frequenting the BONA FIDE site,idly flicking through their tutorials and whatnot, when I realised they didn't have a single piece on the opening of other programs from within your own. I know this might seem like an odd place to put this, but I think it could be relevant here, as well, as two cases come to mind of one program opening another; 1. Debuggers 2. Editors( I'm thinking UnrealEd here, but I bet others do it as well) The only problem is that I'm completely clueless as to how it's supposed to be done, and my level of experience in C++ isn't great enough to try this on my own (I'd probably end up with at least 200 partitions of about 1MB each...) Can anyone shine a light on this problem for me?

Share this post


Link to post
Share on other sites
Debuggers don't "open" your program. Most processors have 'breakpoint registers', you write an address in this register and when the CPU reaches that address it generates an interrupt.

A debugger installs an interrupt service routine for the breakpoint interrupt (sort of, sometimes it has to be done indirectly through the OS), puts the address to break at into the breakpoint register (usually it derives the address to break at from where you set a breakpoint in your source code), and asks the OS to run the program just as if you had run it yourself. The CPU hits the address that matches the address in the breakpoint register, generates the interrupt, which the debugger's ISR catches, and the debugger gets notified and in turn shows you the code with a neat little arrow pointing to where execution stopped (if you have a debugger with a GUI that is). If you compiled your code in debug mode, the debugger knows which source file(s) go with your program and can show you roughly where the processor stopped, if you don't compile your code in debug mode the best it can do is show you assembly code and exactly where the processor stopped.

On a side note, this is why you don't have to recompile your code when you set/remove breakpoints, the code isn't affected.

I haven't used UnrealEd so I can't comment on that.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this