在Series 60设备上进行调试

来源:互联网 发布:淘宝买了电动车后悔了 编辑:程序博客网 时间:2024/04/19 11:02
安装系统

1、在你的手机上安装gdbsudb.sis。这个文件被NOKIA SDK放在这个默认目录里
C:/Symbian//6.1/Series60/Epoc32/Release/armi/urel/

2、关掉手机,启动FExplorer或你的文件管理程序来创建一个名为c:/gdbstub的目录。上传包含下列内容的gdbstud.ini文件到我们新建立的目录。
[COMMSERV]

PDD=EUART%d

LDD=ECOMM

CSY=IRCOMM

PORT=0

RATE=115200
 
3、在PC端创建C:/yyy并创建一个c:/yyy/gdb.ini文件,把下面的内容Ctrl+V进去:
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
 

4、用适当的内容来代替xxx和yyy。将你的IrDA端口变成com2.你可能需要在电脑上装一个可以把IrDA映射为COM的软件(例如IrCOMM2k)
编译

abld build armi udeb
 
如果连接失败是因为它找不到库(第一次通常都是这样),只要把epoc32/release/armi/urel下所有的内容复制到epoc32/release/armi/udeb就OK了。

打包并安装应用程序到手机上。

开始调试

gdb.exe -nw
 

启动FExplorer并运行c:/ system/programs/gdbstub.exe.IrDA(红外线)连接指示灯将开始闪烁。注意不不需要用connection/IrDA/activate来做这些事,因为gdbstub将会自动打开红外连接。把手机放在PC的红外范围之内,随后打开PC的DOS窗口。进入C:/yyy并键入下列命令


将会出现下列信息:

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

NewApplication>

(gdb) *prompt*
 

点击”run”(gdb),将出现下列内容:

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 NewApplication> Breakpoint 1, NewApplication () at file Current language: auto; currently c++
 
如果你的gdb显示出”Starting program”,但在接下来没有发生别的事,那么你失败了.我有时就会遇到这样的问题,只能通过重启手机(和PC)来解决.如果这样仍然没有解决的话,或许你的IrDA红外线设备有问题。


使用BlueTooth进行设备调试

文/Peter Jiang(译自newlc.com)

1、 安装gdbstud.sis到手机上。这个文件在NOKIA SDK中的默认路径为:C:/Symbian/7.0s/Series60_v20/Epoc32/Release/armi/urel/.
2、 创建gdbstub.ini
你应该在目标上创建一个C:/gdbstub.并在这个目录中使用记事本创建一个gdbstub.ini文件,文件中包含如下内容:

标准
 蓝牙
 
[COMMSERV]
 [COMMSERV]
 
PDD=EUART%d
 PDD=EUART1
 
LDD=ECOMM
 LDD=ECOMM
 
CSY=IRCOMM
 CSY=BTCOMM
 
PORT=0
 PORT=0
 
RATE=115200
 RATE=9600
 

3、 创建gdb.ini
在你的PC上创建一个目录C:/bbb并把gdb.ini文件放进去。以下是gdb.ini的内容。

symbol-file //c/symbian/7.0s/series60_v20/epoc32/release/armi/udeb/aaa.sym epoc-exec-file c:/system/apps/aaa/aaa.app target epoc com3 break NewApplication source //c/symbian/7.0s/shared/epoc32/gcc/share/epoc-des.ini
 
注:用你的程序的名字来代替aaa和bbb

检查第三行的端口号并用合适的端口号来代替

com口编号只能在1到4之间

4、 编译
应用程序应使用armi udeb进行调试:

abld build armi udeb
 
如果提示错误或警告,拷贝epoc32/release/armi/urel的所有内容到epoc32/release/armi/udeb中即可。

5、 更新pkg文件
现在转向你的应用程序xxx.pkg文件并改变所有路径以便从armi/udeb目录获取编译后的代码。

