Jump to content

Debugging With Separate Programs


Bill Tillman

Recommended Posts

I have a main program which works on most of the drawing and then loads a separate program when it's needed. I seem to have some kind of problem in that second program but I'm not sure how to toggle a breakpoint in it. I set one and then save it but when the programs run, it just passes right through the breakpoint I've set.

Link to comment
Share on other sites

BIGAL, I'm not sure I follow you there. The thing I wish to do is to step through the second program which gets loaded from the first one. The only way I've found around this is to copy all the code of the second program into the first one. Then I can toggle a breakpoint which will allow me to step through the second program.

Link to comment
Share on other sites

I'm still having some trouble with this. It's not that the code fails, in fact in runs through without error. But there are some places in the code which gets loaded from the first on in which I want to pause and have a look at some of the variables. Trouble is when I toggle a BreakPoint in the sub-program, even if I save it that way, the program runs right on through.

 

The only way I've found to do this is to move the code from the secondary program back into the main program and toggle the BreakPoints therein.

Link to comment
Share on other sites

Trouble is when I toggle a BreakPoint in the sub-program, even if I save it that way, the program runs right on through

 

Break points are not saved with the program, these are purely a debugging utility offered by the Visual LISP IDE.

Link to comment
Share on other sites

Thanks again Lee. The break point part I understand. I guess what I'm finding it that in this scenario there seems to be no way to stop the program execution at the point I need. The only way to do it is to merge the two programs into one, set the break point, then run it.

 

Program A is loaded. Inside of program A is a line which loads program B. When program B starts running I want to pause execution at a particular spot to check out a few variables. But there seems to be no way to pause program B unless I merge the text from both programs into a single program and run it as one complete code.

 

Since these chunks of code are multi 1000 liners, it's easier to work with them in separate programs. Makes revisions so much easier. But certain parts of debugging are not possible unless I merge them together and run it as one big program where I can toggle break points which actually pause execution.

Link to comment
Share on other sites

... The break point part I understand.

... there seems to be no way to pause program B unless I merge the text from both programs into a single program and run it as one complete code.

... certain parts of debugging are not possible unless I merge them together and run it as one big program where I can toggle break points which actually pause execution.

 

Bill,

 

It doesn't matter if the code is in separate files, it matters that you open the file within VLIDE (in this case program B), set the breakpoint where you like, and load that code from the code editor (the code in VLIDE that you've just set the breakpoint).

 

Since these chunks of code are multi 1000 liners, it's easier to work with them in separate programs. Makes revisions so much easier.

 

I do the same thing for each Class in my .NET apps (split them out into different code files within my Solution's Project). I've also done this for one particularly large LISP routine, but not exactly intuitive (the VLIDE), as compared to Visual Studio WRT navigating, etc..

Link to comment
Share on other sites

Thanks for the reply Renderman. I wish that were the case.... or I must really be missing something. I open both programs in the IDE and place a break point in program B. I load both of them and then run program A. But when program B runs it just keeps going past the break point. OK so I then comment out the line in program A which loads program B. Load both of them again using the icon in the IDE but the same thing happens. No matter how many break points I put in program B, when it runs it just passes right by them until it's completed, then program A takes over again. If there are break points in program A they are acknowledged and the program pauses.

 

If I'm missing something on this please advise.

Link to comment
Share on other sites

The only reason that I can think of for that to happen (and I could be overlooking something?), is that the code you've opened in VLIDE, added the breakpoint/code modification to is either (a) not being loaded due to an error, or (b) you're mistakenly/unknowingly invoking the wrong command/calling function(s).

 

*off to abuse Autoloader som'more*

Link to comment
Share on other sites

Like above for debugging add a line in 2nd program it will display variable value and wait for you to continue, obviously the VLIDE is a better way to go.

 

(princ yourvariable)(setq dummy (getstring)) ; press any key

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...