Author Topic: someone working on CDB debugger?  (Read 67515 times)

Offline Martin K.

  • Multiple posting newcomer
  • *
  • Posts: 86
someone working on CDB debugger?
« on: September 20, 2012, 12:51:26 pm »
Hi,

Is curently someone working on the CDB Debugger Plugin? There are a few funktions open and they cry out for implementation ;-)

Martin

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: someone working on CDB debugger?
« Reply #1 on: September 20, 2012, 08:23:06 pm »
No. Keep in mind that some of them aren't implementable.

But what version are you talking about? 10.05 or latest HEAD?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Martin K.

  • Multiple posting newcomer
  • *
  • Posts: 86
Re: someone working on CDB debugger?
« Reply #2 on: September 20, 2012, 09:01:35 pm »
Hi,

Wich one isn't implementable? CDB is a powerful debugger and its expandable.

I'm talking about the HEAD (8397)

Martin

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: someone working on CDB debugger?
« Reply #3 on: September 20, 2012, 09:04:12 pm »
Wich one isn't implementable? CDB is a powerful debugger and its expandable.
Don't remember any more. CDB is not meant to be integrated in an IDE.
It could be powerful, but parsing its output is way harder than parsing gdb's output.

If you care for CDB support, provide patches and I'll see if they are good and I'll integrate them.
I don't use CDB and I rarely use Windows, so there are very little chances for CDB improvements in the future done by me.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Martin K.

  • Multiple posting newcomer
  • *
  • Posts: 86
Re: someone working on CDB debugger?
« Reply #4 on: September 20, 2012, 09:26:51 pm »

Don't remember any more. CDB is not meant to be integrated in an IDE.
It could be powerful, but parsing its output is way harder than parsing gdb's output.

If you care for CDB support, provide patches and I'll see if they are good and I'll integrate them.
I don't use CDB and I rarely use Windows, so there are very little chances for CDB improvements in the future done by me.

CDB is generally a commandline wrapper for dbgeng.dll. Maybe it would to use the debug engine without CDB, i don't know (yet).
But i can try my best, should i extend the existing CDB over GDB part or should i write a new debugger plugin? What do you think?

Martin

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: someone working on CDB debugger?
« Reply #5 on: September 20, 2012, 10:08:24 pm »
Hm, interesting...
I didn't know that there is this kind of a dll.
So the best way is to write a new debugger engine application as MS call it, which can use some IPC mechanism to communicate with a debugger plugin.
Another option is to try to integrate the dll in a new debugger plugin.
This way you won't need to parse the text output from CDB, which is close to unparsable sometimes.

