Guest User

Untitled

a guest
Oct 9th, 2026
77
0
Never
3
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 40.40 KB | None | 0 0
  1. # The RAD Debugger (ALPHA)
  2.  
  3. The RAD Debugger is a native, user-mode, multi-process, graphical debugger. It
  4. currently only supports local-machine Windows x64 debugging with PDBs, but we're
  5. actively working on support and ports for other toolchains and platforms.
  6.  
  7. ## Getting Started
  8.  
  9. **Launching the debugger with your program information:** To launch the RAD
  10. Debugger with your executable and command line arguments, run `raddbg` from the
  11. command line like so:
  12.  
  13. ```raddbg my_program.exe --foo --bar --baz```
  14.  
  15. For more information, see the **Command-Line Usage** section.
  16.  
  17. **Basic commands and keybindings:** Default keyboard shortcuts for common
  18. debugger controls include:
  19.  
  20. - **Ctrl + O**: Open Source Code File
  21. - **F10**: Step Over
  22. - **F11**: Step Into
  23. - **Shift + F11**: Step Out
  24. - **F5**: Run
  25. - **Ctrl + Shift + X**, or **Pause**: Halt All Processes
  26. - **Shift + F5**: Kill All Processes
  27. - **Shift + F6**: Attach To Process
  28. - **Ctrl + F**: Search For Text (Forwards)
  29. - **F9**: Toggle Breakpoint At Cursor
  30. - **Ctrl + Comma**: Focus Next Panel
  31. - **Ctrl + Shift + Comma**: Focus Previous Panel
  32. - **Ctrl + Alt + Arrow Key**: Focus Panel In Direction
  33. - **Ctrl + Tab**: Focus Next Tab
  34. - **Ctrl + Shift + Tab**: Focus Previous Tab
  35. - **Ctrl + W**: Close Tab
  36. - **F1**: Open Palette (lists commands, keybindings, settings, threads,
  37. processes, modules, types, and many other things)
  38.  
  39. For more information, see the **Commands** section.
  40.  
  41. **Configuration files (users and projects):** The RAD Debugger stores
  42. configuration in two files. One is the 'user file', the other is the 'project
  43. file'. Both files are the same format and can store the same kinds of data, but
  44. the user file is preferred by the debugger for more likely user-related data
  45. (windows, keybindings, theme), and the project file is preferred by the debugger
  46. for more likely project-related data (executable debugging targets, breakpoints,
  47. recent source files). Project files are more likely to be what you'd check into
  48. source control, whereas a user file is more likely to have your personal
  49. debugger settings (which will apply identically regardless of which project file
  50. is opened).
  51.  
  52. The debugger autosaves user and project files. You do not need to manually save
  53. them. To switch which path you are using for either, you can use the `Open User`
  54. (Ctrl + Alt + Shift + O, by default), or `Open Project` (Ctrl + Alt + O, by
  55. default) commands respectively. If a file does not exist at the path you enter
  56. for either, then a new one will be created, and the debugger will begin
  57. autosaving to it. If the initial paths to these files are not specified on the
  58. command line (via `--user` or `--project`), then the debugger uses default paths
  59. for them. The user file path, by default, will be
  60. `%appdata%/raddbg/default.raddbg_user`. The project file path will be whatever
  61. project path was last loaded for the user, or if no such path exists,
  62. `%appdata%/raddbg/default.raddbg_project`. If you suspect that your
  63. configuration files are corrupted or causing the debugger to behave poorly, it
  64. might help to delete your `%appdata%/raddbg` folder (although it'd also help if
  65. you [sent it to us in a bug
  66. report](https://github.com/EpicGames/raddebugger/issues), so that we can
  67. investigate why they were corrupted to begin with!).
  68.  
  69. For more information, see the `**User & Project Files** section.
  70.  
  71. **Watch tabs and visualizers:** 'Watch' tabs in the RAD Debugger allow entering
  72. expressions, which can reference variables in your program, and visualize what
  73. their value is when your program is stopped at a particular time. These
  74. expressions roughly follow C expression syntax, but there are a number of
  75. extensions which can be used to visualize expressions in a more useful way. Here
  76. are some examples:
  77.  
  78. - `array(pointer, 64)`: Visualizes `pointer` as pointing to a 256-element
  79. array.
  80. - `pointer, 64`: Visualizes `pointer` as pointing to a 256-element array.
  81. - `pointer, count`: Visualizes `pointer` as pointing to a `count`-element
  82. array.
  83. - `slice(some_slice_struct)`: Interprets a structure type as containing a base
  84. pointer and a count (either through an integer, or an 'end pointer'), and
  85. visualizes the base pointer, pointing to that many elements.
  86. - `rows(some_struct, a, b, c)`: Displays the value of `some_struct`, but only
  87. showing members `a`, `b`, and `c`.
  88. - `omit(some_struct, a, b, c)`: Displays the value of `some_struct`, but only
  89. showing members other than `a`, `b`, and `c`.
  90. - `hex(my_int)`: Visualizes the value of `my_int` in base-16 (hexadecimal)
  91. form.
  92. - `dec(my_int)`: Visualizes the value of `my_int` in base-10 (decimal) form.
  93. - `bin(my_int)`: Visualizes the value of `my_int` in base-2 (binary) form.
  94. - `oct(my_int)`: Visualizes the value of `my_int` in base-8 (octal) form.
  95. - `my_int, x`: Visualizes the value of `my_int` in base-16 (hexadecimal) form.
  96. - `my_int, d`: Visualizes the value of `my_int` in base-10 (decimal) form.
  97. - `my_int, b`: Visualizes the value of `my_int` in base-2 (binary) form.
  98. - `my_int, o`: Visualizes the value of `my_int` in base-8 (octal) form.
  99. - `digits(bin(my_int), 32)`: Visualizes the value of `my_int` in base-2
  100. (binary) form, showing at minimum 32 bits.
  101. - `my_int.bin().digits(32)`: Visualizes the value of `my_int` in base-2
  102. (binary) form, showing at minimum 32 bits.
  103. - `bitmap(base_pointer, width, height, fmt=rgba8)`: Visualizes the data
  104. starting at `base_pointer` as a bitmap, with width `width` and height
  105. `height`, with format `rgba8`.
  106.  
  107. For more information, see the **Views** section.
  108.  
  109. ## Command-Line Usage
  110.  
  111. When run normally, either by launching through a file explorer or running from a
  112. command line without arguments, `raddbg` will open a new instance of the
  113. debugger, and await further operations. But it also supports a number of command
  114. line options for a number of other purposes. These options are specified with a
  115. `-` or `--` prefix, followed by the name of the option, and if the option
  116. requires an argument value, followed by a `:` or `=`, followed by the argument
  117. value. A list of the possible options follows:
  118.  
  119. - `--help` Displays a help menu which documents the possible command line
  120. options.
  121. - `--user:<path>` Use to specify the location of a user file which should be
  122. used. User files are used by default to store user-related settings,
  123. including window and panel setups, path mapping, and visual settings. If this
  124. file does not exist, it will be created as necessary. This file will be
  125. autosaved as user-related changes are made. For more information on user
  126. files, see the **User & Project Files** section.
  127. - `--project:<path>` Use to specify the location of a project file which should
  128. be used. Project files are used by default to store project-related settings.
  129. If this file does not exist, it will be created as necessary. This file will
  130. be autosaved as project-related changes are made. For more information on
  131. project files, read the 'User & Project Files' section.
  132. - `--auto_step` This will step into all active targets after the debugger
  133. initially starts.
  134. - `--auto_run` This will run all active targets after the debugger initially
  135. starts.
  136. - `--quit_after_success` (or `-q`) This will close the debugger automatically
  137. after all processes exit, if they all exited successfully (with code 0), and
  138. ran with no interruptions.
  139. - `--ipc` This will launch the debugger in the non-graphical IPC mode, which is
  140. used to communicate with another running instance of the debugger. The
  141. debugger instance will launch, send the specified command, then immediately
  142. terminate. This may be used by editors or other programs to control the
  143. debugger. For more information on the set of available commands, see the
  144. **Commands** section. For more information on driving another debugger
  145. instance with this argument, see the **Driving Another Debugger Instance**
  146. section.
  147.  
  148. On the command line, non-options (meaning any command line arguments *not*
  149. prefixed with a `-` or `--`) can also be specified. With normal usage, they are
  150. interpreted as the command line for a target (see the **Targets** section). When
  151. driving another debugger instance (using the `--ipc` argument), this additional
  152. command line text is used to encode a debugger command.
  153.  
  154. The debugger will stop parsing `-` and `--` prefixes as arguments after seeing a
  155. standalone `--`, *or* after seeing the first non-option argument, when reading
  156. the command line left-to-right. Some examples of command line usage and their
  157. interpretations are below:
  158.  
  159. - `raddbg --foo --bar --a:b --c=d test.exe`: All options are used to configure
  160. `raddbg`. `test.exe` is interpreted as a target executable. `b` is
  161. interpreted as the parameter for the `a` option. `d` is interpreted as the
  162. parameter for the `c` option.
  163. - `raddbg test.exe --foo --bar`: `test.exe`is interpreted as a target
  164. executable. `--foo --bar` is interpreted as arguments for `test.exe`, and
  165. thus are *not* used to configure `raddbg`.
  166. - `raddbg -- test.exe`: `test.exe` is interpreted as a target executable.
  167. - `raddbg --ipc find_code_location "C:/foo/bar/baz.c:123:1"`: `--ipc`
  168. configures `raddbg` to drive another instance of `raddbg`. The remainder of
  169. the text is interpreted as a command.
  170. - `raddbg "C:/path with spaces/test.exe" --foo --bar`: A target is formed from
  171. the `test.exe` path, and `--foo --bar` are interpreted as arguments to the
  172. `test.exe` target.
  173.  
  174. ## Windows, Panels, & Tabs
  175.  
  176. Each opened debugger window is subdivided into panels. Panels subdivide regions
  177. of their window without overlapping. Each panel can contain multiple tabs, and
  178. can have one tab selected at any time. Tabs can be dragged and dropped between
  179. panels. Each tab is used to view one of the many supported debugger interfaces,
  180. including source code, disassembly, memory, or watch tables. When a tab is
  181. selected, that interface will fill the tab's containing panel's region of the
  182. containing window.
  183.  
  184. There are no 'special' windows, panels, or tabs; the debugger is written such
  185. that the number of windows, each window's panel organization, and the placement
  186. and arrangement of tabs can all be organized in a large variety of ways.
  187.  
  188. A list of debugger interfaces, which can occupy tabs, are below:
  189.  
  190. - **Watch**: An editable table interface for entering one or many expressions
  191. to evaluate, and visualizing and exploring their values.
  192. - **Locals**: Like the Watch tab, but not editable, and displays the set of
  193. local variables found at the selected thread's current location.
  194. - **Registers**: Like the Watch tab, but not editable, and displays the set of
  195. registers for the selected thread.
  196. - **Globals**: Like the Watch tab, but not editable, and displays all global
  197. variables from all loaded modules.
  198. - **Thread Locals**: Like the Watch tab, but not editable, and displays all
  199. thread-local variables from all loaded modules.
  200. - **Types**: Like the Watch tab, but not editable, and displays all types from
  201. all loaded modules.
  202. - **Procedures**: Like the Watch tab, but not editable, and displays all
  203. procedures from all loaded modules.
  204. - **Call Stack**: Displays the currently selected thread's call stack, and
  205. allows selecting a frame in the call stack, which will unwind the selected
  206. thread's registers and evaluate expressions within that frame's context.
  207. - **Targets**: Displays, and allows editing of, the list of all targets.
  208. - **Breakpoints**: Displays, and allows editing of, the list of all
  209. breakpoints.
  210. - **Watch Pins**: Displays, and allows editing of, the list of all watch pins.
  211. - **Debug Info**: Displays, and allows editing of, the list of all debug info
  212. files that the debugger has loaded.
  213. - **Threads**: Displays the list of all threads in all processes to which the
  214. debugger is attached.
  215. - **Processes**: Displays the list of all processes to which the debugger is
  216. attached.
  217. - **Machines**: Displays the list of all machines to which the debugger is
  218. connected.
  219. - **Modules**: Displays the list of all modules in all processes to which the
  220. debugger is attached.
  221. - **File Path Map**: Displays, and allows editing of, the list of all file path
  222. maps. This allows remapping source code paths referenced by debug information
  223. to other paths on your local machine.
  224. - **Type Views**: Displays, and allows editing of, the list of all type views,
  225. which allow automatically adjusting the visualizations for evaluations of a
  226. certain type.
  227.  
  228. You can open one of these tabs in any panel by clicking the `+` icon next to
  229. that panel's tabs, or by executing the `Open Tab` command (bound to Ctrl + T) by
  230. default.
  231.  
  232. ## Commands
  233.  
  234. The debugger, including implicitly with its UI, is operated almost entirely
  235. through 'commands'. Commands may be manually executed in the debugger UI within
  236. the palette (which you can open with F1 by default), or within the commands list
  237. which is opened when you execute the 'Run Command' command. Operations in the
  238. debugger UI are implemented with commands, so if it's ever unclear how to
  239. accomplish some operation through the UI, a useful fallback is searching for and
  240. running the command through the palette.
  241.  
  242. Commands are also how a debugger instance launched with `--ipc` may communicate
  243. with a primary debugger instance.
  244.  
  245. A list of commands, how they're referred to textually (for the purposes of
  246. `--ipc` debugger instances), and their descriptions, are below:
  247.  
  248. - `Launch and Run` (`launch_and_run`) Starts debugging a new instance of a
  249. target, then runs.
  250. - `Launch and Step Into` (`launch_and_step_into`) Starts debugging a new
  251. instance of a target, then stops at the program's entry point.
  252. - `Kill` (`kill`) Kills the specified existing attached process(es).
  253. - `Kill All` (`kill_all`) Kills all attached processes.
  254. - `Detach` (`detach`) Detaches the specified attached process(es).
  255. - `Continue` (`continue`) Continues executing all attached processes.
  256. - `Step Into (Assembly)` (`step_into_inst`) Performs a step that goes into
  257. calls, at the instruction level.
  258. - `Step Over (Assembly)` (`step_over_inst`) Performs a step that skips calls,
  259. at the instruction level.
  260. - `Step Into (Line)` (`step_into_line`) Performs a step that goes into calls,
  261. at the source code line level.
  262. - `Step Over (Line)` (`step_over_line`) Performs a step that skips calls, at
  263. the source code line level.
  264. - `Step Out` (`step_out`) Runs to the first instruction after the current scope
  265. is exited.
  266. - `Step To Exit` (`step_to_exit`) Runs to the first encountered instruction
  267. which will exit the current scope.
  268. - `Halt` (`halt`) Halts all attached processes.
  269. - `Set Thread IP` (`set_thread_ip`) Sets the specified thread's instruction
  270. pointer at the specified address.
  271. - `Run To Line` (`run_to_line`) Runs until a particular source line is hit.
  272. - `Run To Name` (`run_to_name`) Runs until a particular symbol name is hit.
  273. - `Run` (`run`) Runs all targets after starting them if they have not been
  274. started yet.
  275. - `Restart` (`restart`) Kills all attached processes, then launches all active
  276. targets.
  277. - `Step Into` (`step_into`) Steps once, possibly into function calls, for
  278. either source lines or instructions (whichever is selected).
  279. - `Step Over` (`step_over`) Steps once, always over function calls, for either
  280. source lines or instructions.
  281. - `Freeze Thread` (`freeze_thread`) Freezes the passed thread.
  282. - `Thaw Thread` (`thaw_thread`) Thaws the passed thread.
  283. - `Freeze Process` (`freeze_process`) Freezes the passed process.
  284. - `Thaw Process` (`thaw_process`) Thaws the passed process.
  285. - `Freeze Machine` (`freeze_machine`) Freezes the passed machine.
  286. - `Thaw Machine` (`thaw_machine`) Thaws the passed machine.
  287. - `Freeze Local Machine` (`freeze_local_machine`) Freezes the local machine.
  288. - `Thaw Local Machine` (`thaw_local_machine`) Thaws the local machine.
  289. - `Download Module Debug Info` (`download_module_debug_info`) Tries to download
  290. a module's debug info from symbol server(s).
  291. - `Attach` (`attach`) Attaches to a process that is already running on the
  292. local machine.
  293. - `Open Crash Dump` (`open_crash_dump`) Opens a crash dump file and recreates
  294. debuggee state at the time of the crash.
  295. - `Open Remote Debugger` (`open_remote_debugger`) Opens a remote debugger by IP
  296. address.
  297. - `Close Remote Debugger` (`close_remote_debugger`) Closes a remote debugger.
  298. - `Exit` (`exit`) Exits the debugger.
  299. - `Open Palette` (`open_palette`) Opens the palette.
  300. - `State` (`state`)
  301. - `Eval` (`eval`)
  302. - `Line From Virtual Address` (`line_from_vaddr`)
  303. - `Remote Controller Connect` (`remote_controller_connect`)
  304. - `Remote Controller Disconnect` (`remote_controller_disconnect`)
  305. - `Select Thread` (`select_thread`) Selects a thread.
  306. - `Select Unwind` (`select_unwind`) Selects an unwind frame number for the
  307. selected thread.
  308. - `Up One Frame` (`up_one_frame`) Selects the call stack frame above the
  309. currently selected.
  310. - `Down One Frame` (`down_one_frame`) Selects the call stack frame below the
  311. currently selected.
  312. - `Increase Window Font Size` (`inc_window_font_size`) Increases the window's
  313. font size by one point.
  314. - `Decrease Window Font Size` (`dec_window_font_size`) Decreases the window's
  315. font size by one point.
  316. - `Increase View Font Size` (`inc_view_font_size`) Increases the view's font
  317. size by one point.
  318. - `Decrease View Font Size` (`dec_view_font_size`) Decreases the view's font
  319. size by one point.
  320. - `Open New Window` (`open_window`) Opens a new window.
  321. - `Window Settings` (`window_settings`) Opens settings for a window.
  322. - `Close Window` (`close_window`) Closes an opened window.
  323. - `Toggle Fullscreen` (`toggle_fullscreen`) Toggles fullscreen view on the
  324. active window.
  325. - `Bring To Front` (`bring_to_front`) Brings all windows to the front, and
  326. focuses the most recently focused window.
  327. - `Popup Accept` (`popup_accept`) Accepts the active popup prompt.
  328. - `Popup Cancel` (`popup_cancel`) Cancels the active popup prompt.
  329. - `Reset To Default Bindings` (`reset_to_default_bindings`) Resets all
  330. keybindings to their defaults.
  331. - `Reset To Default Panel Layout` (`reset_to_default_panels`) Resets the window
  332. to the default panel layout.
  333. - `Split Panel Left` (`new_panel_left`) Creates a new panel to the left of the
  334. active panel.
  335. - `Split Panel Up` (`new_panel_up`) Creates a new panel at the top of the
  336. active panel.
  337. - `Split Panel Right` (`new_panel_right`) Creates a new panel to the right of
  338. the active panel.
  339. - `Split Panel Down` (`new_panel_down`) Creates a new panel at the bottom of
  340. the active panel.
  341. - `Rotate Panel Columns` (`rotate_panel_columns`) Rotates all panels at the
  342. closest column level of the panel hierarchy.
  343. - `Focus Next Panel` (`next_panel`) Cycles the active panel forward.
  344. - `Focus Previous Panel` (`prev_panel`) Cycles the active panel backwards.
  345. - `Focus Panel Right` (`focus_panel_right`) Focuses a panel rightward of the
  346. currently focused panel.
  347. - `Focus Panel Left` (`focus_panel_left`) Focuses a panel leftward of the
  348. currently focused panel.
  349. - `Focus Panel Up` (`focus_panel_up`) Focuses a panel upward of the currently
  350. focused panel.
  351. - `Focus Panel Down` (`focus_panel_down`) Focuses a panel downward of the
  352. currently focused panel.
  353. - `Close Panel` (`close_panel`) Closes the currently active panel.
  354. - `Focus Next Tab` (`next_tab`) Focuses the next tab on the active panel.
  355. - `Focus Previous Tab` (`prev_tab`) Focuses the previous tab on the active
  356. panel.
  357. - `Move Tab Right` (`move_tab_right`) Moves the selected tab right one slot.
  358. - `Move Tab Left` (`move_tab_left`) Moves the selected tab left one slot.
  359. - `Duplicate Tab` (`duplicate_tab`) Duplicates a tab.
  360. - `Close Tab` (`close_tab`) Closes the currently opened tab.
  361. - `Anchor Tab Bar To Top` (`tab_bar_top`) Anchors a panel's tab bar to the top
  362. of the panel.
  363. - `Anchor Tab Bar To Bottom` (`tab_bar_bottom`) Anchors a panel's tab bar to
  364. the bottom of the panel.
  365. - `Selected Tab Settings` (`tab_settings`) Opens settings for a tab.
  366. - `Set Current Path` (`set_current_path`) Sets the debugger's current path,
  367. which is used as a starting point when browsing for files.
  368. - `Open` (`open`) Opens a file.
  369. - `Switch To Partner File` (`switch_to_partner_file`) Switches to the focused
  370. file's partner; or from header to implementation or vice versa.
  371. - `Show File In Explorer` (`show_file_in_explorer`) Opens the operating
  372. system's file explorer and shows the selected file.
  373. - `Go To Disassembly` (`go_to_disassembly`) Goes to the disassembly, if any,
  374. for a given source code line.
  375. - `Go To Source` (`go_to_source`) Goes to the source code, if any, for a given
  376. disassembly line.
  377. - `New User` (`new_user`) Creates a new user file, and sets the current user
  378. path as that file's path.
  379. - `New Project` (`new_project`) Creates a new project file, and sets the
  380. current project path as that file's path.
  381. - `Open User` (`open_user`) Opens a user file path, immediately loading it, and
  382. begins autosaving to it.
  383. - `Open Project` (`open_project`) Opens a project file path, immediately
  384. loading it, and begins autosaving to it.
  385. - `Open Recent Project` (`open_recent_project`) Opens a recently used project
  386. file.
  387. - `Save User` (`save_user`) Saves user data to a file, and sets the current
  388. user path as that path.
  389. - `Save Project` (`save_project`) Saves project data to a file, and sets the
  390. current project path as that path.
  391. - `Write User Data` (`write_user_data`) Writes user data to the active user
  392. file.
  393. - `Write Project Data` (`write_project_data`) Writes project data to the active
  394. project file.
  395. - `User Settings` (`user_settings`) Opens user settings.
  396. - `Project Settings` (`project_settings`) Opens project settings.
  397. - `Edit` (`edit`) Edits the current selection.
  398. - `Accept` (`accept`) Accepts current changes, or answers prompts in the
  399. affirmative.
  400. - `Cancel` (`cancel`) Rejects current changes, exits temporary menus, or
  401. answers prompts in the negative.
  402. - `Focus Menu` (`focus_menu`) Focuses the menu for the selected interface, if
  403. there is one.
  404. - `Lock` (`lock`) Locks the current selection, if applicable.
  405. - `Unlock` (`unlock`) Unlocks the current selection, if applicable.
  406. - `Toggle Lock` (`toggle_lock`) Toggles the lock state of the current
  407. selection, if applicable.
  408. - `Move Left` (`move_left`) Moves the cursor or selection left.
  409. - `Move Right` (`move_right`) Moves the cursor or selection right.
  410. - `Move Up` (`move_up`) Moves the cursor or selection up.
  411. - `Move Down` (`move_down`) Moves the cursor or selection down.
  412. - `Move Left Select` (`move_left_select`) Moves the cursor or selection left,
  413. while selecting.
  414. - `Move Right Select` (`move_right_select`) Moves the cursor or selection
  415. right, while selecting.
  416. - `Move Up Select` (`move_up_select`) Moves the cursor or selection up, while
  417. selecting.
  418. - `Move Down Select` (`move_down_select`) Moves the cursor or selection down,
  419. while selecting.
  420. - `Move Left Chunk` (`move_left_chunk`) Moves the cursor or selection left one
  421. chunk.
  422. - `Move Right Chunk` (`move_right_chunk`) Moves the cursor or selection right
  423. one chunk.
  424. - `Move Up Chunk` (`move_up_chunk`) Moves the cursor or selection up one chunk.
  425. - `Move Down Chunk` (`move_down_chunk`) Moves the cursor or selection down one
  426. chunk.
  427. - `Move Up Page` (`move_up_page`) Moves the cursor or selection up one page.
  428. - `Move Down Page` (`move_down_page`) Moves the cursor or selection down one
  429. page.
  430. - `Move Up Whole` (`move_up_whole`) Moves the cursor or selection to the
  431. beginning of the relevant content.
  432. - `Move Down Whole` (`move_down_whole`) Moves the cursor or selection to the
  433. end of the relevant content.
  434. - `Move Left Chunk Select` (`move_left_chunk_select`) Moves the cursor or
  435. selection left one chunk.
  436. - `Move Right Chunk Select` (`move_right_chunk_select`) Moves the cursor or
  437. selection right one chunk.
  438. - `Move Up Chunk Select` (`move_up_chunk_select`) Moves the cursor or selection
  439. up one chunk.
  440. - `Move Down Chunk Select` (`move_down_chunk_select`) Moves the cursor or
  441. selection down one chunk.
  442. - `Move Up Page Select` (`move_up_page_select`) Moves the cursor or selection
  443. up one page, while selecting.
  444. - `Move Down Page Select` (`move_down_page_select`) Moves the cursor or
  445. selection down one page, while selecting.
  446. - `Move Up Whole Select` (`move_up_whole_select`) Moves the cursor or selection
  447. to the beginning of the relevant content, while selecting.
  448. - `Move Down Whole Select` (`move_down_whole_select`) Moves the cursor or
  449. selection to the end of the relevant content, while selecting.
  450. - `Move Up Reorder` (`move_up_reorder`) Moves the cursor or selection up, while
  451. swapping the currently selected element with that upward.
  452. - `Move Down Reorder` (`move_down_reorder`) Moves the cursor or selection down,
  453. while swapping the currently selected element with that downward.
  454. - `Move Home` (`move_home`) Moves the cursor to the beginning of the line.
  455. - `Move End` (`move_end`) Moves the cursor to the end of the line.
  456. - `Move Home Select` (`move_home_select`) Moves the cursor to the beginning of
  457. the line, while selecting.
  458. - `Move End Select` (`move_end_select`) Moves the cursor to the end of the
  459. line, while selecting.
  460. - `Select All` (`select_all`) Selects everything possible.
  461. - `Delete Single` (`delete_single`) Deletes a single element to the right of
  462. the cursor, or the active selection.
  463. - `Delete Chunk` (`delete_chunk`) Deletes a chunk to the right of the cursor,
  464. or the active selection.
  465. - `Backspace Single` (`backspace_single`) Deletes a single element to the left
  466. of the cursor, or the active selection.
  467. - `Backspace Chunk` (`backspace_chunk`) Deletes a chunk to the left of the
  468. cursor, or the active selection.
  469. - `Copy` (`copy`) Copies the active selection to the clipboard.
  470. - `Cut` (`cut`) Copies the active selection to the clipboard, then deletes it.
  471. - `Paste` (`paste`) Pastes the current contents of the clipboard.
  472. - `Insert Text` (`insert_text`) Inserts the text that was used to cause this
  473. command.
  474. - `Move Next` (`move_next`) Moves the cursor or selection to the next element.
  475. - `Move Previous` (`move_prev`) Moves the cursor or selection to the previous
  476. element.
  477. - `Go To Line` (`goto_line`) Jumps to a line number in the current code file.
  478. - `Go To Address` (`goto_address`) Jumps to an address in the current memory or
  479. disassembly view.
  480. - `Center Cursor` (`center_cursor`) Snaps the current code view to center the
  481. cursor.
  482. - `Contain Cursor` (`contain_cursor`) Snaps the current code view to contain
  483. the cursor.
  484. - `Find Next` (`find_next`) Searches the current code file forward (from the
  485. cursor) for the last searched string.
  486. - `Find Previous` (`find_prev`) Searches the current code file backwards (from
  487. the cursor) for the last searched string.
  488. - `Find Thread` (`find_thread`) Jumps to the passed thread in either source
  489. code, disassembly, or both if they're already open.
  490. - `Find Selected Thread` (`find_selected_thread`) Jumps to the selected thread
  491. in either source code, disassembly, or both if they're already open.
  492. - `Go To Name` (`goto_name`) Searches for the passed string as a file, a symbol
  493. in debug info, and more, then jumps to it if possible.
  494. - `Go To Name At Cursor` (`goto_name_at_cursor`) Searches for the text at the
  495. cursor as a file, a symbol in debug info, and more, then jumps to it if
  496. possible.
  497. - `Toggle Watch Expression` (`toggle_watch_expr`) Adds or removes an expression
  498. to an opened watch view.
  499. - `Toggle Watch Expression At Cursor` (`toggle_watch_expr_at_cursor`) Adds or
  500. removes the expression that the cursor or selection is currently over to an
  501. opened watch view.
  502. - `Toggle Watch Expression At Mouse` (`toggle_watch_expr_at_mouse`) Adds or
  503. removes the expression that the mouse is currently over to an opened watch
  504. view.
  505. - `Add Line Breakpoint` (`add_breakpoint`) Places a breakpoint at a given
  506. location (file path and line number, address, or symbol name).
  507. - `Toggle Line Breakpoint` (`toggle_breakpoint`) Places or removes a breakpoint
  508. at a given location (file path and line number, address, or symbol name).
  509. - `Enable Breakpoint` (`enable_breakpoint`) Enables a breakpoint.
  510. - `Disable Breakpoint` (`disable_breakpoint`) Disables a breakpoint.
  511. - `Clear Breakpoints` (`clear_breakpoints`) Removes all breakpoints.
  512. - `Clear Output` (`clear_output`) Clears all output.
  513. - `Add Watch Pin` (`add_watch_pin`) Places a watch pin at a given location
  514. (file path and line number or address).
  515. - `Load Debug Info` (`load_debug_info`) Loads a debug info file.
  516. - `Unload Debug Info` (`unload_debug_info`) Unloads a debug info file.
  517. - `Set Next Statement` (`set_next_statement`) Sets the selected thread's
  518. instruction pointer to the cursor's position.
  519. - `Add Target` (`add_target`) Adds a new target.
  520. - `Select Target` (`select_target`) Selects a target.
  521. - `Enable Target` (`enable_target`) Enables a target, in addition to all
  522. targets currently enabled.
  523. - `Disable Target` (`disable_target`) Disables a target.
  524. - `Remove Target` (`remove_target`) Removes a target.
  525. - `Register As Just-In-Time (JIT) Debugger` (`register_as_jit_debugger`)
  526. Registers the RAD debugger as the just-in-time (JIT) debugger used by the
  527. operating system.
  528. - `Find Code Location` (`find_code_location`) Finds a specific source code
  529. location given file, line, and column coordinates. Opens the file if
  530. necessary.
  531. - `Go To Memory` (`go_to_memory`) Finds the specified expression in the memory
  532. view. Opens the memory view if necessary.
  533. - `Break When Value Changes` (`break_when_value_changes`) Adds a new write data
  534. breakpoint for this variable's range.
  535. - `Search` (`search`) Begins searching within the active interface.
  536. - `Search Backwards` (`search_backwards`) Begins searching backwards within the
  537. active interface.
  538. - `Open Event Buffer` (`open_event_buffer`) Opens a new event buffer, to which
  539. debugger events will be written, for external processing.
  540. - `Close Event Buffer` (`close_event_buffer`) Closes an existing event buffer.
  541. - `Toggle Developer Menu` (`toggle_dev_menu`) Opens and closes the developer
  542. menu.
  543. - `Log Marker` (`log_marker`) Logs a marker in the application log, to denote
  544. specific points in time within the log.
  545.  
  546. ## Targets
  547.  
  548. A *target* is one executable and configuration for launching that executable,
  549. including command line arguments and working directory (the directory from which
  550. the executable is launched). Each target may also have a custom label
  551. (prioritized over the executable name when visualizing the target, and also
  552. allows evaluation of the target in a Watch tab), and the name of a custom entry
  553. point function (when the default entry points - `main`, `WinMain`, etc. - are
  554. not desired when stepping into the program upon launch). The debugger can have
  555. several targets at once. Each target can also be enabled or disabled. Some
  556. operations work on all enabled targets - for instance, the `Run` or `Kill All`
  557. commands (standardly bound as F5 or Shift + F5). Enabling and disabling targets
  558. allows one to filter which targets are currently being worked with.
  559.  
  560. To add a target, you can run the `Add Target` command. A target is also created
  561. automatically from command line arguments - the rules for how this happens can
  562. be found in the `Command-Line Usage` section.
  563.  
  564. Targets created through command line usage are temporary, meaning they are not
  565. persistently saved across runs of the debugger. To change this, find the target
  566. in the `Targets` tab, and click the `Save To Project` button on that target's
  567. row. After doing so, the target will be restored across runs, and will no longer
  568. need to be specified on the command-line.
  569.  
  570. ## Views
  571.  
  572. *Views* are used to transform the way that evaluations in the debugger are
  573. visualized. An evaluation is produced by taking an expression string - for
  574. instance, the name of a variable - and using debug info and information from an
  575. attached process' live runtime (memory, registers, and so on) to interpret it.
  576.  
  577. Evaluations may be visualized in a variety of ways. A 64-bit unsigned integer
  578. may be visualized as a textual representation of the value with a radix of 10. A
  579. 32-bit floating-point value may be visualized as a textual representation of the
  580. value. An array of 32-bit floating-point values can be visualized as a list of
  581. textual representations of those values.
  582.  
  583. But all of these cases may be visualized in a number of other ways, as well. A
  584. 64-bit unsigned integer may be more usefully represented with a radix of 16, 8,
  585. or 2. An array of 32-bit floating-point values may encode the R, G, B, and A
  586. components of a color, or vertex positions for 3D geometry, or samples for a
  587. waveform. An array of bytes may encode raw pixel data for an image, or image
  588. data in a compressed format. A struct may have several members which are not
  589. useful to look at all the time. A struct may form the head of a linked list, and
  590. a flat linked list representation may be more preferable than the traditional
  591. watch view representation, which adds an additional layer of hierarchical
  592. nesting with the expansion of each 'next' pointer in a linked list. When
  593. designing the debugger, we felt that the traditional memory view and watch view
  594. representations of data in a debugged-process were not sufficient. Views were
  595. added to the traditional watch table structure to allow per-expression
  596. specification of extra visualization parameters.
  597.  
  598. Views look just like function calls. They start with the name of the view, a
  599. `(`, then a list of expressions which form the arguments for the view
  600. (optionally delimited by `,`s), followed by a `)`. The meaning of these
  601. arguments can sometimes be inferred through their order; for example, in the
  602. case of `bitmap(ptr, 512, 256)`, the `bitmap` view uses the `ptr` as the primary
  603. expression to interpret as bitmap data, then assumes the widely-used pattern of
  604. width, then height, to interpret the following arguments as the dimensions of
  605. the bitmap. In other cases, arguments must be specifically named. For instance,
  606. the `fmt` argument in `bitmap(ptr, 512, 256, fmt=bgra8)` is required to override
  607. the `bitmap` view's default assumption of RGBA8 bitmap data.
  608.  
  609. A list of currently-supported views are below:
  610.  
  611. - `raw(expr)`: Ignores all views used in `expr`, including those automatically
  612. applied by type views.
  613. - `bin(expr)`: Visualizes all numeric values evaluated in `expr` as base-2
  614. (binary).
  615. - `oct(expr)`: Visualizes all numeric values evaluated in `expr` as base-8
  616. (octal).
  617. - `dec(expr)`: Visualizes all numeric values evaluated in `expr` as base-10
  618. (decimal).
  619. - `hex(expr)`: Visualizes all numeric values evaluated in `expr` as base-16
  620. (hexadecimal).
  621. - `digits(expr, num)`: Visualizes at least `num` digits in all numeric values
  622. evaluated in `expr`.
  623. - `no_string(expr)`: Disables textual string visualization with pointer
  624. evaluations in `expr`.
  625. - `no_char(expr)`: Disables character visualization with character or integer
  626. evaluations in `expr`.
  627. - `no_addr(expr)`: Disables explicit address visualization with pointer
  628. evaluations in `expr`.
  629. - `sequence(expr)`: Interprets `expr` as an integer, encoding how many
  630. sub-expressions `expr` should expand to produce. This can be used in
  631. combination with the `table` view to easily generate tables, indexing amongst
  632. many arrays.
  633. - `rows(expr, ...)`: Interpreting all post-`expr` arguments as member names,
  634. only expands to show those members of `expr`.
  635. - `omit(expr, ...)`: Interpreting all post-`expr` arguments as member names,
  636. expands to show all members of `expr`, except those with matching names.
  637. - `range1(expr, min, max)`: Expresses that `expr` is a bounded numeric value
  638. between `min` and `max`. Interpreted by the debugger to build slider UI for
  639. an evaluation.
  640. - `array(expr, count)`: Expresses that `expr` points to `count` values, rather
  641. than 1, or the fixed size implied by a static array. When expanded, displays
  642. only that many values.
  643. - `slice(expr)`: Expresses that `expr` evaluates to a structure type which
  644. bundles a base pointer and a count (encoding how many elements to which the
  645. base pointer points). This count can be expressed either as an integer, or as
  646. an 'end pointer'. When expanded, displays that many elements following that
  647. base pointer.
  648. - `columns(expr, ...)`: Expresses that `expr` should be expanded normally, but
  649. interprets all post-`expr` arguments as expressions which should be used to
  650. form cells for rows which are generated by this expression's expansions. This
  651. replaces the normal cells which are generated for an expansion in a Watch
  652. table.
  653. - `text(expr, [lang = ...])`: Generates a text visualizer, interpreting `expr`
  654. as (being or pointing to) text.
  655. - `disasm(expr, [size = ...]`: Generates a disassembly visualizer, interpreting
  656. `expr` as (being or pointing to) machine code.
  657. - `memory(expr, [size = ...])`: Generates a memory visualizer, interpreting
  658. `expr` as (being or pointing to) raw bytes.
  659. - `bitmap(expr, width, height, [fmt = ...])`: Generates a bitmap visualizer,
  660. interpreting `expr` as (being or pointing to) raw bitmap data, with `width`
  661. and `height` as dimensions.
  662. - `color(expr)`: Generates a color picker, interpreting `expr` as a color
  663. value.
  664.  
  665. ## Breakpoints
  666.  
  667. Breakpoints interrupt execution of attached processes. They may be placed on
  668. arbitrary addresses (e.g. by placing a breakpoint on an instruction within a
  669. disassembly view, or with an arbitrary expression, like the name of a function),
  670. or on lines of source code. In the latter case, the source code location is
  671. resolved to code addresses. If there is no code associated with a line of source
  672. code, then the resolution path chooses to use the next closest line of source
  673. code in the same file.
  674.  
  675. Breakpoints may have stop conditions attached to them. When a breakpoint is hit
  676. by a thread, before it stops execution, the stop condition is evaluated, and if
  677. it evaluates to a nonzero value, only then is execution stopped.
  678.  
  679. Each breakpoint has a hit count. Every time a breakpoint causes execution to
  680. stop, this counter is increased.
  681.  
  682. Address breakpoints can also point to data, rather than code. This will cause
  683. execution to stop if some data is read from, written to, or executed. In this
  684. case, the debugger configures the hardware to use the available hardware data
  685. breakpoints feature. To enable this path, in the breakpoint's editor, express
  686. the number of bytes following the address that should be checked for
  687. writes/reads/executions (can be 1, 2, 4, or 8), and select whether or not you
  688. want to break on reads, writes, or executions.
  689.  
  690. ## User & Project Files
  691.  
  692. Applicable state controlling the debugger's appearance, behavior, targets,
  693. breakpoints, and other configurations is saved and reloaded across runs of the
  694. debugger through both *user files* and *project files*. These files are
  695. auto-saved. These files are written in a textual format which can be hand-edited
  696. as necessary, but they're also continuously re-read and re-written by the
  697. debugger. By default, the debugger uses `%appdata%/raddbg/default.raddbg_user`
  698. for its user file path, and `%appdata%/raddbg/default.raddbg_project` for its
  699. project file path. These paths can be overridden on the command line (see the
  700. 'Command-Line Usage' section).
  701.  
  702. The *user file* defaultly stores file path maps, windows (including their
  703. preferred monitor, placement, and size), each window's panel layout and tabs,
  704. keybindings, theme colors, and fonts.
  705.  
  706. The *project file* defaultly stores targets, breakpoints, watch pins, and
  707. exception code filters.
  708.  
  709. Because both can be hand-edited, however, if you want to store something
  710. normally stored in a user file in a project file, or vice versa, this can be
  711. done by hand transferring the textual data from one file to another. There is no
  712. path in the debugger's UI to support this transfer, currently, although this is
  713. planned.
  714.  
  715. ## Driving Another Debugger Instance
  716.  
  717. When the debugger is launched with the `--ipc` command-line argument, it does
  718. not launch another instance of the graphical debugger. Instead, it launches,
  719. sends a string encoding a command to a running instance of the graphical
  720. debugger, and then terminates. The set of commands which can be sent are
  721. identical to those which can be run from the debugger's UI itself, but these
  722. commands must be encoded textually (through the other command-line arguments).
  723. These commands are described in the 'Commands' section.
  724.  
  725.  
Advertisement
Comments
  • User was banned
  • User was banned
  • User was banned
Add Comment
Please, Sign In to add comment