Lisp HUG Maillist Archive

My concept of native code stepper

I have written the concept of native code stepper. I was unable to
find sufficient information in docs to make it robust though. Couple
test cases are in the file.

Compile, load and Enjoy!

http://paste.lisp.org/display/141610#1

_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html


Re: My concept of native code stepper

Denis Budyak <budden73@gmail.com> writes:

> I have written the concept of native code stepper. I was unable to
> find sufficient information in docs to make it robust though. Couple
> test cases are in the file.
>
> Compile, load and Enjoy!
>
> http://paste.lisp.org/display/141610#1

On modern systems, you can step into code by running it with a hardware
flag set to break on each instruction, instead of modifying the
program.  You could have a look at the sources of gdb to see how to do
it, and steal the low level routines.


-- 
__Pascal Bourguignon__
http://www.informatimago.com/
"Le mercure monte ?  C'est le moment d'acheter !"

_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html


Re: My concept of native code stepper

Hi Pascal!
  I do not know assembler and it is too boring to study gdb. I don't
know how it works, but I guess it stops all threads in application?
Mine stepper concept can work on any given subset of threads. If
*stepping-enabled* is nil, no stepping occurs.
  Second, my stepper is based on normal IDE debugger and it uses all
its infrastructute. It would be a huge work to write a stepper for a
closed-source program from the scratch.

  I found that references are stored after function's code and managed
to patch reference table for a simplest particular case. So enjoy
this:

http://paste.lisp.org/display/141610#2

(just compile and load, it works every other time, and every other
time it causes an exception).

E.g. in example function
(defun test-fn-1 (x)
  (+ 2 (subroutine-of-x (subroutine-of-x x))))

three step points are created - one on each call to subroutine-of-x
and one on call to +.
As the file is being loaded, that step points issue (break) so one can
locate to the source with the IDE or just watch the stack and current
inner call parameter.Then press "continue" to do next step. Also
"break on return from frame" is available.

I see no reason in walking through all 50 or so assembly commands in
test-fn-1 unless we want to debug Lispworks itself (why would we want
this - LW works rather well)?

_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html


Updated at: 2020-12-10 08:34 UTC