6、 开始调试
① 在手机上安装FExplorer软件(杂志附加工具包中已提供)。
② 通过FExplorer软件进入C:/system/programs/gdbstub.exe
③ 检查在C:/system/libs/下的gdbseal.dll和gdbseng.dll文件
④ 在手机上启动gdbstub.exe。
⑤ 在PC的DOS提示符状态进入c:/bbb目录并运行下列命令
gdb.exe -nw
 
将会出现下列信息

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

Breakpoint 1 at 0x(some adress): file

NewApplication>

gdb>
 
然后在gdb提示中,键入run,将会出现下列信息

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

NewApplication>

Breakpoint 1, NewApplication ()

at file


Current language: auto; currently c++
 

系统需求

I硬件

1、 PC
2、 蓝牙/红外适配器
3、 Symbian手机
II软件

PC

1、 Symbian SDK
2、 VC++6.0
3、 蓝牙驱动
4、 Gdb.ini
Symbian手机

1、 gdbstub.sis
2、 gdbstud.ini
3、 fexplorer.sis

 

1. 安装 gdbstub
在电话上安装gdbstub.sis。这个文件由Nokia SDK在默认下在以下路径中安装C:/ Symbian/7.0s/Series60_v20/Epoc32/release/armi/urel/.
2. 创建 gdbstub.ini
你应该创建一个文件夹 C:/ gdbstub。并且在这个文件中使用记事本,创建一个包含以下内容的文件gdbstub.ini
 

General
Bluetooth
[COMMSERV]
[COMMSERV]
PDD=EUART%d
PDD=EUART1
LDD=ECOMM
LDD=ECOMM
CSY=IRCOMM
CSY=BTCOMM
PORT=0
PORT=0
RATE=115200
RATE=9600

3. 创建 gdb.ini
在计算机中创建一个目录并且一定要在c:/ bbb,把gdb.ini放入这个文件夹。Gdb.ini文件内容如下:
 
symbol-file //c/symbian/7.0s/series60_v20/epoc32/release/armi/udeb/aaa.sym
epoc-exec-file c:/system/apps/aaa/aaa.app
target epoc com3
break NewApplication
source //c/symbian/7.0s/shared/epoc32/gcc/share/epoc-des.ini
 
用适当的名字替换所有的bbbaaa
注意: 请检查你正在使用通道数,在线路3中放入适当的com 数到它中,不包括:infra=2,Bluetooth=3
注意: com数通常不大于4并且大于1
4. 编辑
程序的调试将会使用armi udeb:
abld创建armi udeb
如果有任何错误或警告,就把epoc32/release/armi/urel中的复制到epoc32/release/armi/udeb
5. 更新pkg文件
现在找到程序的xxx.pkg文件然后改变所有的路径以便在目录armi/ udeb下编译。
然后创建sis文件并而安装
6.启动调试器
1.你应该有一个叫做FExplorer的程式,或者下载它并安装它。、
2.通过这个程式到目录 : c:/ system/program/gdbstub.exe
3.检查为dll文件在c:/ system/lib/ :下的gdbseal.dll gdbseng.dll
4.启动gdbstub.exe
5.在你的计算机DOS, 在目录c:/ bbb下并且运行gdb.exe-nw
(gdb.exe将与Symbian SDK一起并且确定它在系统路径之中)
以下信息将会出现:
 
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
Breakpoint 1 at 0x(some adress): file <your source file that contains
NewApplication>
gdb>
然后在gdb提示下,键入run。将会出现以下信息:
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++
注意 : gdb指令中检查Symbian SDK 文件从而得到更多的帮助。
 
清单
:
I硬件:
1. PC
2. 兼容的Bluetooth / InfraRed
3. Symbian电话
 
II软件:
PC :
1. Symbian SDK(可以免费的从Symbian/Nokia站点得到)
2. VC++6.0
3. Bluetooth驱动程序(可以在CDBluetooth得到)
4. gdb.ini
 
Symbian 电话:
1. gdbstub.sis
2. gdbstub.ini
3. fexplorer.sis