Rich,
I moved to the resource script model and all is well.

Thanks!
Eric


On Aug 20, 12:06 am, Eric Thorsen <[EMAIL PROTECTED]>
wrote:
> Rich,
> I made the following change/hack in the compiler (my local copy) for
> the smap entry:
>         String nspath =
> currentNS().getName().getName().replace('.','/');
>
>                 String smap = "SMAP\n" +
>                               simpleName + ".java\n" +
>                               "Clojure\n" +
>                               "*S Clojure\n" +
>                               "*F\n" +
>                               "+ 1 " + source + "\n" +
>                       nspath + "/" + source + "\n" +
>                       //(String) SOURCE_PATH.get() + "\n" +
>                               "*L\n" +
>                               String.format("%d#1,%d:%d\n", lineBefore, 
> lineAfter -
> lineBefore, lineBefore) +
>                               "*E";
> which just prepends the namespace as a path to the source like the
> java compiler does. I can't see this interfering with any otherdebuggerwork 
> going on since it follows the java packaging/pathing
> strategy.
>
> I can now walk into boot.clj from dynamically loaded clojure code in
> an application being debugged or loaded from the repl.  Given what I
> understand about the servlet stuff this will work just fine there as
> well.
> When you get back I'd like to know what limitations you see to this
> approach with the exception of the 1 namespace per file.
> Unless you see a reason this cannot be put into clojure proper, this
> closes my currentdebuggeruse cases.  We are good to go!
>
> Let me know what you think.
> Thanks,
> Eric
>
> On Aug 17, 10:59 pm, Eric Thorsen <[EMAIL PROTECTED]>
> wrote:
>
> > When locationsOfLine is called using the JDI on a java class (such as
> > java.lang.String), you get the following:
> > sourceName = "String.java"
> > sourcePath = "java/lang/String.java"
>
> > I guess my question is, for clojure to follow suit it would have to
> > assume a single namespace per file (there still could be multiple
> > files for one namespace).  If the entries for clojure were:
> > sourceName = "boot.clj"
> > sourcePath = "clojure/boot.clj"
> > I would be all set.  This would include files loaded from a repl with
> > load-file.
>
> > The issue I'm dealing with is when a breakpoint is stored, it keeps
> > the file name, path and preferred class name.  This breakpoint will be
> > used when loaded into a REPL (loaded from a file), or when running in
> > an app (loaded from a resource).  The settings of the smap data differ
> > depending on how the file is loaded and that is the problem I'm
> > banging up against.
> > My desire would be to see consistency between the 2 scenarios.
> > For a clojure source dbg.clj with a namespace my.namespace.is.here I
> > would like to see:
> > sourceName = "dbg.clj"
> > sourcePath = "my/namespace/is/here/dbg.clj"
> > If there is no namespace, just use the file name for the sourcePath
> > regardless of whether dbg.clj was loaded with load-file or
> > loadResourceScript.
> > This  would be consistent with the java debug data.
>
> > I'm assuming you are not looking at the namespace during a load.
> > I've made a local change to the smap code in the compiler to just use
> > the file name for both entries.  This will enable me to move forward
> > but I do run the risk of duplicate files across namespaces this way.
>
> > Any thoughts?
> > Thanks,
> > Eric
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to