Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Readers > Amazon Kindle > Kindle Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 12-23-2011, 10:06 AM   #1
X19
Junior Member
X19 began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Dec 2011
Device: kindle
Application remote debugging

Hi,

in java is possible to remote debug an application using "socket attach" connection and follow program flow via Eclipse debugging tools.
To do this is needed to start the remote JAR using special parameters as the follows:

java -Xdebug -Xrunjdwp:transport=dt_socket,server=y,address="800 0" -jar Test1.jar

My question is if is possible to load and launch a kindlet (if is in a jar managed by kindle) in the device, using this parameters so we can attach to it and debug it.

Thaks.
X19 is offline   Reply With Quote
Old 12-23-2011, 12:08 PM   #2
yifanlu
Kindle Dissector
yifanlu can program the VCR without an owner's manual.yifanlu can program the VCR without an owner's manual.yifanlu can program the VCR without an owner's manual.yifanlu can program the VCR without an owner's manual.yifanlu can program the VCR without an owner's manual.yifanlu can program the VCR without an owner's manual.yifanlu can program the VCR without an owner's manual.yifanlu can program the VCR without an owner's manual.yifanlu can program the VCR without an owner's manual.yifanlu can program the VCR without an owner's manual.yifanlu can program the VCR without an owner's manual.
 
Posts: 662
Karma: 170717
Join Date: Jul 2010
Device: Amazon Kindle 3
On the kindle touch JDB remote debugging is built in and can be enabled without a jailbreak. Older kindles do not have any debugging features built in and would require you to recompile CVM with debug support.
yifanlu is offline   Reply With Quote
Old 12-23-2011, 05:27 PM   #3
LittleLui
Member
LittleLui began at the beginning.
 
