17- Debug Red5 source Code

  1. First create a debug configuration in eclipse. Click on the Debug icon in the top nav, then click on Debug Configurations, then click on the Source tab, then click on the Add button, then click on Java Project and click OK, then check the checkbox next to red5_server project, then click OK button. Then click Apply button, then click Debug button, and wait for it to compile. When it is done compiling, it should say: INSTALLER SERVICE CREATED
  2. Press the red stop button, to stop it.
  3. TO SET BREAKPOINT: type ctrl+shif+r, type in bootstrap, and select Bootstrap.java in the list, and click Open button, and it will open Bootstrap.java. Bootstrap.java has the main function which gets called when Red5 first starts. Set a breakpoint on the line that reads: public static void main(String args) To set the breakpoint double click on the left edge of the file on that line.
  4. TO TURN ON LINE NUMBERING: click on Window in the top nav, then click on Preferences, then expand General, then expand Editors, then click on Text Editors, then check the box that says Show line numbers, and then click OK button. And now the line numbers will appear on the left of each line (making it easier to keep track of breakpoints).
  5. TO DEBUG: Click on the Debug icon in the top nav again, then click on Distribution r1, a message will popup asking if we want to open the debug perspective...click the Yes button. And now it will go to our first breakpoint.
  6. Use f5 to step into.
    Use f6 to step over.
  7. TO STOP DEBUGGING: click on Run in the top nav, then click on Terminate.
  8. TO RESET THE LAYOUT: click on Window in the top nav, then click on Open Perspective, then click on Java EE.
« Back to Home