(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Martin K.

  • Multiple posting newcomer
  • *
  • Posts: 86
Re: someone working on CDB debugger?
« Reply #6 on: October 01, 2012, 11:07:32 am »
Hi,

OK, i'm working on this and have one first Question:
In ExamineMemoryDlg::AddHexByte there is a loop for 16 hex bytes in one row of the window. But m_LastRowStartingAddress will be advanced by only 8. Is this OK?

Martin

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: someone working on CDB debugger?
« Reply #7 on: October 01, 2012, 11:57:17 am »
I'm not sure. Have you look what is the output of the gdb that is being parsed?
Keep in mind that the examine memory window has not been made generic,
it simply has been extracted from the code inside the plugin to the sdk without modifications.
It is very gdb specific and needs some work to be made generic.
« Last Edit: October 01, 2012, 11:58:50 am by oBFusCATed »
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Martin K.

  • Multiple posting newcomer
  • *
  • Posts: 86
Re: someone working on CDB debugger?
« Reply #8 on: October 01, 2012, 12:39:27 pm »
Hi,

I have found "my" Problem. The fault is inside of  ExamineMemoryDlg::AddHexByte();

It takes the address of the memory range to be displayed once on the first value, and then after every completed line. There are a maximum of 16 Values in each line and the next address will be computed from the last adress value + 8. This works only when the adress delivered to this funktion will is valid on every 8. value and don't change for the next 8 values.
The GDB Driver will work, it "sends" the memory dump values to this funktion in packages of 8 values. Every other combination will not work. And there is an additional Problem when the memory dump starts at address 0.

I will work around this problem in my funktion until someone other fixes the behaviour of  ExamineMemoryDlg::AddHexByte().

Martin
« Last Edit: October 01, 2012, 12:51:21 pm by Martin K. »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: someone working on CDB debugger?
« Reply #9 on: October 01, 2012, 07:32:17 pm »
I will work around this problem in my funktion until someone other fixes the behaviour of  ExamineMemoryDlg::AddHexByte().
Why not fixing the AddHexByte directly?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Martin K.

  • Multiple posting newcomer
  • *
  • Posts: 86
Re: someone working on CDB debugger?
« Reply #10 on: October 01, 2012, 08:20:36 pm »
I will work around this problem in my funktion until someone other fixes the behaviour of  ExamineMemoryDlg::AddHexByte().
Why not fixing the AddHexByte directly?

My main problem is the CDB plugin currently and i can work on it only on my spare time. The "workaround" is currently faster for me, so i don't have to check other things that i'm not know currently. But i can note this problem on my list and can come back later to it.

Martin

Offline Martin K.

  • Multiple posting newcomer
  • *
  • Posts: 86
Re: someone working on CDB debugger?
« Reply #11 on: October 03, 2012, 02:05:44 pm »
Hi,

I have prepared a first version of the CDB Debugger plugin. Maybe someone is able to have a look on it.

https://www.dropbox.com/s/ds1b5rr7ouhhvsl/debugger_cdb.zip


This plugin is based on the new Code::Blocks debugger plugin structure, based on debugger_gdbmi.
The Debugger is driven on its commandline version CDB.exe.

It is not yet completed, but it seems to work. available functions so far:
- start a debuggee, break into it, stop it
- set unconditinal Breakpoints and delete it
- shows tooltip watches
- set simple watches and delete it
- show threads
- show backtrace
- show memory dump
- show cpu registers

Overall performance seems to be OK.

unavailable functions:
- Breakpoint and watches are needing further improvements.
- There are no Data Brakpoints and no conditional Breakpoints.
- Run to cursor isn't implemented.
- Attach to/detach from process isn't implemented.
- Disassembly isn't implemented.
- The display of watches is currently the output of the debugger,
  pretty printig whould be nice.

Tested with
- Code::Blocks rev 8383, rev 8397 and rev 8431.
- CDB Version 6.12.0002.633 X86
on windows XP SP3 32Bit and Windows 7 64Bit

Martin

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: someone working on CDB debugger?
« Reply #12 on: October 03, 2012, 06:17:47 pm »
I have prepared a first version of the CDB Debugger plugin. Maybe someone is able to have a look on it.

https://www.dropbox.com/s/ds1b5rr7ouhhvsl/debugger_cdb.zip
Have you though of putting it on github or something like this?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Martin K.

  • Multiple posting newcomer
  • *
  • Posts: 86
Re: someone working on CDB debugger?
« Reply #13 on: October 04, 2012, 06:16:12 pm »
I have prepared a first version of the CDB Debugger plugin. Maybe someone is able to have a look on it.

https://www.dropbox.com/s/ds1b5rr7ouhhvsl/debugger_cdb.zip
Have you though of putting it on github or something like this?

http://svn.code.sf.net/p/debuggercdb/code/trunk  ;)

Martin

CsrPryr

  • Guest
Re: someone working on CDB debugger?
« Reply #14 on: October 07, 2012, 09:44:28 am »
send me compile errors?....


||=== debugger_cdb, default ===|
C:\wxWidgets-2.8.12\include\wx\platform.h|196|error: wx/setup.h: No such file or directory|
C:\wxWidgets-2.8.12\include\wx\chkconf.h|103|error: #error "wxUSE_DYNLIB_CLASS must be defined."|
C:\wxWidgets-2.8.12\include\wx\chkconf.h|111|error: #error "wxUSE_EXCEPTIONS must be defined."|
C:\wxWidgets-2.8.12\include\wx\chkconf.h|119|error: #error "wxUSE_FILESYSTEM must be defined."|
C:\wxWidgets-2.8.12\include\wx\chkconf.h|127|error: #error "wxUSE_FS_ARCHIVE must be defined."|
C:\wxWidgets-2.8.12\include\wx\chkconf.h|140|error: #error "wxUSE_DYNAMIC_LOADER must be defined."|
C:\wxWidgets-2.8.12\include\wx\chkconf.h|148|error: #error "wxUSE_LOG must be defined."|
C:\wxWidgets-2.8.12\include\wx\chkconf.h|156|error: #error "wxUSE_LONGLONG must be defined."|
C:\wxWidgets-2.8.12\include\wx\chkconf.h|164|error: #error "wxUSE_MIMETYPE must be defined."|
C:\wxWidgets-2.8.12\include\wx\chkconf.h|180|error: #error "wxUSE_PRINTF_POS_PARAMS must be defined."|
C:\wxWidgets-2.8.12\include\wx\chkconf.h|188|error: #error "wxUSE_PROTOCOL must be defined."|
C:\wxWidgets-2.8.12\include\wx\chkconf.h|230|error: #error "wxUSE_REGEX must be defined."|
C:\wxWidgets-2.8.12\include\wx\chkconf.h|238|error: #error "wxUSE_STDPATHS must be defined."|
C:\wxWidgets-2.8.12\include\wx\chkconf.h|246|error: #error "wxUSE_XML must be defined."|
C:\wxWidgets-2.8.12\include\wx\chkconf.h|254|error: #error "wxUSE_SOCKETS must be defined."|
C:\wxWidgets-2.8.12\include\wx\chkconf.h|262|error: #error "wxUSE_STREAMS must be defined."|
C:\wxWidgets-2.8.12\include\wx\chkconf.h|270|error: #error "wxUSE_STOPWATCH must be defined."|
C:\wxWidgets-2.8.12\include\wx\chkconf.h|278|error: #error "wxUSE_TEXTBUFFER must be defined."|
C:\wxWidgets-2.8.12\include\wx\chkconf.h|286|error: #error "wxUSE_TEXTFILE must be defined."|
C:\wxWidgets-2.8.12\include\wx\chkconf.h|302|error: #error "wxUSE_URL must be defined."|
C:\wxWidgets-2.8.12\include\wx\chkconf.h|310|error: #error "wxUSE_VARIANT must be defined."|
C:\wxWidgets-2.8.12\include\wx\chkconf.h|330|error: #error "wxUSE_ABOUTDLG must be defined."|
C:\wxWidgets-2.8.12\include\wx\chkconf.h|338|error: #error "wxUSE_ACCEL must be defined."|
C:\wxWidgets-2.8.12\include\wx\chkconf.h|346|error: #error "wxUSE_ANIMATIONCTRL must be defined."|
C:\wxWidgets-2.8.12\include\wx\chkconf.h|354|error: #error "wxUSE_BITMAPCOMBOBOX must be defined."|
C:\wxWidgets-2.8.12\include\wx\chkconf.h|362|error: #error "wxUSE_BMPBUTTON must be defined."|
C:\wxWidgets-2.8.12\include\wx\chkconf.h|370|error: #error "wxUSE_BUTTON must be defined."|
C:\wxWidgets-2.8.12\include\wx\chkconf.h|378|error: #error "wxUSE_CALENDARCTRL must be defined."|
C:\wxWidgets-2.8.12\include\wx\chkconf.h|386|error: #error "wxUSE_CARET must be defined."|
C:\wxWidgets-2.8.12\include\wx\chkconf.h|394|error: #error "wxUSE_CHECKBOX must be defined."|
C:\wxWidgets-2.8.12\include\wx\chkconf.h|410|error: #error "wxUSE_CHOICE must be defined."|
C:\wxWidgets-2.8.12\include\wx\chkconf.h|418|error: #error "wxUSE_CHOICEBOOK must be defined."|
C:\wxWidgets-2.8.12\include\wx\chkconf.h|426|error: #error "wxUSE_CHOICEDLG must be defined."|
C:\wxWidgets-2.8.12\include\wx\chkconf.h|434|error: #error "wxUSE_CLIPBOARD must be defined."|
C:\wxWidgets-2.8.12\include\wx\chkconf.h|442|error: #error "wxUSE_COLLPANE must be defined."|
C:\wxWidgets-2.8.12\include\wx\chkconf.h|450|error: #error "wxUSE_COLOURDLG must be defined."|
C:\wxWidgets-2.8.12\include\wx\chkconf.h|458|error: #error "wxUSE_COLOURPICKERCTRL must be defined."|
C:\wxWidgets-2.8.12\include\wx\chkconf.h|466|error: #error "wxUSE_COMBOBOX must be defined."|
C:\wxWidgets-2.8.12\include\wx\chkconf.h|474|error: #error "wxUSE_COMBOCTRL must be defined."|
C:\wxWidgets-2.8.12\include\wx\chkconf.h|482|error: #error "wxUSE_DATAOBJ must be defined."|
C:\wxWidgets-2.8.12\include\wx\chkconf.h|490|error: #error "wxUSE_DATAVIEWCTRL must be defined."|
C:\wxWidgets-2.8.12\include\wx\chkconf.h|498|error: #error "wxUSE_DATEPICKCTRL must be defined."|
C:\wxWidgets-2.8.12\include\wx\chkconf.h|506|error: #error "wxUSE_DIRPICKERCTRL must be defined."|
C:\wxWidgets-2.8.12\include\wx\chkconf.h|514|error: #error "wxUSE_DISPLAY must be defined."|
C:\wxWidgets-2.8.12\include\wx\chkconf.h|522|error: #error "wxUSE_DOC_VIEW_ARCHITECTURE must be defined."|
C:\wxWidgets-2.8.12\include\wx\chkconf.h|530|error: #error "wxUSE_FILEDLG must be defined."|
C:\wxWidgets-2.8.12\include\wx\chkconf.h|538|error: #error "wxUSE_FILEPICKERCTRL must be defined."|
C:\wxWidgets-2.8.12\include\wx\chkconf.h|546|error: #error "wxUSE_FONTDLG must be defined."|
C:\wxWidgets-2.8.12\include\wx\chkconf.h|554|error: #error "wxUSE_FONTMAP must be defined."|
C:\wxWidgets-2.8.12\include\wx\chkconf.h|562|error: #error "wxUSE_FONTPICKERCTRL must be defined."|
||More errors follow but not being shown.|
||Edit the max errors limit in compiler options...|
||=== Build finished: 50 errors, 0 warnings ===|