CDbg»Blog

CDbg Build 0.0.0.6

Hello guys! A new build is here and lets see what is new.

- Now you have an ability to change values on the fly in the Inspector widget. Double click on the value or press CTRL+e to edit.


- Run-to a line is now available. You can access it with shortcut 't' in Fileviewer widget or right click and select in the context menu "Run To Cursor". Also you can set next statement with shortcut 'r' or right click and select in the context menu "Set Next Statement".


- A file dialog will show up now when missing a file. This helps when your source code directory does not match hard-coded directory in the debug info file.

- Now when a new expression is created Inspector will select next empty row.

- A bug with AltGr was fixed.

- Added shortcuts to quickly access different panes.
ALT+1 - Selects Fileviewer
ALT+2 - Selects Inspector
ALT+3 - Selects Callstack
ALT+0 - Selects Debug Output
ALT+9 - Selects Disassembler
If there are multiple instances of the same pane pressing same shortcut will cycle through them.

- A window was added to modify executable path, command line, working directory; it can be accessed with F1 key.


- A window was added to make data breakpoints, it can be accessed with F2 key or you can press in the Inspector CTRL+d this will automatically create an
expression for a selected row and paste it into the window.
NOTE: You can have only 3 data breakpoints active at one time. This is because debugger uses debug registers to trap writes and reads and there are only 4 registers and one is used for stepping. I know that 3 data breakpoints is limited and I have tried to work around this by using VirtualProtect to change access rights for pages but this proved to be very inefficient. You cannot use VirtualProtect to trap sizes that are < than a page size (on my machine it is 4096 bytes) and most data breakpoints are less than that, therefore debugger has to do a range check on every access violation event that is sent by the OS. At this point I have found out that windows takes around 500,000 cycles to process a single access violation event which makes program that is being debugged totally unusable.


- A "plucking" feature was added to the Inspector widget that can be accessed with shortcut CTRL+p or CTRL+P to select "plucked" row. This is for cases when you want to view a variable when changing stack frames.

- Now when you place mouse pointer over a variable in the Fileviewer widget a tooltip will show up with value of that variable. Also you can put cursor on the identifier and press 'e' to trigger tooltip or you can select an expression and press 'e' to evaluate it.


- A new tool was added to the Inspector widget to view long strings. You can click on the magnifying glass icon on the right in the Inspector or use shortcut CTRL+m to access it.


- Updated freetype to 2.9.

- Ditched my instruction decoder in favor of the Intel XED.

- ALT+h will toggle base for the selected Inspector or Fileviewer.
- ALT+H will toggle base for every Inspector and Fileviewer instances.

- Added shortcuts to resize panes, see "cdbg.config".

Press '`'(tilda) to access console.
Console commands:
ls bp - list all breakpoints.
ls dbp - list all data breakpoints.
ls fbreak - list all function breakpoints.
ls thread - list all threads.
ls module - list all modules.
ls file - list all files.
ls keys - list all key bindings.

del bp # - delete breakpoint.
del dbp # - delete data breakpoint.
del fbreak # - delete function breakpoint.
You can find # by using the "ls" command. Also, to delete all entries you can use '*' instead of the index.

gotobp # - point Fileviewer at specified breakpoint.
select_thread # - select specified thread.
break - breaks running debuggee.
clear - clears the console.

Download Link
Jeremiah Goerdt,
Whoa, you've got a lot of functionality in there! And, those colors look great :-P

Is all of your gui code handmade? It looks really good.

Run-to-line is something I tried to hack into Lysa quickly, but it didn't work out as planned. Did you have any issues with it when you first implemented it?
Marc Costa,
Hi! The debugger looks great!

I wanted to give it a try, but I don't see any up to date manual. I've tried to do what older posts say, but things have changed. Is there a hotkey to access a list of all commands/hotkeys? (I used "help" in the console, but it only outputs a list of the console commands).
Nikita Smith,
Yeah GUI is handmade :)

I think run-to line was done in couple hours and did not require any special treatment, it is just a breakpoint that is hidden from user and a "continue" command for debugger's backend.
Nikita Smith,
You can type into console "ls keys" and that should print a list of all key bindings.
Edited by seventh-chord on Reason: Fixed formating
I've been using cdbg daily for a while now, and this update looks really nice! One small issue in the post. It says alt-m toggles hex/dec mode, but in the config file this is set to alt-h.

Regarding AltGr, the issue with not being able to type third-layer keys still persists for me. I think this is partially because I have changed the registry to swap around some keys on my keyboard. Are you actually using WM_KEYDOWN for typing? Because if so, WM_CHAR is the only way to get proper typing on every possible keyboard layout on windows (plus it is less work to implement).

Regardless, thank you for making this debugger!
Nikita Smith,
seventh-chord
I've been using cdbg daily for a while now, and this update looks really nice! One small issue in the post. It says alt-m toggles hex/dec mode, but in the config file this is set to alt-h.

Regarding AltGr, the issue with not being able to type third-layer keys still persists for me. I think this is partially because I have changed the registry to swap around some keys on my keyboard. Are you actually using WM_KEYDOWN for typing? Because if so, WM_CHAR is the only way to get proper typing on every possible keyboard layout on windows (plus it is less work to implement).

Regardless, thank you for making this debugger!


I tested AltGr on couple machines and one virtual, and I did not have any issues. I am sorry that it is still there and I will try to fix it in the next build.
Simon Anciaux,
I also still have problems with letters that use AltGR. Maybe this could help.