kohsuke / youdebug Goto Github PK
View Code? Open in Web Editor NEWNon-interactive Java debugger with Groovy
Home Page: http://youdebug.kohsuke.org/
License: MIT License
Non-interactive Java debugger with Groovy
Home Page: http://youdebug.kohsuke.org/
License: MIT License
The handler closure for MethodEntryEvent does not have access to the event itself, so it's diffcult to access to actual com.sun.jdi.Method object, which is required, e.g. to differ between multiple methods of the same name.
The handler closure is called here:
See https://github.com/kohsuke/youdebug/blob/master/src/main/groovy/org/kohsuke/youdebug/VM.groovy#L311
The Maven repo linked to on the YouDebug site is down. But YouDebug seems to be available in Maven Central according to http://mvnrepository.com/artifact/org.kohsuke/youdebug
Hey,
I have given a couple of presentations on YouDebug in the past (local Java User Group, GR8Conf 2015 in Copenhagen) and just this week at JavaLand 2024 in Germany. For the latter I updated YouDebug to work with modern Java versions (JDK11+) and would like to see if/how we can merge this upstream instead of live in my clone of the repo.
I will create a PR and am happy to discuss the changes.
Hi,
I wrote the following script:
vm.breakpoint("com.acme.Test",111) {
def map = hashmap
def entries = map.entrySet()
println map
println entries
}
Which prints:
instance of java.util.HashMap(id=33)
instance of java.util.HashMap$EntrySet(id=38)
Although entries
should be a Set
, not java.util.HashMap$EntrySet
since that class does not exist.
When I iterate over the entries, I get the following exception:
vm.breakpoint("freemarker.template.Template",383) {
def map = dataModel.map
def entries = map.entrySet()
println map
println entries
for (entry in entries) {
println(entry.getKey())
}
}
Caused by: org.kohsuke.youdebug.NoSuchMethodException: No such method getKey on class java.util.HashMap$EntrySet (no class loader) that takes [[]]
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:77)
at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:107)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:52)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:192)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:200)
at org.kohsuke.youdebug.JDICategory.chooseMethod(JDICategory.groovy:135)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:86)
at org.codehaus.groovy.runtime.callsite.StaticMetaMethodSite$StaticMetaMethodSiteNoUnwrapNoCoerce.invoke(StaticMetaMethodSite.java:148)
at org.codehaus.groovy.runtime.callsite.StaticMetaMethodSite.callStatic(StaticMetaMethodSite.java:99)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callStatic(AbstractCallSite.java:187)
at org.kohsuke.youdebug.JDICategory.methodMissing(JDICategory.groovy:84)
... 125 more
What would be the way to iterate through HashMap entries?
Thanks!
YouDebug does not state its license. I searched the pom.xml, source code headers, documentation, ... but to no avail. Could you please clarify the license? Is it Apache Public License 2.0 or MIT?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.