Author Topic: [QUESTION] How to debug application?  (Read 637 times)

Offline the_gama

  • *
  • Posts: 123
[QUESTION] How to debug application?
« on: July 28, 2013, 02:48:32 AM »
Hi,

  I'm working on porting an app for the gcw0. I'm using a debian distro (wheezy) running through vmware, I have already installed the gcw0 toolchain, compiled the app and built an opk using the OpenPackageCreator program.

I copy the opk to the sdcard and it runs fine, but I found some bugs when using the program.  Does anybody know how to get some debug info?, even something basic like reading stderr output would be fine for me ;).

Can I use telnet for that purpose?  It would be great if I could launch the app directly from debian (vmware), is that posible?

Thanks in advance.

Offline johnnyonflame

  • *
  • Posts: 176
Re: [QUESTION] How to debug application?
« Reply #1 on: July 28, 2013, 03:11:37 AM »
Yes, you can use telnet for that. GDB and other tools are available for development/debugging, and they're all present on the rootfs already.
In case your application requires binding the framebuffer (if it uses video) you can run the "terminal" application before, so it leaves the framebuffer available.

Offline DiegoSLTS

  • *
  • Posts: 320
Re: [QUESTION] How to debug application?
« Reply #2 on: July 28, 2013, 10:19:49 PM »
You can read the output of the program opening the "Log viewer" in the "Settings" tab (it was available in the A320, so I guess it's still there in the Zero). It shows you the output of the last program you used.

Offline the_gama

  • *
  • Posts: 123
Re: [QUESTION] How to debug application?
« Reply #3 on: July 29, 2013, 01:51:45 AM »
Thanks for your answers.

Indeed, using the LogViewer I managed to found the problem.  It's a nice feature when you don't have an USB cable.
But it's an slower process, so I will try to test/debug the app directly from debian.

Offline johnnyonflame

  • *
  • Posts: 176
Re: [QUESTION] How to debug application?
« Reply #4 on: July 29, 2013, 06:31:07 PM »
Thanks for your answers.

Indeed, using the LogViewer I managed to found the problem.  It's a nice feature when you don't have an USB cable.
But it's an slower process, so I will try to test/debug the app directly from debian.

You can also use TELNET via the WiFi connection fyi.

Offline the_gama

  • *
  • Posts: 123
Re: [QUESTION] How to debug application?
« Reply #5 on: August 13, 2013, 09:11:17 PM »
Hi, ok I trying to debug an app I'm working on.  As I said earlier I'm using a debian distro running through vmware, I have already installed the rndis drivers in windows 7 and I can telnet to 10.1.1.2 to connect to the zero.

But now I'm a bit lost, do I have to copy the executable file to the zero to launch it?

Could someone be kind enough to post the necessary steps to launch an app from telnet?  What I want to achieve is simply, browse to the folder where I built the app and run it in the zero, and get the console output in the pc.

I remember I did something similar with the dingoo and the psp.  But I forgot how to do it ;P.

[EDIT]

Ok, I managed to launch the app from telnet :).  It was quite easy after all, just sent the executable to the sdcard through ftp.  Then telnet to 10.1.1.2 and launched the app, and I get the printf output to the telnet window. Excelent.

I hope I can release the app in a couple of weeks ;).
« Last Edit: August 14, 2013, 02:59:22 AM by the_gama »

Offline mth

  • *
  • Posts: 255
Re: [QUESTION] How to debug application?
« Reply #6 on: August 14, 2013, 05:51:30 AM »
If you're making a graphical application, run the "Terminal" application in gmenu2x to make gmenu2x release its control of the screen so the application launched from telnet can access the screen instead.

If you want to debug crashes, you can run your application in gdb ("gdb appname" on the command line in telnet, then "run" at the gdb prompt) and use the gdb "bt" command to see a stack trace of where the crash happened.