Posts: 16
Karma: 10
Join Date: Dec 2011
Device: Kindle Touch
To elaborate a little on yifanlu's statement: On the Kindle Touch, via ssh, you just have to
1. > mntroot rw
2. > vi /etc/upstart/framework
3. (if not yet familiar with vi, learn to use it)
4. find the commented-out line with the debug configuration (starts with #DEBUG), remove the # and change to suit (i tend to set suspend=n), save it
5. (i usually mntroot ro immediately when i don't need rw anymore)
6. > restart framework

Then you can connect to the VM on the kindle through the usbnetworking.

Obviously, the most daring task of those is number three *g*. Not sure if any editors besides vi are on the kindle, but you could of course always scp to/from your development machine and use your preferred one.
LittleLui is offline   Reply With Quote
Old 12-23-2011, 05:34 PM   #4
yifanlu
Kindle Dissector
yifanlu can program the VCR without an owner's manual.yifanlu can program the VCR without an owner's manual.yifanlu can program the VCR without an owner's manual.yifanlu can program the VCR without an owner's manual.yifanlu can program the VCR without an owner's manual.yifanlu can program the VCR without an owner's manual.yifanlu can program the VCR without an owner's manual.yifanlu can program the VCR without an owner's manual.yifanlu can program the VCR without an owner's manual.yifanlu can program the VCR without an owner's manual.yifanlu can program the VCR without an owner's manual.
 
Posts: 662
Karma: 170717
Join Date: Jul 2010
Device: Amazon Kindle 3
Quote:
Originally Posted by LittleLui View Post
To elaborate a little on yifanlu's statement: On the Kindle Touch, via ssh, you just have to
1. > mntroot rw
2. > vi /etc/upstart/framework
3. (if not yet familiar with vi, learn to use it)
4. find the commented-out line with the debug configuration (starts with #DEBUG), remove the # and change to suit (i tend to set suspend=n), save it
5. (i usually mntroot ro immediately when i don't need rw anymore)
6. > restart framework

Then you can connect to the VM on the kindle through the usbnetworking.

Obviously, the most daring task of those is number three *g*. Not sure if any editors besides vi are on the kindle, but you could of course always scp to/from your development machine and use your preferred one.
Even easier (and you don't have to risk losing amazon updates by modifying the rootfs): go to USB mode and mount on the Kindle's USB drive, make a empty text file named "DEBUG_CVM_JDWP". Then restart and switch to usbnetwork mode. You debug with usbnetwork's IP.
yifanlu is offline   Reply With Quote
Old 12-23-2011, 08:58 PM   #5
ixtab
(offline)
ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.
 
ixtab's Avatar
 
Posts: 2,903
Karma: 6677559
Join Date: Dec 2011
Device: K3, K4, K5, KPW, KPW2
Quote:
Originally Posted by LittleLui View Post

3. (if not yet familiar with vi, learn to use it)
Obviously, the most daring task of those is number three *g*.
>> vi is not an editor
>What is it then?
I think it makes music. All I seem to get from it is beeps.

A classic by now, and I still love it. http://www.redhat.com/archives/fedor.../msg01530.html

:-)
ixtab is offline   Reply With Quote
Old 12-27-2011, 08:36 PM   #6
X19
Junior Member
X19 began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Dec 2011
Device: kindle
I have K4 NT, I don't have /etc/upstart/framework, I have working SSH over WIFI, is possible use WIFI IP to debug using DEBUG_CVM_JDWP?
X19 is offline   Reply With Quote
Old 12-27-2011, 09:34 PM   #7
geekmaster
Всё гениальное просто.
geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.
 
geekmaster's Avatar
 
Posts: 5,070
Karma: 6789001
Join Date: Nov 2011
Location: Щедрость не имеет пределов.
Device: *.*
Quote:
Originally Posted by LittleLui View Post
Obviously, the most daring task of those is number three *g*. Not sure if any editors besides vi are on the kindle, but you could of course always scp to/from your development machine and use your preferred one.
I have a nano editor with no (extra) library dependencies that I keep in my /mnt/us/bin folder on my kindle touch. As I recall, I just copied it from the loop-mounted optware directory that I use in my kindle 3, and it "just worked". I use "vee-eye" when I must, but I never learned to *love* it. At least I am not addicted to emacs.

Last edited by geekmaster; 12-27-2011 at 09:39 PM.
geekmaster is offline   Reply With Quote
Old 12-27-2011, 09:45 PM   #8
yifanlu
Kindle Dissector
yifanlu can program the VCR without an owner's manual.yifanlu can program the VCR without an owner's manual.yifanlu can program the VCR without an owner's manual.yifanlu can program the VCR without an owner's manual.yifanlu can program the VCR without an owner's manual.yifanlu can program the VCR without an owner's manual.yifanlu can program the VCR without an owner's manual.yifanlu can program the VCR without an owner's manual.yifanlu can program the VCR without an owner's manual.yifanlu can program the VCR without an owner's manual.yifanlu can program the VCR without an owner's manual.
 
Posts: 662
Karma: 170717
Join Date: Jul 2010
Device: Amazon Kindle 3
Quote:
Originally Posted by X19 View Post
I have K4 NT, I don't have /etc/upstart/framework, I have working SSH over WIFI, is possible use WIFI IP to debug using DEBUG_CVM_JDWP?
Not that I'm aware of. When I tried it, it wouldn't connect. You can always make an SSH tunnel though.
yifanlu is offline   Reply With Quote
Old 12-28-2011, 03:24 AM   #9
X19
Junior Member
X19 began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Dec 2011
Device: kindle
The main problem is that I can't enable usbnet in normal mode but only in debug mode. Can you explain me the step to set K4 in usbnet in normal mode (permanent)?
Thaks.
X19 is offline   Reply With Quote
Old 12-28-2011, 04:51 AM   #10
X19
Junior Member
X19 began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Dec 2011
Device: kindle
I try to run custom start.sh, but JVM debug options (agentlib or Xrunjdwp) is not supported and JVM not start, any idea?
X19 is offline   Reply With Quote
Old 12-28-2011, 12:25 PM   #11
yifanlu
Kindle Dissector
yifanlu can program the VCR without an owner's manual.yifanlu can program the VCR without an owner's manual.yifanlu can program the VCR without an owner's manual.yifanlu can program the VCR without an owner's manual.yifanlu can program the VCR without an owner's manual.yifanlu can program the VCR without an owner's manual.yifanlu can program the VCR without an owner's manual.yifanlu can program the VCR without an owner's manual.yifanlu can program the VCR without an owner's manual.yifanlu can program the VCR without an owner's manual.yifanlu can program the VCR without an owner's manual.
 
Posts: 662
Karma: 170717
Join Date: Jul 2010
Device: Amazon Kindle 3
Quote:
Originally Posted by X19 View Post
The main problem is that I can't enable usbnet in normal mode but only in debug mode. Can you explain me the step to set K4 in usbnet in normal mode (permanent)?
Thaks.
You have a kindle 4? There is no java debugging support on the K4.
yifanlu is offline   Reply With Quote
Old 12-29-2011, 04:46 AM   #12
X19
Junior Member
X19 began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Dec 2011
Device: kindle
How recompile CVM with debug support?
X19 is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Application update: application not installed error Merischino Kindle Fire 4 12-01-2011 11:30 PM
Debugging intermittent failures, how to? guterm Recipes 9 01-16-2011 02:20 AM
Debugging Password kaitorii enTourage Archive 4 11-14-2010 10:34 AM
PRS-500 Tools for debugging javascript ...? Clemenseken Sony Reader Dev Corner 6 05-03-2008 03:51 PM
iLiad Debugging and the iLiad scotty1024 iRex Developer's Corner 2 10-23-2006 04:43 PM


All times are GMT -4. The time now is 12:45 AM.


MobileRead.com is a privately owned, operated and funded community.