安装系统 1.在手机上安装gdbstub.sis文件,该文件被Nokia的 SDK默认安装在以下路径:gdbstub.sis C:\Symbian\6.1\Series60\Epoc32\Release\armi\urel\ 2.在手机上启动FExplorer或是你最喜爱的文件管理器来创建 c:\gdbstub目录,上传gdbstub.ini 文件到所建目录中。gdbstub.ini 文件内容如下: [COMMSERV] PDD=EUART%d LDD=ECOMM CSY=IRCOMM PORT=0 RATE=115200 3.在个人电脑中创建 c:\yyy 目录,添加 c:\yyy\gdb.ini 文件,内容如下: 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 xxx与yyy位置上替代相应的值,com2 上替代IrDA的串行号。有必要在个人win32机器上安装IrDA 到COM管理器中(如,Jan Kiszka的IrCOMM2k )。
编译 要通过armi udeb 对象建立调试应用程序 abld build armi udeb 如果因为未能找到udeb的链接文件(第一次可能会出现这样的情况),只需拷贝所有epoc32/release/armi/urel 中所有内容到epoc32/release/armi/udebepoc32/release/armi/udeb中。 打包并安装给程序到手机上。
运行调试器 启动FExplorer并运行c:\system\programs\gdbstub.exe文件,这时IrDA指示器开始闪烁。注意:无需预先连接/IrDA/激活,因为IrDA会自动连接。
找到手机和个人电脑终端IrDA适配器,从个人电脑中打开DOS界面,转到c:\yyy 目录下并运行。 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 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*
IrDA连接将会被建立(手机IrDA图标将不会再闪烁而是将连续可视)。
在提示下输入“运行”,将会出现以下信息: 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显示“开始程序:”但却短期内无反应,则视为失败!有时会出现这种情况,这时重启手机(有时是个人电脑)来避免该事发生。如果这样仍是无效,这时需要检测IrDA工作情况[1]。
可以了,现在就可以运行。
问题 如何在错误发生处捕获错误? 如何在其他子线程而非主线程中设置断点? [1]打开“电脑端套件(PC Suite)”,在连接器图标上单击右键;属性;检查IrDA-COM。执行gdbstub以格式化手机,然后重启。在手机上连接/IrDA/激活并点击win32。这时“已连接”或是出现其他相似信息。这个问题就是因为没有检测IrDA-COM。然后再连接gdb前重启手机。
此文为开发视界翻译转载者请注明出处否则追究法律责任 |