Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1562209
  • 博文数量: 237
  • 博客积分: 5139
  • 博客等级: 大校
  • 技术积分: 2751
  • 用 户 组: 普通用户
  • 注册时间: 2008-11-18 14:48
文章分类

全部博文(237)

文章存档

2016年(1)

2012年(4)

2011年(120)

2010年(36)

2009年(64)

2008年(12)

分类: C/C++

2010-01-12 10:09:32

内容转自:

RDebug is a useful utility for checking a log of specific messages generated by the running code. This feature is helpful when the breakpoint/step debug tricks' using space has been limited.

The output debug message is viewable with a the tool.

Enabling RDebug output in the emulator

The output of RDebug in emulator is written to:

  • A text file, called EPOCWIND.OUT. The file is located in the TEMP folder. If you do not know the location of your TEMP folder, check Control Panel | Settings | Advanced | Environment Variables.(可以自己添加一些环境变量的路径)
  • Debuggerview of the IDE(设置好Debugview的路径).


For S60 3rd Edition, there are two options in the \epoc32\data\epoc.ini file to enable or disable RDebug output, that is:

  • LogToFile
  • LogToDebugger

The following code shows the content of epoc.ini with LogToFile and LogToDebugger enabled:

LogToFile 1
LogToDebugger 1

Note: If changing the epoc.ini is something that you feel
comfortable with, then try it. You can also control the same settings
through the emulator's window menu. Select Tools -> Preferences. The
logging options can be found in the General tab.

Viewing RDebug output in Carbide.c++

Viewing RDebug output in the Carbide.c++ IDE can be done by enabling "View process output". To enable it, right click project name and select Debug as | Debug.... Click the Debugger tab and enable "View process output" (see picture below).

Image:Rdebug_in_carbide.jpg

After the "View process output" option has been enabled, debug the project. To display the debug messages, click Open Console and select the Debug Messages menu. The picture below shows the output of RDebug in the Carbide.c++ IDE.

Image:Debug_view_in_carbide.jpg‎

Viewing RDebug output in Carbide.c++ (advanced)

Carbide.c++ is an Eclipse based IDE. The advantage of this is that many existing Eclipse plug-ins can be easily integrated with Carbide.c++. One such example is the plug-in, a tool that can dynamically load a log file, parse it according to user defined rules, and then display it in real time with customised formatting.

Plug-in configuration example:

Image:logview1.JPG

Viewing the RDebug messages:

Image:logview2.JPG

Here you can see how the plug-in can be used to highlight the log messages sent by your application, recognised as starting with the keyword RDebug.

RDebug::Print( _L("RDebug Hello") );

When debugging on device with TRK:

Debug configuration -> Debugger tab:

  • uncheck View messages between Carbide and debug agent
  • check View Program Output

Viewing RDebug output outside of an IDE

It is also possible to view debug output without any IDE or debugger attached. This can speed up launch times for the emulator (for example, if you are using Just-in-time debugging as described in ).

For this, you can use several tools that show Windows debug strings, such as from Microsoft. DebugView also has additional features such as highlighting or excluding strings with a particular pattern.

One thing to keep in mind is that the debug output can occasionally come from other processes in your system, not just the Symbian emulator, so with a tool like DebugView you can capture other strings not related to the application you are debugging. Again, filtering can be very helpful here.


Capturing RDebug output in epocwind.out

epocwind.out is a normal text file which is appended by the emulator so you can open it with any text editor. To be able to see the log prints as they come, you can use the freeware program. It is a port of the unix tail program that prints the "tail" of a file.

Create a bat file as follows:

tail -f %temp%\epocwind.out

This opens a dos-prompt to show the log prints as they come. It can be closed by pressing Ctrl-C.



阅读(838) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~