SageTV Community  

Go Back   SageTV Community > SageTV Development and Customizations > SageTV Github Development
Forum Rules FAQs Community Downloads Today's Posts Search

Notices

SageTV Github Development Discussion related to SageTV Open Source Development. Use this forum for development topics about the Open Source versions of SageTV, hosted on Github.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 09-02-2015, 08:46 PM
Slugger Slugger is offline
SageTVaholic
 
Join Date: Mar 2007
Location: Kingston, ON
Posts: 4,008
Anyone try to attach remote debugger to server?

Trying to debug my epg plugin, I figured, "hey why not just attach the debugger to the jvm?"

First, the Sage.jar built using the shell scripts and packaged up doesn't include debug symbols. The build using gradle does. So got the jar from gradle build in.

But even after that, the break points I set in the EPG thread (and others I tried as a test) were not being honoured at all. I know the code I tried to break on was running because the log statements in sagetv_0.txt show up. Some other random break points were being honoured, but I couldn't figure out why some were working and others weren't.

I did install Eclipse Mars on this vm so figuring that might be a little too bleeding edge, I also tried IDEA and same thing.

Anyone else tried this? Jeff, any tips for attaching the debugger to the server jvm? I'm running on 32bit ubuntu (vm).

In the end, I just had to mod the logging in the EPG thread as needed, which gets the job done, but being able to attach a debugger would be 1000x better.
__________________
Twitter: @ddb_db
Server: Intel i5-4570 Quad Core, 16GB RAM, 1 x 128GB OS SSD (Win7 Pro x64 SP1), 1 x 2TB media drive
Capture: 2 x Colossus
STB Controller: 1 x USB-UIRT
Software:Java 1.7.0_71; SageTV 7.1.9
Clients: 1 x HD300, 2 x HD200, 1 x SageClient, 1 x PlaceShifter
Plugins: Too many to list now...
Reply With Quote
  #2  
Old 09-02-2015, 10:55 PM
jreichen's Avatar
jreichen jreichen is offline
Sage Icon
 
Join Date: Jul 2004
Posts: 1,192
I haven't done that, but I have created a couple of targets for the build.gradle that launch and debug SageTV from IntelliJ. I haven't tried Eclipse but it may work there too.

I added this and then imported the build.gradle into IntelliJ - you may need to double check the jogl jar file name, I may have changed that. In the Gradle Tool Window, right click on the target and choose debug. It's not integrated with IntelliJ's build system, so you'll need to build it from either the Gradle or shell script.

Sean's going to clean this up sometime and merge it.

Code:
// Run configurations
task runMiniClient(type:JavaExec) {
    main = "sage.miniclient.MiniClient"
    //classpath = sourceSets.main.runtimeClasspath
    classpath += files(
//        sageJarDestinationDir + sageJarName,
        "build/clientrelease/MiniClient.jar",
        "build/clientrelease/gluegen-rt.jar",
        "build/clientrelease/jogl-all.jar"
    )
    classpath += files('images/MiniClient')
    environment 'LD_LIBRARY_PATH', file('/home/sagetv/Development/sagetv/build/clientrelease')
    workingDir file('/home/sagetv/Development/sagetv/build/clientrelease')
}

task runLinuxServer(type:JavaExec) {
    args '0', '0', 'x', 'sagetv Sage.properties'
    main = "sage.Sage"
    classpath = sourceSets.main.runtimeClasspath
    classpath += files(sageJarDestinationDir + sageJarName)
//    systemProperty 'java.library.path', file('/home/sagetv/Development/sagetv/build/so')
//    systemProperty 'java.library.path', file('build/so')
    systemProperty 'java.awt.headless', true
//    environment 'LD_LIBRARY_PATH', file('/home/sagetv/Development/sagetv/build/so')
//    environment 'LD_LIBRARY_PATH', file('build/so')
    environment 'LD_LIBRARY_PATH', file('/home/sagetv/Development/sagetv/build/serverrelease')
    workingDir file('/home/sagetv/Development/sagetv/build/serverrelease')
}
__________________
Server: Intel Core i5 760 Quad, Gigabyte GA-H57M-USB3, 4GB RAM, Gigabyte GeForce 210, 120GB SSD (OS), 1TB SATA, HD HomeRun.
Extender: STP-HD300, Harmony 550 Remote,
Netgear MCA1001 Ethernet over Coax.
SageTV: SageTV Server 7.1.8 on Ubuntu Linux 11.04, SageTV Placeshifter for Mac 6.6.2, SageTV Client 7.0.15 for Windows, Linux Placeshifter 7.1.8 on Server and Client
, Java 1.6.
Plugins: Jetty, Nielm's Web Server, Mobile Web Interface.

Reply With Quote
  #3  
Old 09-03-2015, 01:07 PM
Narflex's Avatar
Narflex Narflex is offline
Sage
 
Join Date: Feb 2003
Location: Redondo Beach, CA
Posts: 6,349
All I do for debugging is have this in my 'sagesettings' file on Linux:

JAVAOPTS="-Xdebug -Xrunjdwp:transport=dt_socket,address=50000,server=y,suspend=n"

And then I can debug directly from NetBeans after doing an attach to the process.

And I didn't realize the scripts were stripping out debug symbols..feel free to change them so they aren't...I thought javac still always included them by default as I haven't had to change a compiler setting in a long time to get them to show up.
__________________
Jeffrey Kardatzke
Google
Founder of SageTV
Reply With Quote
  #4  
Old 09-03-2015, 01:50 PM
Slugger Slugger is offline
SageTVaholic
 
Join Date: Mar 2007
Location: Kingston, ON
Posts: 4,008
Stripped was a bad word. javac doesn't include local var details by default, just line numbers and file info. Need the extra -gsource,lines,vars to get that extra local var info, which gradle does by default.

Yeah, I did the same thing to attach the debugger to the server. Eclipse and IDEA didn't like my break points (some breaks it did stop, most it didn't). Guess I will install NetBeans next time I try.
__________________
Twitter: @ddb_db
Server: Intel i5-4570 Quad Core, 16GB RAM, 1 x 128GB OS SSD (Win7 Pro x64 SP1), 1 x 2TB media drive
Capture: 2 x Colossus
STB Controller: 1 x USB-UIRT
Software:Java 1.7.0_71; SageTV 7.1.9
Clients: 1 x HD300, 2 x HD200, 1 x SageClient, 1 x PlaceShifter
Plugins: Too many to list now...
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Remote connection to server via extender? Skybolt SageTV Software 2 09-24-2012 05:13 AM
How to attach rj45's. SageGk SageTV Media Extender 15 06-01-2008 08:17 PM
Remote Server Question Todd3835 SageTV Software 13 01-04-2008 02:41 PM
Running Studio with Debugger nathanm SageTV Studio 7 12-20-2006 04:36 PM
Start SageTV with java debugger enabled ? dflachbart SageTV Studio 5 03-05-2006 02:31 PM


All times are GMT -6. The time now is 05:50 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, vBulletin Solutions Inc.
Copyright 2003-2005 SageTV, LLC. All rights reserved.