Old 07/03/2009, 03:26 AM   #1 (permalink)
Member
 
TheMarco's Avatar
 
Join Date: Jun 2009
Location: Sunnyvale CA
Posts: 534
Thanks: 18
Thanked 103 Times in 46 Posts
Default How the hell do you guys debug?

The book says:

"So you'll want to use the webOS Emulator with integrated JavaScript debugger and DOM inspector."

Where is this integrated JS debugger and DOM inspector?

I can't figure out how to debug. Nothing JS related shows up in my /var/log/messages either.

Anyone?
TheMarco is offline   Reply With Quote
Old 07/03/2009, 03:41 AM   #2 (permalink)
Member
 
rboatright's Avatar
 
Join Date: Jun 2009
Location: topeka, ks
Posts: 520
Thanks: 4
Thanked 182 Times in 86 Posts
Default

with the palm-inspector that's included with the sdk. The setup of palm-inspector appears to be a bit of a dark-art.
rboatright is online now   Reply With Quote
Old 07/03/2009, 03:42 AM   #3 (permalink)
Homebrew Developer
 
edektor's Avatar
 
Join Date: Jun 2009
Posts: 40
Thanks: 0
Thanked 14 Times in 6 Posts
Default

Quote:
Originally Posted by TheMarco View Post
The book says:

"So you'll want to use the webOS Emulator with integrated JavaScript debugger and DOM inspector."

Where is this integrated JS debugger and DOM inspector?

I can't figure out how to debug. Nothing JS related shows up in my /var/log/messages either.

Anyone?
Yeah there is something inlcuded with the SDK called the Palm-Inspector but everytime I try and open it it crashes... Also if you ssh into the emulator or the phone and type log <"com.yourname.yourappname"> i.e. log "com.palm.bluetooth" it will show a log of that application.. But I have noticed that it doesn't log everything... Has anybody got the inspector working?
edektor is offline   Reply With Quote
Old 07/03/2009, 03:45 AM   #4 (permalink)
Member
 
TheMarco's Avatar
 
Join Date: Jun 2009
Location: Sunnyvale CA
Posts: 534
Thanks: 18
Thanked 103 Times in 46 Posts
Default

I tried typing my app name (and com.palm.bluetooth) but all I get is 'not found'.

rboatright can you tell us something about how to set it up or are you one of the lucky ones and under NDA?
TheMarco is offline   Reply With Quote
Old 07/03/2009, 03:49 AM   #5 (permalink)
Homebrew Developer
 
edektor's Avatar
 
Join Date: Jun 2009
Posts: 40
Thanks: 0
Thanked 14 Times in 6 Posts
Default

Quote:
Originally Posted by TheMarco View Post
I tried typing my app name (and com.palm.bluetooth) but all I get is 'not found'.

rboatright can you tell us something about how to set it up or are you one of the lucky ones and under NDA?
type "log com.palm.bluetooth"
edektor is offline   Reply With Quote
Old 07/03/2009, 04:01 AM   #6 (permalink)
Member
 
TheMarco's Avatar
 
Join Date: Jun 2009
Location: Sunnyvale CA
Posts: 534
Thanks: 18
Thanked 103 Times in 46 Posts
Default

Hmmm this doesn't look promising at all.

The log works indeed but I get nothing of any use in it. I can't tell whether my javascript:

- gets loaded at all or not
- gets executed at all or not
- has errors or not
- does anything at all

Is there any information anywhere on how to get such information?
TheMarco is offline   Reply With Quote
Old 07/03/2009, 04:16 AM   #7 (permalink)
Member
 
rboatright's Avatar
 
Join Date: Jun 2009
Location: topeka, ks
Posts: 520
Thanks: 4
Thanked 182 Times in 86 Posts
Default

to put stuff in the log you can add Mojo.Log calls. (See com.webosinternals.commander for examples.)

re inspector, I have problems but I know this much.

after using palm-install to install your app to the emulator,say:

