On Target debugging with Series 60 devices

Keywords:

Setting up the system

gdbstub.sis
gdbstub.sis
1. Install gdbstub.sis on your phone. This file is installed by default by the Nokia SDK in the following directory:

C:\Symbian\6.1\Series60\Epoc32\Release\armi\urel\

2. Still on the phone, start FExplorer or your favorite file manager application and create a directory c:\gdbstub. Upload a gdbstub.ini file with the following contents in the created directory :

[COMMSERV]
PDD=EUART%d
LDD=ECOMM
CSY=IRCOMM
PORT=0
RATE=115200

3. On your PC, create some directory c:\yyy and put the c:\yyy\gdb.ini in it with the following contents:

symbol-file //c/symbian/6.1/series60/epoc32/release/armi/udeb/xxx.sym
epoc-exec-file c:\system\apps\xxx\xxx.app
target epoc com2
break NewApplication
source //c/symbian/6.1/shared/epoc32/gcc/share/epoc-des.ini

Replace xxx and yyy with the appropriate values. Replace com2 with your IrDA's com port. You may need to install some IrDA to COM mapper on your win32 machine (e.g. IrCOMM2k by Jan Kiszka).

Compilation

The application to debug shall be built using armi udeb target: abld build armi udeb

If the linker fails because it cannot find libs for udeb (this will be probably the case at your first try), just copy everything from epoc32/release/armi/urel to epoc32/release/armi/udeb.

Pacakge and install the appliction on the phone.

Launching the debugger

Start FExplorer and run c:\system\programs\gdbstub.exe. The IrDA indicator should blink now. Note that you don't need to use connection/IrDA/activate prior to this, because the gdbstub will open itself the IrDA connection.

Put your phone and your PC IrDA adapter in sight. Then, from your PC, open the a DOS shell, move to c:\yyy and run

gdb.exe -nw

The following message should appear:

GNU gdb 4.17-psion-98r2
Copyright 1998 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This version of GDB has been modified by Symbian Ltd. to add EPOC support.
Type "show epoc-version" to see the EPOC-specific version number.
This GDB was configured as "--host=i686-pc-cygwin32 --target=arm-epoc-pe".
Breakpoint 1 at 0x(some adress): file <your source file that contains
NewApplication>
(gdb) *prompt*

The IrDA connection shall be established (the phone IrDA icon shall not blink anymore and be persisently visible now).

Enter "run" on the (gdb) prompt. The following should appear:

Starting program:
warning: Application started but no document specified.
The application may panic at some point if it is document based and if there is no existing default document.

Breakpoint 1 0x(some adress): file <your source file that contains
NewApplication>
Breakpoint 1, NewApplication ()
   at file <your source file that contains NewApplication>
   <some sourcecode>
Current language:  auto; currently c++

If your gdb writes "Starting program:", but nothing happens within a second, you've failed! I've got this sometimes and I just restart my phone (and sometimes my PC) to get rid of it. If this doesn't help, then you have to check that your IrDA stuff works [1]

That's it! Now you can run, step or whatever...

Open questions

-  How to catch panics at the place they occur?
-  How to set breakpoints in other threads than the main one?

[1] Start "PC Suite". Right click on the "connector"-symbol on the tray; properties; check-on your IrDA-COM. Restart your phone in case you did execute gdbstub to get a clean phone.On your phone connection/IrDA/activate and point to your win32. Now "connected" or something similar should appear. If this is fine be sure that you uncheck IrDA-COM and restart your phone before trying to gdb again!!!


Missing sis

Interesting article! Unfortuantely the gdbstub.sis link points to a local file...

> Missing sis

Yes. You should have it installed on the specified directory with the Nokia SDK (at least the version 1.2).

> Missing sis

Ah, I see. Still using 1.0 for compatibility reasons... TX

> Missing sis

I have added the file. Just checking the permission with Symbian...

> Missing sis

The gbdstub.exe causes my 3650/7650 (both with latest fw) to freeze/reboot. Can you use your symbian contacts to find out a cause? Did they tested the gdb with any 1.x device?

> Missing sis

does the gdbstub support the 6680 phone. The sdk is the DP V2_FP2.

> Missing sis

GNU gdb 4.17-psion-98r2 Copyright 1998 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This version of GDB has been modified by Symbian Ltd. to add EPOC support. Type "show epoc-version" to see the EPOC-specific version number. This GDB was configured as "--host=i686-pc-cygwin32 --target=arm-epoc-pe". (no debugging symbols found)...gdb.ini:4: Error in sourced command file: No symbol table is loaded. Use the "file" command.

GDB Support for Symbian OS version 9.1

Is there GDB support for Symbian Version 9.1? How to go about it??

> On Target debugging with Series 60 devices

The installer says the sis is not compatible with this phone (7650).

What is wrong with it?

> On Target debugging with Series 60 devices

Looks like it can be installed on some and not on others...

I tried with a 7650 and a 3650. Could just install it on the 7650.

But I don't know why.

> On Target debugging with Series 60 devices

I managed to get it working with Nokia 3650 and Nokia 7650. I am using a mother board connectable IRda adapter, WinXP and Nokia Borland SDK v0.9.

I used 1.2.1 version of the IRDA/comm application and connected it to COM3.

3650 complains that it may not work, but it does. I will try the other camera GSM phones soon.

I also tried a number of things to get it working with BlueTooth, but did not manage.

> On Target debugging with Series 60 devices

Hi, anyone knows what are params for setting BLUETOOTH debugging session?

> On Target debugging with Series 60 devices

Has anybody managed to get this to work on bluetooth yet? The GDBStub seems to load up, but in the log file it generates:

Byte reception failure (epoc error is -1).

Any ideas?

Thanks

Stuart Smith

> On Target debugging with Series 60 devices

I get the error "error 6 (epoc error is -21)" when I try bluetooth debugging..

> On Target debugging with Series 60 devices

Hi Stuart,

I have been getting the same problems while using gdbstub. Were you able to find a workaround to this issue.

Regards, Puneet