MathGroup Archive 2008

[Date Index] [Thread Index] [Author Index]

Search the Archive

debugging code that contains compile

  • To: mathgroup at
  • Subject: [mg91271] debugging code that contains compile
  • From: Benjamin Hell <hellben at>
  • Date: Wed, 13 Aug 2008 04:38:26 -0400 (EDT)

I have some code where I define some functions using compile to speed them up. Code runs fine without compile, but when using compile I get some errors. So what I wanna do now is of course analyze where these errors come from. Unfortunately Mathematica Frontend just tells me the kind of error and what variables are involved. Due to my code being pretty large, it's no easy task to figure out where these errors in deed appear.

My question now is: Can I investigate these errors any closer? (using Mathematica or Wolfram Workbench)

Here is what I tried so far:
1)Modify the error messages by setting $MessagePrePrint to append the $Line. But as you might guess my function is called somewhere in the frontend and exactly the line of that call is returned by $Line not where the error really appears in the code!

2) Of course I used the debugger and that's why I mentioned that I use the Compile Command. Because for usual code using the debugger would of course show me where the error appears. But when the debugger reaches the Compile Command neither the stack view nor the code view show me where code is currently evaluated. I just at some point get the error message on the stack.

So, is there any way to get one of the above methods to work or should I use a different approach?

Any hint is more than welcome. This may involve wolfram workbench, too. Thanks in advance.

Software available:
Mathematica 6
Wolfram Workbench

  • Prev by Date: Re: ListLinePlot and Tooltip
  • Next by Date: Re: Re: Integrating DiracDelta to get UnitStep
  • Previous by thread: Re: DO loop
  • Next by thread: Re: debugging code that contains compile