Nikita Smith

Finally managed to get this build done. There are a lot of improvements and bug fixes, list of all changes you can find in the zip file.

There is one more thing, this is the last build. I have to sign a non-compete agreement soon, which won't allow me to work on this debugger.

Thanks to everyone who had been around for this project!

Download Link
Nikita Smith
Hello guys! A new build is here and lets see what is new.

- Added Unicode support to the rendering system.

- Fileviewer will open files that are encoded as UTF-8.

- Fileviewer now has indentation lines that can be toggled from
the config file through the "fileviewer_show_indent_lines" value modifier.

- Added a config value modifier "fileviewer_tooltip_timer_ms" that
changes delay of the value tooltip in the Fileviewer widget.

- Added a config value modifier "maximize_window_on_start" that
maximizes debugger's window on startup on startup if set to "true".

- Added a config value modifier "tab_width" that changes default tab width.

- Added a new config event "clear_all_expr" that clears all the expressions
in the inspector. Currently bound to CTRL + l.

- Added a new config event "clear_all_data_bp" that clears all the data breakpoints.
Currently bound to CTRL + g.

- C/C++ Lexer now can parse integer suffixes like 0x123ull.

- String viewer tool from the inspector now will pick up size parameter
from the expression and when you are going to click on the magnifying
glass, the tool will read amount of bytes that was specified.

- Inspector will display each array element address along with an index.

- Inspector now can handle UTF-16 strings.

- And a bunch of bug fixes.

Download Link
Nikita Smith
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
Nikita Smith
Hello guys!

It has been a while since I posted something here, the reason is that a series of unfortunate events occurred in my life which prevented me from programming at all. Only last October I returned back to my normal life, and first thing that I did was firing up emacs and checking out state of the debugger. First impulse was to burn everything to the ground and start over, but lucky me that a more rational thought followed it. Starting over will not change anything, and it is better to work on the existing code. After looking around I decided that it is time to get rid of the DIA library (Microsoft's COM disaster to read PDB). At the start I was not even sure that I will be able to write a replacement for that, however as time went by I found that there is nothing hard about it. I limited parser to a certain subset of symbols, which helped a lot because PDB has a lot of legacy stuff in it. Removing the DIA also forced me to write a stack unwinder. It is always a good thing to remove a black box out of a project. In this case it means that we are no longer tied to the windows and it will be much easier to port debugger to the Linux later.

Next on the list was to improve UI rendering. Before I had a loop that would redraws screen all the time, like you would see in a game and in context of a game this is totally fine, but it is not when you have mostly an idle UI. New system will only re-render regions that have changed, which will help to save a lot of CPU work. And while I was changing UI code a decision was made to improve the font rendering too. Debugger was using FreeType to render glyphs and I already knew that it is possible to tweak it to output LCD glyphs for sub-pixel text rendering, and the trick here was to make it work with OpenGL. First, I tried to look around the internet for some pointers, but after an hour of searching I gave up and did it myself. I will write an article about sub-pixel text rendering with FreeType and OpenGL soon, because in my opinion a lot of people will benefit from this knowledge, and I hope 4coder will implement it so I can finally ditch emacs :)

This concludes list of all major changes that were done, and I hope that you can help me improve debugger by trying it out yourself. Please leave your feedback in comments or just email me at [email protected]. I also put a little demo video together on youtube and you can download debugger here.
Nikita Smith
Hello everyone! A new CDbg build is here.
You can download build using this link. All instructions you can find inside the zip file.