Source code window using Windbg

In WinDbg, the source window displays the source file has been loaded into the debugger.

How to open source window

  • Via the menu File ---> Open Source File to open the source code file, a window opens
  • By shortcut Ctrl + O
  • Toolbar
  • Set the source path, real-time debugger automatically opens

Source code window

Window opened by the above manner is as follows:

 

Each source text window will display a source file. You can not edit the source file in the debugger. Each source window has a shortcut menu with additional commands. To access the menu, right-click the title bar, or click on the icon near the top right corner of the window display ( Screenshot button to display the source window toolbar shortcut menu). The following list describes some menu commands:

 

  • Set instruction pointer to current line value of the instruction pointer will correspond to a command to change the current line. This command is equivalent to using the "Edit | current instruction set command or the SHIFT + + press the I the CTRL .

  • Edit this file to open the source file in a text editor. Editor registry value information or WINDBG_INVOKE_editor environment variables by WinDiff editor OK. For example, when the value of the following values WINDBG_INVOKE_EDITOR.
     
    c:\my\path\myeditor.exe -file %f -line %l

    In this case, Myeditor.exe opens on the current line number in the source file. % L option indicates the line number should be based on a read, and% f represent should use the current source file. Other possibilities include the replacement% L (line number is zero-based) and% p (represented by the current source should be used).

  • Evaluate selection 通过使用C++表达式计算器来计算当前选定的文本。 结果将显示在调试器命令窗口中。 如果所选文本包含多行,则会产生语法错误。 此命令等效于使用 "编辑 |计算选择命令,按 CTRL + SHIFT + V,或使用 ??(计算C++表达式) 带有所选文本作为参数的命令。

  • Display selected type 显示所选对象的数据类型。 此显示显示在调试器命令窗口中。 如果所选文本包含多个对象,则可能会显示语法错误或其他不稳定的结果。 此命令等效于使用 "编辑 |显示选定的类型命令,或按 CTRL + SHIFT + Y。

  • Open memory window for selection 打开一个新的停靠内存窗口,该窗口显示从所选表达式的地址开始的内存。.

  • Add selection to Watch window 将所选源令牌追加到监视窗口中.

  • Disassemble at current line 会导致与当前行对应的指令出现在 "反汇编"窗口中。 选定的行将在源窗口和 "反汇编" 窗口中突出显示,但此命令仅影响显示,而不会更改指令指针。 如果单击此命令时 "反汇编" 窗口关闭,则将其打开。.

  • Select source language 显示一系列编程语言。 选择用于生成源文件的编程语言,然后单击 "确定" 以为当前源窗口启用基本语法突出显示。 选择 " <NONE"> 可禁用当前源窗口的语法突出显示。

源窗口颜色和悬停计算

如果调试器识别源文件扩展名,则源窗口将以彩色显示某些语法元素。 若要关闭或更改颜色,请执行以下操作:

  • 若要在单个窗口中关闭语法颜色,请打开源窗口的快捷菜单,单击 "选择源语言",然后单击 " <无">

  • 若要为所有源窗口关闭语法颜色,请从 "视图" 菜单中选择 "选项"。 然后清除 "分析源语言" 复选框。

  • 若要更改语法颜色,请从 "视图" 菜单中选择 "选项"。 然后,在 "颜色" 区域中,选择语法元素,然后单击 "更改" 按钮更改颜色。

  • Analytical methods for highlighting depends on the source file with the file name extension associated with the programming language. To change the file name extension associated with a particular programming language, use the "language of the source file extension" dialog box. To open this dialog box, in the " View selection" "menu extensions source language file ."

Highlight the line represents the current program counter. It will highlight the line where the breakpoint.

If the source window is selected, then use the mouse hover over the window of a symbol, the symbol will be calculated. Calculating dt (display type) command generated by the same value. To disable this assessment, from the " View Select" "menu option ." Then clear the " calculate hover " box.

Guess you like

Origin www.cnblogs.com/yilang/p/12077120.html