palm-launch -d tcp -i com.webosinternals.commander (use your app's 3 part name)

then run palminspector and you will see inspector open with the code for your app. Try clicking stuff.
rboatright is online now   Reply With Quote
Thanked By 2:
Old 07/03/2009, 04:20 AM   #8 (permalink)
Member
 
Join Date: Jun 2009
Posts: 425
Thanks: 15
Thanked 234 Times in 72 Posts
Default

You actually can debug through SSH to the emulator.

I connect to the emulator using putty and creating an SSH connection to localhost:5522

Once in, you type debug. That will cause some lines to show up, but won't give you back a prompt. Then you simply hit enter.

You can get help by typing help or ?

It is a real pain to use, but you can set breakpoints continue and step through your code. You can also see info on locals and args. You can also use the print command to display information about objects.

Things like this are why the SDK has not been released publicly. Most developers are used to advance debugging interfaces and something like this can be hard for some people to work with.
Blubble is online now   Reply With Quote
Old 07/03/2009, 07:14 AM   #9 (permalink)
Member
 
Join Date: Jun 2009
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by rboatright View Post
to put stuff in the log you can add Mojo.Log calls. (See com.webosinternals.commander for examples.)

re inspector, I have problems but I know this much.

after using palm-install to install your app to the emulator,say:

palm-launch -d tcp -i com.webosinternals.commander (use your app's 3 part name)

then run palminspector and you will see inspector open with the code for your app. Try clicking stuff.
Thanks! Finally got the inspector to work.
fluid_motion is offline   Reply With Quote
Old 07/03/2009, 01:22 PM   #10 (permalink)
Member
 
TheMarco's Avatar
 
Join Date: Jun 2009
Location: Sunnyvale CA
Posts: 534
Thanks: 18
Thanked 103 Times in 46 Posts
Default

Thanks a lot guys! This is really helpful. I can now at least get messages to be spit out to the log so I can sort of see what I'm doing
TheMarco is offline   Reply With Quote
Old 07/04/2009, 06:55 PM   #11 (permalink)
Member
 
Join Date: Jun 2009
Location: Chicago, IL
Posts: 7
Thanks: 3
Thanked 7 Times in 2 Posts
Default

I've got the inspector running properly but I'm surprised that I don't see a javascript debugger. is debugging through the command line the only way to do it? also, wow is this dom inspector slow.
clickonchris is offline   Reply With Quote
Old 07/04/2009, 07:10 PM   #12 (permalink)
Member
 
Join Date: Jun 2009
Posts: 425
Thanks: 15
Thanked 234 Times in 72 Posts
Default

Yep. So far the command line is the only way to do it. To make matters worse, putty SSH doesn't allow the arrow up or down feature to autotype previous commands like in Windows command prompt. It is a real nightmare.

Also, if you want to debug on your phone, you have to flash it with the dev image from Palm. I don't know if that image has leaked. You might be able to do it with a rooted phone, but I haven't tried that.
Blubble is online now   Reply With Quote
Old 07/04/2009, 07:49 PM   #13 (permalink)
Member
 
mdmogren's Avatar
 
Join Date: Jun 2009
Posts: 382
Thanks: 29
Thanked 35 Times in 26 Posts
Default

Quote:
Originally Posted by Blubble View Post
...To make matters worse, putty SSH doesn't allow the arrow up or down feature to autotype previous commands like in Windows command prompt. It is a real nightmare.
?? Um, yes it does... I use it everyday.
mdmogren is offline   Reply With Quote
Old 07/04/2009, 08:43 PM   #14 (permalink)
Member
 
Join Date: Jun 2009
Posts: 425
Thanks: 15
Thanked 234 Times in 72 Posts
Default

Really? Whenever I hit up or down, it just gives me a weird bunch of characters. Is there some setting to avoid this? I am using it on Vista 64 bit. I just run SSH from the dialog box. Then I log in as root and type debug. Once in debug mode, I can't use up or down.
Blubble is online now   Reply With Quote
Old 07/04/2009, 10:46 PM   #15 (permalink)
Member
 
rboatright's Avatar
 
Join Date: Jun 2009
Location: topeka, ks
Posts: 520
Thanks: 4
Thanked 182 Times in 86 Posts
Default

the debug program does not maintain a command buffer, so uparrow does not call back commands. It's a horrible debugger. (d8)
d8 is part of the google v8 javascript interpretor project. There - has - to be a frontend available.
rboatright is online now   Reply With Quote
Reply

Thread Tools
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 02:35 PM.

Creating smartphone communities
Android Central - Android reviews, news and forums Crackberry - Blackberry news, reviews and community TiPb - iPhone news, accessory reviews & forums
Pre Central - Palm Pre Review, News and Community Treo Central - Treo & Centro News and Forums WMExperts - Windows Mobile Reviews & News

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0