Thread: Re: [Objectscript-users] command line debugger
Brought to you by:
rob_d_clark
From: Lysander D. <sa...@sb...> - 2005-10-26 04:45:56
|
I was able to successfully build it and verify that the class loader change work. Here is an example script: pkg.system.mountJarFile ( new pkg.fs.File ( "d:/opt/java/build/xstream/trunk/xstream/lib/commons-lang-2.0.jar" ) ); pkg.system.mountJarFile ( new pkg.fs.File ( "d:/opt/java/build/xstream/trunk/xstream/lib/dom4j-1.3.jar" ) ); pkg.system.mountJarFile ( new pkg.fs.File ( "d:/opt/java/build/xstream/trunk/xstream/lib/jdom-1.0.jar" ) ); pkg.system.mountJarFile ( new pkg.fs.File ( "d:/opt/java/build/xstream/trunk/xstream/lib/jmock-2004-03-19.jar" ) ); pkg.system.mountJarFile ( new pkg.fs.File ( "d:/opt/java/build/xstream/trunk/xstream/lib/joda-time-1.1.jar" ) ); pkg.system.mountJarFile ( new pkg.fs.File ( "d:/opt/java/build/xstream/trunk/xstream/lib/junit-3.8.1.jar" ) ); pkg.system.mountJarFile ( new pkg.fs.File ( "d:/opt/java/build/xstream/trunk/xstream/lib/stax-1.1.1-dev.jar" ) ); pkg.system.mountJarFile ( new pkg.fs.File ( "d:/opt/java/build/xstream/trunk/xstream/lib/stax-api-1.0.jar" ) ); pkg.system.mountJarFile ( new pkg.fs.File ( "d:/opt/java/build/xstream/trunk/xstream/lib/xml-writer-0.2.jar" ) ); pkg.system.mountJarFile ( new pkg.fs.File ( "d:/opt/java/build/xstream/trunk/xstream/lib/xom-1.0b3.jar" ) ); pkg.system.mountJarFile ( new pkg.fs.File ( "d:/opt/java/build/xstream/trunk/xstream/lib/xpp3-1.1.3.4d_b4_min.jar" ) ); pkg.system.mountJarFile ( new pkg.fs.File ( "d:/opt/java/build/xstream/trunk/xstream/xstream-SNAPSHOT.jar" ) ); pkg.system.declareJavaPackage("com.thoughtworks.xstream"); var xstream = new com.thoughtworks.xstream.XStream (); var list = new java.util.ArrayList (); list.add ( "a" ); list.add ( "b" ); var xmlOutput = xstream.toXML ( list ); writeln ( xmlOutput ); and here is the output from the example 517 $ sh -x do.sh + /opt/java/share/oscript-2.8.1/bin/oscript newLoader.os register: java.net.URLClassLoader@1eed786 register: java.net.URLClassLoader@c1f10e register: java.net.URLClassLoader@b8deef register: java.net.URLClassLoader@1342ba4 register: java.net.URLClassLoader@1d332b register: java.net.URLClassLoader@10a6ae2 register: java.net.URLClassLoader@ef2c60 register: java.net.URLClassLoader@4a6cbf register: java.net.URLClassLoader@29ab3e register: java.net.URLClassLoader@1a99561 register: java.net.URLClassLoader@8e32e7 register: java.net.URLClassLoader@1b000e7 register: java.net.URLClassLoader@b76fa <list> <string>a</string> <string>b</string> </list> Thanks, Lysander --- Rob Clark <ro...@ti...> wrote: > cool... you might check out > https://objectscript.kicks-ass.org/svn/ > tags/oscript-2.9.2, since this branch has already > been merged into a > release. (If I get a few minutes tonight, I'll > upload 2.9.2 to sf.net) > > > On Oct 25, 2005, at 1:02 PM, Lysander David wrote: > > > The registration now works and I was able to > > successfully check out > > > https://objectscript.kicks-ass.org/svn/branches/OBJS380 > > from subversion. > > > > Thanks, > > Lysander > > > > --- Rob Clark <ro...@ti...> wrote: > > > > > >> btw, the page to create an account should be > working > >> now... I had > >> some problems with my network connection, but it > >> seems to be working > >> ok now: > >> > >> > https://objectscript.kicks-ass.org/osp/account.osp > >> > >> > > > > -- Rob > > ____________________ > CONTACT INFORMATION: > email: ro...@ti... > IM: rob@sandjabber > desk: 1 858 552 2946 > cell: 1 619 300 9661 > > > > |
From: Lysander D. <sa...@sb...> - 2005-12-06 18:08:34
|
Thanks for checking in dbg.os. 'import "reflection.os";' is not necessary. It refers to the reflection.os file from the user guide so that I could use the 'listobj' function to list the methods and attributes of objects. The patch extends the Breakpoint interface to allow breakpoints to provide the current stack frame( getCurrentStackFrame ), the parent stack frame ( getParentStackFrame ) and whether or not it is a next breakpoint ( isNextBreakpoint ). Then handle is modified to call isNextBreakpoint. If isNextBreakpoint returns false, then the step breakpoint is handled as normal. If isNextBreakpoint is true, and the current stack frame or parent stack frame matches the current stack frame, the breakpoint is handled. Otherwise the stepBp is left unchanged to be added back to the breakpont stack. Additionally _inNextBreakpointStackFrame can be removed since it isn't used ( I thought determining if it is in the next stack frame would be a little more involved ) --- Rob Clark <ro...@ti...> wrote: > I've checked in dbg.os, and added a "-b <file> > <line>" command-line > option to set a breakpoint from the command-line... > see revision 1881 > > btw, in dbg.os, what is the 'import > "reflection.os";'.... I've had a > brief look thru dbg.os, and it didn't look like it > was using any > functions not defined in the same file, but thought > I should double > check to make sure that nothing is missing. > > I still need to look at the patch file to understand > the changes... > hopefully I'll get some time to have a closer look > tomorrow. > > > On Nov 26, 2005, at 10:54 PM, Lysander David wrote: > > > Hi Rob, > > > > I have made some modifications to the previous > dbg.os > > you previously posted. Here is the help > > for it: > > > > objectsript command line debugger help > > > > continue - continue execution ( synonym "c" ) > > step - single step ( synonym "s" ) > > next - Next, steps over subs ( synonym "n" ) > > where - stack trace ( synonym "T" ) > > up - change context to higher stack frame ( > synonym > > "u" ) > > down - change context to lower stack frame ( > synonym > > "d" ) > > list [file][:[line][:length]] - list the [file] at > > [line] with [length] number of lines > > b [[file][:line]] - set a breakpoint. If [file] is > not > > specified, a breakpoint is set at the curent debug > > stack frame > > b list - list breakpoints > > d index - delete breakpoint at specified > breakpoint > > index > > help - this message ( synonym "h" ) > > exit - exit debugging session ( synonym "x", > "quit", > > "q") > > > > > > Aside from the os file, some changes in > > Debugger.java were necessary in order to get > > the "next" command to work ( see included patch > > "debugger.pat" ). > > > > I realize that a lot of it is kind of hacky but > > hopfully you can indicate what changes should be > > made so that it can eventually be included as a > part > > of > > the objectscritpt distribution. > > > > ( Two things I can think of offhand are > > 1. add a command line flag to add a step > > breakpoint so that it will not > > be necessary to modify os code to get the > > first breakpoint > > 2. add a return command to continue until > > the current function returns. > > ) > > > > By the way, is an emacs mode for javascript > available > > ? > > > > Thanks, > > Lysander > > <dbg.os> > > <debugger.pat> > > > ____________________ > CONTACT INFORMATION: > email: ro...@ti... > IM: rob@sandjabber > desk: 1 858 552 2946 > cell: 1 619 300 9661 > > > > |
From: Rob C. <ro...@ti...> - 2005-12-18 00:15:55
|
Ok, I've merged the command-line debugger changes back to the trunk. I made some slight changes: 1) changed the way "next" works to work more like the GUI debugger, without needing changes in Debugger.java 2) used ObjectScript regular expressions for debugger command-line parsing Everything seems to work, as best I can tell... If you want, checkout the latest from the trunk and give it a whirl. I've also merged the changes to build with JDK v1.5.x On 12/6/05 10:08 AM, "Lysander David" <sa...@sb...> wrote: > Thanks for checking in dbg.os. > > 'import "reflection.os";' is not necessary. > It refers to the reflection.os file from the > user guide so that I could use the 'listobj' > function to list the methods and attributes > of objects. > > The patch extends the Breakpoint interface > to allow breakpoints to provide the current > stack frame( getCurrentStackFrame ), the > parent stack frame ( getParentStackFrame ) and > whether or not it is a next breakpoint ( > isNextBreakpoint ). > > Then handle is modified to call isNextBreakpoint. > If isNextBreakpoint returns false, then the step > breakpoint > is handled as normal. If isNextBreakpoint is true, > and the current stack frame or parent stack frame > matches > the current stack frame, the breakpoint is handled. > Otherwise > the stepBp is left unchanged to be added back to the > breakpont stack. > > Additionally _inNextBreakpointStackFrame can be > removed > since it isn't used ( I thought determining if it is > in the > next stack frame would be a little more involved ) > > > --- Rob Clark <ro...@ti...> wrote: > >> I've checked in dbg.os, and added a "-b <file> >> <line>" command-line >> option to set a breakpoint from the command-line... >> see revision 1881 >> >> btw, in dbg.os, what is the 'import >> "reflection.os";'.... I've had a >> brief look thru dbg.os, and it didn't look like it >> was using any >> functions not defined in the same file, but thought >> I should double >> check to make sure that nothing is missing. >> >> I still need to look at the patch file to understand >> the changes... >> hopefully I'll get some time to have a closer look >> tomorrow. >> >> >> On Nov 26, 2005, at 10:54 PM, Lysander David wrote: >> >>> Hi Rob, >>> >>> I have made some modifications to the previous >> dbg.os >>> you previously posted. Here is the help >>> for it: >>> >>> objectsript command line debugger help >>> >>> continue - continue execution ( synonym "c" ) >>> step - single step ( synonym "s" ) >>> next - Next, steps over subs ( synonym "n" ) >>> where - stack trace ( synonym "T" ) >>> up - change context to higher stack frame ( >> synonym >>> "u" ) >>> down - change context to lower stack frame ( >> synonym >>> "d" ) >>> list [file][:[line][:length]] - list the [file] at >>> [line] with [length] number of lines >>> b [[file][:line]] - set a breakpoint. If [file] is >> not >>> specified, a breakpoint is set at the curent debug >>> stack frame >>> b list - list breakpoints >>> d index - delete breakpoint at specified >> breakpoint >>> index >>> help - this message ( synonym "h" ) >>> exit - exit debugging session ( synonym "x", >> "quit", >>> "q") >>> >>> >>> Aside from the os file, some changes in >>> Debugger.java were necessary in order to get >>> the "next" command to work ( see included patch >>> "debugger.pat" ). >>> >>> I realize that a lot of it is kind of hacky but >>> hopfully you can indicate what changes should be >>> made so that it can eventually be included as a >> part >>> of >>> the objectscritpt distribution. >>> >>> ( Two things I can think of offhand are >>> 1. add a command line flag to add a step >>> breakpoint so that it will not >>> be necessary to modify os code to get the >>> first breakpoint >>> 2. add a return command to continue until >>> the current function returns. >>> ) >>> >>> By the way, is an emacs mode for javascript >> available >>> ? >>> >>> Thanks, >>> Lysander >>> <dbg.os> >>> <debugger.pat> >> >> >> ____________________ >> CONTACT INFORMATION: >> email: ro...@ti... >> IM: rob@sandjabber >> desk: 1 858 552 2946 >> cell: 1 619 300 9661 >> >> >> >> > |
From: Lysander D. <sa...@sb...> - 2005-12-19 04:42:56
|
I checked version 1894 from trunk. It builds successfully and everything works. I particularly like the option to set the initial breakpoint on the command line. Thanks, Lysander Rob Clark <ro...@ti...> wrote: Ok, I've merged the command-line debugger changes back to the trunk. I made some slight changes: 1) changed the way "next" works to work more like the GUI debugger, without needing changes in Debugger.java 2) used ObjectScript regular expressions for debugger command-line parsing Everything seems to work, as best I can tell... If you want, checkout the latest from the trunk and give it a whirl. I've also merged the changes to build with JDK v1.5.x On 12/6/05 10:08 AM, "Lysander David" wrote: > Thanks for checking in dbg.os. > > 'import "reflection.os";' is not necessary. > It refers to the reflection.os file from the > user guide so that I could use the 'listobj' > function to list the methods and attributes > of objects. > > The patch extends the Breakpoint interface > to allow breakpoints to provide the current > stack frame( getCurrentStackFrame ), the > parent stack frame ( getParentStackFrame ) and > whether or not it is a next breakpoint ( > isNextBreakpoint ). > > Then handle is modified to call isNextBreakpoint. > If isNextBreakpoint returns false, then the step > breakpoint > is handled as normal. If isNextBreakpoint is true, > and the current stack frame or parent stack frame > matches > the current stack frame, the breakpoint is handled. > Otherwise > the stepBp is left unchanged to be added back to the > breakpont stack. > > Additionally _inNextBreakpointStackFrame can be > removed > since it isn't used ( I thought determining if it is > in the > next stack frame would be a little more involved ) > > > --- Rob Clark wrote: > >> I've checked in dbg.os, and added a "-b >> " command-line >> option to set a breakpoint from the command-line... >> see revision 1881 >> >> btw, in dbg.os, what is the 'import >> "reflection.os";'.... I've had a >> brief look thru dbg.os, and it didn't look like it >> was using any >> functions not defined in the same file, but thought >> I should double >> check to make sure that nothing is missing. >> >> I still need to look at the patch file to understand >> the changes... >> hopefully I'll get some time to have a closer look >> tomorrow. >> >> >> On Nov 26, 2005, at 10:54 PM, Lysander David wrote: >> >>> Hi Rob, >>> >>> I have made some modifications to the previous >> dbg.os >>> you previously posted. Here is the help >>> for it: >>> >>> objectsript command line debugger help >>> >>> continue - continue execution ( synonym "c" ) >>> step - single step ( synonym "s" ) >>> next - Next, steps over subs ( synonym "n" ) >>> where - stack trace ( synonym "T" ) >>> up - change context to higher stack frame ( >> synonym >>> "u" ) >>> down - change context to lower stack frame ( >> synonym >>> "d" ) >>> list [file][:[line][:length]] - list the [file] at >>> [line] with [length] number of lines >>> b [[file][:line]] - set a breakpoint. If [file] is >> not >>> specified, a breakpoint is set at the curent debug >>> stack frame >>> b list - list breakpoints >>> d index - delete breakpoint at specified >> breakpoint >>> index >>> help - this message ( synonym "h" ) >>> exit - exit debugging session ( synonym "x", >> "quit", >>> "q") >>> >>> >>> Aside from the os file, some changes in >>> Debugger.java were necessary in order to get >>> the "next" command to work ( see included patch >>> "debugger.pat" ). >>> >>> I realize that a lot of it is kind of hacky but >>> hopfully you can indicate what changes should be >>> made so that it can eventually be included as a >> part >>> of >>> the objectscritpt distribution. >>> >>> ( Two things I can think of offhand are >>> 1. add a command line flag to add a step >>> breakpoint so that it will not >>> be necessary to modify os code to get the >>> first breakpoint >>> 2. add a return command to continue until >>> the current function returns. >>> ) >>> >>> By the way, is an emacs mode for javascript >> available >>> ? >>> >>> Thanks, >>> Lysander >>> >>> >> >> >> ____________________ >> CONTACT INFORMATION: >> email: ro...@ti... >> IM: rob@sandjabber >> desk: 1 858 552 2946 >> cell: 1 619 300 9661 >> >> >> >> > ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click _______________________________________________ Objectscript-users mailing list Obj...@li... https://lists.sourceforge.net/lists/listinfo/objectscript-users |