Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

added example scripts

  • Loading branch information...
commit c808d110712daba94f7db8dbb58ce623d848424c 1 parent 05696c1
@jetztgradnet authored
View
68 youdebug-cli/README.md
@@ -0,0 +1,68 @@
+h1. YouDebug demo
+
+h2. Build demo app
+
+./gradlew war
+
+h2. run demo app in Eclipse debugger
+start web application "buggyweb" on a servlet runtime
+browse to "http://localhost:8080/buggyweb/MyServlet":http://localhost:8080/buggyweb/MyServlet
+
+h2. run demo app in Tomcat
+
+bc.
+cd $CATALINA_HOME
+bin/catalina.sh jpda start
+
+browse to "http://localhost:8080/buggyweb/MyServlet":http://localhost:8080/buggyweb/MyServlet
+
+h3. show Tomcat log file
+
+bc.
+tail -30f logs/localhost.`date +%Y-%m-%d`.log
+
+
+h2. Run demo app in Jetty
+
+export GRADLE_OPTS="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8001"
+./gradlew jettyRun
+
+browse to "http://localhost:8081/buggyweb/MyServlet":http://localhost:8081/buggyweb/MyServlet
+
+
+h3. line break
+
+bc.
+./youdebug -socket 8000 linebreak.ydb
+./youdebug -socket 8001 linebreak.ydb
+
+h3. diagnostics: exception
+
+bc.
+./youdebug -socket 8000 exception.ydb
+./youdebug -socket 8001 exception.ydb
+
+
+h3. diagnostics: parameter check
+
+bc.
+./youdebug -socket 8000 diagnose.ydb
+./youdebug -socket 8001 diagnose.ydb
+
+h3. First fix
+
+bc.
+./youdebug -socket 8000 firstbugfix.ydb
+./youdebug -socket 8001 firstbugfix.ydb
+
+h3. Final fix
+
+bc.
+./youdebug -socket 8000 finalbugfix.ydb
+./youdebug -socket 8001 finalbugfix.ydb
+
+h3. threaddump
+
+bc.
+./youdebug -socket 8000 threaddump.ydb
+./youdebug -socket 8001 threaddump.ydb
View
5 youdebug-cli/diagnose.ydb
@@ -0,0 +1,5 @@
+vm.breakpoint("net.jetztgrad.buggyweb.MyServlet",35) {
+ println "at buggy position in net.jetztgrad.buggyweb.MyServlet, line 35"
+ println "age=" + age
+ System.out.flush()
+}
View
4 youdebug-cli/exception.ydb
@@ -0,0 +1,4 @@
+vm.exceptionBreakpoint("java.lang.NumberFormatException") { e ->
+ println "caught number format exception"
+ e.dumpStackTrace(System.out);
+}
View
9 youdebug-cli/finalbugfix.ydb
@@ -0,0 +1,9 @@
+vm.breakpoint("net.jetztgrad.buggyweb.MyServlet",35) {
+ println "age=" + age
+ System.out.flush()
+ String ageParam = request.getParameter("age")
+ println "setting age to $ageParam"
+ System.out.flush()
+ age = ageParam
+ System.out.flush()
+}
View
7 youdebug-cli/firstbugfix.ydb
@@ -0,0 +1,7 @@
+vm.breakpoint("net.jetztgrad.buggyweb.MyServlet",35) {
+ println "age=" + age
+ println "setting age to 50"
+ System.out.flush()
+ age = "50"
+ System.out.flush()
+}
View
4 youdebug-cli/linebreak.ydb
@@ -0,0 +1,4 @@
+vm.breakpoint("net.jetztgrad.buggyweb.MyServlet",35) {
+ println "at buggy position in net.jetztgrad.buggyweb.MyServlet, line 35"
+ System.out.flush()
+}
View
5 youdebug-cli/threaddump.ydb
@@ -0,0 +1,5 @@
+vm.suspend()
+vm.threads*.dumpThread()
+vm.resume()
+vm.close()
+
View
3  youdebug-cli/vminfo.ydb
@@ -0,0 +1,3 @@
+println vm.virtualMachine.name()
+println vm.virtualMachine.description()
+vm.close()
View
12 youdebug-cli/ydb_linebreak.launch
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
+<listEntry value="/youdebug-cli/lib/youdebug-1.3.jar"/>
+</listAttribute>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
+<listEntry value="1"/>
+</listAttribute>
+<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.kohsuke.youdebug.YouDebug"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-socket 8000 linebreak.ydb"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="youdebug-cli"/>
+</launchConfiguration>
Please sign in to comment.
Something went wrong with that request. Please try again.