How to use RDebug

本文详细介绍了如何在Symbian应用中利用RDebug进行调试,包括配置、输出查看、高级功能及跨IDE调试等。通过启用RDebug输出,开发者可以更有效地检查特定消息,提高调试效率。

Contents

[hide]

[edit] General

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.

To use RDebug, include the header file, e32debug.h. (In 2nd Edition SDK, RDebug class declared in E32SVR.H)

#include <e32debug.h>

Then, add the following to any place in your code:

// code before log
RDebug::Print(_L("### Log %d %08x"), 5, 0xABCDEF12);
// code after log

The output debug message is now viewable with a the DebugView tool.

This trick is especially useful for tasks with special requirements.

[edit] RDebug::Print format

The RDebug::Print parameter format is easy because it follows the C printf format. The one that most have trouble with is %S to print a descriptor. It expects a pointer to a descriptor, so you must use the & operator if you are printing a TBuf, for example.

// Print a HBufC
RDebug::Print( _L("Test string: %S"), hbuf );
 
// Print a TBuf
RDebug::Print( _L("Test string: %S"), &tbuf );
 
 
// useful macro, LINE , evaluates to the current line number in
RDebug::Print(_L("Debug on line %d"), __LINE__);

[edit] 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 Settings | Control Panel | System | Advanced | Environment Variables and look at the TEMP value.
  • Debugger view of the IDE (see the following sections).


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.

[edit] 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‎

[edit] 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 Eclipse Logfile Viewer 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

[edit] 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 How to debug with emulator on the fly).

For this, you can use several tools that show Windows debug strings, such as DebugView 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.


[edit] 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 tail 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.

转载于:https://www.cnblogs.com/zelda/archive/2010/08/25/1808188.html

# 问题--设置代码补全 * `Continue - open-source AI code assistant`插件怎么添加代码补全功能呢? * 使用的是购买的deepseek api。 * 面板上有这些选项,第一个`settings`: ```text Settings Indexing③ Help4 Shortcuts User settings Show Session Tabs Wrap Codeblocks Show Chat Scrollbar Text-to-Speech Output Enable Session Titles Format Markdown Allow Anonymous Telemetry Enable Indexing Font Size14 Multiline AutocompletionsAuto Autocomplete Timeout (ms)150 Autocomplete Debounce (ms)250 Disable autocomplete in files Comma-separated list of path matchers Experimental Settings Auto-Accept Agent Edits Add Current File by Default Enable experimental tools @Codebase: use tool calling only ``` * `indexing`: ```text @codebase index Local embeddings of your codebase Indexing complete Click to re-index ``` * `help`: ```text Help center Continue Hub Visit hub.continue.dev to explore custom assistants and blocks Documentation Learn how to configure and use Continue Have an issue? Let us know on GitHub and we'll do our5 best to resolve it Join the community! Join us on Discord to stay up-to-date on the latest developments Token usage Daily token usage across models国 Quickstart Reopen the quickstart and tutorial file ``` * `shortcuts`: ```text Keyboard shortcuts Toggle Selected Model:Ctrl+ Edit highlighted code:Ctrl + I New Chat / New Chat With Selected Code / Close Continue Sidebar IfCtrl+L Chat Already In Focus: Cancel response:Ctrl + Backspace &beta; Toggle inline edit focus:Ctrl+Shiftt+I Focus Current Chat / Add Selected Code To Current Chat / Close ContinueCtrl + Shift +L Sidebar If Chat Already In Focus: Debug Terminal:Ctrl+ Shift + R Reject Diff:Ctrl+Shift+Backspace &beta; Accept Diff:Ctrl + Shift+Enter Reject Top Change in Diff:Alt + Ctrl + N Accept Top Change in Diff:Alt + Ctrl +Y Toggle Autocomplete Enabled:Ctrl + K + Ctrl + A Force an Autocomplete Trigger:Ctrlj+ Alt + Space Toggle Full Screen:Ctrl + K + Ctrl + M ``` # 问题 * `ctrl + shift + p`后,搜索`Continue: Edit Config File`,发现没有对应内容: ```text Continue Console:焦点在 Continue Console 视图上 Continue Console: Focus on Continue Console View Continue:焦点在 Continue 视图上 Continue: Focus on Continue View Continue: Continue: Force Next Edit 聊天:打开聊天(Edit) Chat: Open Chat (Edit) ``` * 在扩展里面找到`continue`插件,点击设置,有这些按钮: ```text Continue: Disable Quick Fix Disable the quick fix feature. Continue: Enable Console Enable a console to log and explore model inputs and outputs.It can be found in the bottom panel. Continue: Enable Quick Actions Enable the experimental Quick Actions feature. Read our walkthrough to learn about configuration and how to share feedback: continue.dev > Walkthrough: Quick Actions (experimental) Continue: Enable Tab Autocomplete \ Enable Continue's tab autocomplete feature. Read our walkthrough to learn about configuration and how to share feedback: continue.dev > Walkthrough: Tab Autocomplete (beta) Continue: Pause Codebase Index On Start Pause Continue's codebase index on start. Continue: Pause Tab Autocomplete On Battery Pause Continue's tab autocomplete feature when your battery is low. Continue: Remote Config Server Url If your team is set up to use shared configuration, enter the server URL here and your user token below to enable automatic syncing. Continue: Remote Config Sync Period The period of time in minutes between automatic syncs. 60 Continue: Show Inline Tip Show inline suggestion to use the Continue keyboard shortcuts (e.g."Cmd/Ctrl L to select code, Cmd/trl I to edit"). Continue: Telemetry Enabled Continue collects anonymous usage data, cleaned of Pll to help us improve the product for our users. Read more at continue.dev> Telemetry. Continue: User Token If your team is set up to use shared configuration, enter your user token here and your server URL above to enable automatic syncing. ```
最新发布
07-27
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值