Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

added example scripts

  • Loading branch information...
commit c808d110712daba94f7db8dbb58ce623d848424c 1 parent 05696c1
Wolfgang Schell authored
68 youdebug-cli/README.md
Source Rendered
... ... @@ -0,0 +1,68 @@
  1 +h1. YouDebug demo
  2 +
  3 +h2. Build demo app
  4 +
  5 +./gradlew war
  6 +
  7 +h2. run demo app in Eclipse debugger
  8 +start web application "buggyweb" on a servlet runtime
  9 +browse to "http://localhost:8080/buggyweb/MyServlet":http://localhost:8080/buggyweb/MyServlet
  10 +
  11 +h2. run demo app in Tomcat
  12 +
  13 +bc.
  14 +cd $CATALINA_HOME
  15 +bin/catalina.sh jpda start
  16 +
  17 +browse to "http://localhost:8080/buggyweb/MyServlet":http://localhost:8080/buggyweb/MyServlet
  18 +
  19 +h3. show Tomcat log file
  20 +
  21 +bc.
  22 +tail -30f logs/localhost.`date +%Y-%m-%d`.log
  23 +
  24 +
  25 +h2. Run demo app in Jetty
  26 +
  27 +export GRADLE_OPTS="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8001"
  28 +./gradlew jettyRun
  29 +
  30 +browse to "http://localhost:8081/buggyweb/MyServlet":http://localhost:8081/buggyweb/MyServlet
  31 +
  32 +
  33 +h3. line break
  34 +
  35 +bc.
  36 +./youdebug -socket 8000 linebreak.ydb
  37 +./youdebug -socket 8001 linebreak.ydb
  38 +
  39 +h3. diagnostics: exception
  40 +
  41 +bc.
  42 +./youdebug -socket 8000 exception.ydb
  43 +./youdebug -socket 8001 exception.ydb
  44 +
  45 +
  46 +h3. diagnostics: parameter check
  47 +
  48 +bc.
  49 +./youdebug -socket 8000 diagnose.ydb
  50 +./youdebug -socket 8001 diagnose.ydb
  51 +
  52 +h3. First fix
  53 +
  54 +bc.
  55 +./youdebug -socket 8000 firstbugfix.ydb
  56 +./youdebug -socket 8001 firstbugfix.ydb
  57 +
  58 +h3. Final fix
  59 +
  60 +bc.
  61 +./youdebug -socket 8000 finalbugfix.ydb
  62 +./youdebug -socket 8001 finalbugfix.ydb
  63 +
  64 +h3. threaddump
  65 +
  66 +bc.
  67 +./youdebug -socket 8000 threaddump.ydb
  68 +./youdebug -socket 8001 threaddump.ydb
5 youdebug-cli/diagnose.ydb
... ... @@ -0,0 +1,5 @@
  1 +vm.breakpoint("net.jetztgrad.buggyweb.MyServlet",35) {
  2 + println "at buggy position in net.jetztgrad.buggyweb.MyServlet, line 35"
  3 + println "age=" + age
  4 + System.out.flush()
  5 +}
4 youdebug-cli/exception.ydb
... ... @@ -0,0 +1,4 @@
  1 +vm.exceptionBreakpoint("java.lang.NumberFormatException") { e ->
  2 + println "caught number format exception"
  3 + e.dumpStackTrace(System.out);
  4 +}
9 youdebug-cli/finalbugfix.ydb
... ... @@ -0,0 +1,9 @@
  1 +vm.breakpoint("net.jetztgrad.buggyweb.MyServlet",35) {
  2 + println "age=" + age
  3 + System.out.flush()
  4 + String ageParam = request.getParameter("age")
  5 + println "setting age to $ageParam"
  6 + System.out.flush()
  7 + age = ageParam
  8 + System.out.flush()
  9 +}
7 youdebug-cli/firstbugfix.ydb
... ... @@ -0,0 +1,7 @@
  1 +vm.breakpoint("net.jetztgrad.buggyweb.MyServlet",35) {
  2 + println "age=" + age
  3 + println "setting age to 50"
  4 + System.out.flush()
  5 + age = "50"
  6 + System.out.flush()
  7 +}
4 youdebug-cli/linebreak.ydb
... ... @@ -0,0 +1,4 @@
  1 +vm.breakpoint("net.jetztgrad.buggyweb.MyServlet",35) {
  2 + println "at buggy position in net.jetztgrad.buggyweb.MyServlet, line 35"
  3 + System.out.flush()
  4 +}
5 youdebug-cli/threaddump.ydb
... ... @@ -0,0 +1,5 @@
  1 +vm.suspend()
  2 +vm.threads*.dumpThread()
  3 +vm.resume()
  4 +vm.close()
  5 +
3  youdebug-cli/vminfo.ydb
... ... @@ -0,0 +1,3 @@
  1 +println vm.virtualMachine.name()
  2 +println vm.virtualMachine.description()
  3 +vm.close()
12 youdebug-cli/ydb_linebreak.launch
... ... @@ -0,0 +1,12 @@
  1 +<?xml version="1.0" encoding="UTF-8" standalone="no"?>
  2 +<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
  3 +<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
  4 +<listEntry value="/youdebug-cli/lib/youdebug-1.3.jar"/>
  5 +</listAttribute>
  6 +<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
  7 +<listEntry value="1"/>
  8 +</listAttribute>
  9 +<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.kohsuke.youdebug.YouDebug"/>
  10 +<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-socket 8000 linebreak.ydb"/>
  11 +<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="youdebug-cli"/>
  12 +</launchConfiguration>

0 comments on commit c808d11

Please sign in to comment.
Something went wrong with that request. Please try again.