Author Topic: debugging problem  (Read 1496 times)

0 Members and 1 Guest are viewing this topic.

NirantarVidyarthee

  • Guest
debugging problem
« on: December 25, 2012, 02:01:55 PM »
I have two autolisp programs as follows:

(defun c:test1()
  (setq x 0)
  (setq y 0)
  (alert "test1")
  (load "C:\\Documents and Settings\\Administrator\\Desktop\\test2.lsp")
  )


(defun fnTest2()
  (setq x2 0)
  (sewtq y2 0)
  (alert "test2")
  )
(fnTest2)

Note that program test1 loads the program test2 and then test2 automatically executes the function fnTest2. This is an existing program and I can't make any changes to it.

I open file test1.lsp in vlide and then lad it using Tools > Load text in editor.

I then enable Debug > Stop once & Debug > break on error.

Then I type test1 at the command prompt and then I am able to debug both the program step-by-step using F8 key. The program also highlights the line containing error in program test2.

When I 'Rest to top level' and type test1 again at the command prompt, I am able to debug the test1 code but cursor does not stop in program Test2 and does not highlight any statement.

What am I doing wrong?

Also is there any statement equivalent to the 'stop' statement in VB, so that I cam hardcode a breakpoint in the code.

Lee Mac

  • Seagull
  • Posts: 12912
  • London, England
Re: debugging problem
« Reply #1 on: December 25, 2012, 06:10:38 PM »
Also is there any statement equivalent to the 'stop' statement in VB, so that I cam hardcode a breakpoint in the code.

VLIDE » Debug » Toggle Break Point

(Or press F9)

NirantarVidyarthee

  • Guest
Re: debugging problem
« Reply #2 on: December 26, 2012, 12:55:31 AM »
Thanks but this is dome manually.

I want to debug a program that is automatically loaded by another program.

I don't have a chance to press F9 key manually. The code already loads and executes.

So I am asking if there is a statement that I can add so code automatically stops at that line and I can resume execution by pressing F8 key. (similar to stop statement in VB).

irneb

  • Water Moccasin
  • Posts: 1794
  • ACad R9-2016, Revit Arch 6-2016
Re: debugging problem
« Reply #3 on: January 03, 2013, 12:51:20 AM »
Not following. Open both the test1.lsp * test2.lsp files in VLIDE. Then set a break-point on the load line in test1.lsp, reload the test1.lsp (even if it was loaded previously it simply loads the new version). Now VLIDE will stop at the point where it starts loading test2.lsp.

Alternatively, if you simply want to debug test2, then just set a break-point at the 1st open parenthesis and load it through VLIDE. It should stop and allow you to step using F8, showing what's occurring during a load.
Common sense - the curse in disguise. Because if you have it, you have to live with those that don't.