Start Debugger for MathLink from Mathematica
- To: mathgroup at smc.vnet.net
- Subject: [mg20096] Start Debugger for MathLink from Mathematica
- From: hanssen at zeiss.de
- Date: Thu, 30 Sep 1999 02:43:09 -0400
- Sender: owner-wri-mathgroup at wolfram.com
Hi, all
I am debugging of a MathLink program under WinNT-SP3 with Watcom
C/C++.
I see myself over and over typing the same stuff:
1.) start the debugger from the Watcom IDE,
2.) use File>Open, select my prog and enter
"-linkmode listen -linkname nxxx"
where xxx is a number, which I have to increase each time,
I start a new link (it seems, the linknames have to be different
for subsequent debugging starts, even if the link is properly
uninstalled).
3.) set appropiate breakpoints
4.) run prog to the proper breakpoint.
I want to automate this and call the debugger with an equivalent of
the command line
wdw prog -linkmode listen -linkname nxxx
and then attach to the link nxxx from Mathematica using
link=Install["nxxx", LinkMode->Connect]
This command line approach might be combined with a batch file
to alleviate me from typing the same stuff over and over. (There
remains the extra problem of changing xxx from run to run, but I might
construct the batch file with a Mathematica command.) The other
way of doing the same thing would be using Run:
Run["wdw prog -linkmode listen -linkname nxxx"]
but if I do this, I can not connect to prog and the expression does not
return, after I have started prog from the debugger (The breakpoints
are far outside the link-establishing and interfacing stuff, they are
only hit, if I call one of the to-be-tested MathLink-functions.)
The Mathematica-Kernel can not be interrupted and I have to kill the kernel.
Any idea, how to do this better than above? Any idea, why
Run[...] does not work here?
sincerely
A. Hanszen