i trying set breakpoint in scala macro implementation using eclipse ide , failing
firstly: scala macros rock! have preferred clojure scala, macros i'm no longer sure
i'm trying create macro return tostring of function , function itself. when works i'm going make new function sensible tostring. ah happy days.
but need able debug macros. use eclipse (20110615-0604), scala (2.10.1). downloaded scala-compiler-2.10.1.jar , code http://www.warski.org/blog/2012/12/starting-with-scala-macros-a-short-tutorial/ works. i've written couple of simple macros well. macros in eclipse project "scalamacro" , code uses them in separate project "helloscalamacro"
i'd debug them
following instructions @ http://docs.scala-lang.org/overviews/macros/overview.html have created runtime configuration scala.tools.nsc.main entry point. i've added -cp helloscala.scala, , when run configuration seems compile code (if put errors in, reports errors correctly).
unfortunately instructions imply breakpoint in macro implementation should cause eclipse pause. doesn't.
i've done usual: google search eclipse/scala macro/debug/breakpoint, read stackoverflow questions in scala-macro tag, , played around lot every eclipse setting can find.
so if of out there know how set breakpoints, let me know how: eclipse version / scala version / ... issue?
i haven't tried myself, , in principle (or more likely) fail you've tried, if successful more convenient you.
to try should have scala-ide along source feature installed. make sure working off of eclipse installation either "eclipse classic", "eclipse rcp developers", or similar concoction came on own.
you want install equinox weaving launcher plugin, allow create "eclipse application equinox weaving" launchers.
now:
- create new workspace
- create scala project
- plant macro code in project
- add break point in macro source
getting ready debug:
create new "eclipse application equinox weaving" debug launch configuration. give name more elegant "new_configuration".
- under "location", point towards new different workspace directory
- under "configuration" tab, provide "-xmx1536m"
- by default, plugins available running eclipse instance should available instance launch. eclipse may need cajoling in order include non-plugin project in classpath -- if doesn't work, that's first thing i'd try at.
you want launch debug configuration.
- depending on scala-ide version, may encounter "multiple launchers available -- select one..." warning. i'd go "equinox weaving enabled eclipse application launcher".
once inside eclipse instance being debugged:
- create project want use macro
- make sure add dependency on binary output
- add small usage example of macro project in workspace being debugged.
- cross fingers
- build
in theory, launching eclipse instance pause instance being debugged on break point.
Comments
Post a Comment