Wolfram ResearchPRODUCTSPURCHASEFOR USERSCOMPANYOUR SITES
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.

2.13.11 Special Topic: Running External Programs under a Debugger

MathLink allows you to run external programs under whatever debugger is provided in your software environment.

MathLink-compatible programs are typically set up to take arguments, usually on the command line, which specify what MathLink connections they should use.

Running an external program under a debugger.

Note that in order to get a version of an external program that can be run under a debugger, you may need to specify -g or other flags when you compile the program.

Debugger

Set a breakpoint in the C function f.

break f
Breakpoint set: f: line 1

Start the external program.

run -linkcreate

The program responds with what port it is listening on.

Link created on: 2981@frog.wolfram.com

Mathematica session

This connects to the program running under the debugger.

This calls a function which executes code in the external program.

Debugger

The external program stops at the breakpoint.

Breakpoint: f(16)

This tells the debugger to continue.

continue

Mathematica session

Now f returns.


Any questions about topics on this page? Click here to get an individual response.Buy NowFree TrialMore Information



 © 2008 Wolfram Research, Inc.  Terms of Use  Privacy Policy |
Sign up for our newsletter: