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

Offline Martin K.

  • Multiple posting newcomer
  • *
  • Posts: 86
Re: someone working on CDB debugger?
« Reply #45 on: October 24, 2012, 06:08:47 pm »
rev 13:
- run to cursor works (on running and stopped debugger)
- a little profile to measure the performance of the debugger plugin

have fun
Martin

Offline Bat

  • Multiple posting newcomer
  • *
  • Posts: 48
Re: someone working on CDB debugger?
« Reply #46 on: December 23, 2012, 11:15:36 am »
Good work !
I've compiled and installed it. It's even as good as current plugin in CodeBlock trunks.
I will try to add some missing things in my use.

For information, I use it with C compiler LCC-Win32. (it's enhanced C, so there is some common C++ feature include in it)
This compiler produce CodeView debugging symbol, that seem not well understood by CDB. So I use an open source tool cv2pdb http://dsource.org/projects/cv2pdb to do conversion. So missing can come from cv2pdb or cdb plugin ...

So, question :

with :
struct bob{
  char str[200];
};

struct bob a_bob;
strcpy(a_bob,"data");

what look like :
a_bob.str
here I have only first char str 'd'

Offline Martin K.

  • Multiple posting newcomer
  • *
  • Posts: 86
Re: someone working on CDB debugger?
« Reply #47 on: December 23, 2012, 12:48:38 pm »
Good work !
I've compiled and installed it. It's even as good as current plugin in CodeBlock trunks.
I will try to add some missing things in my use.

For information, I use it with C compiler LCC-Win32. (it's enhanced C, so there is some common C++ feature include in it)
This compiler produce CodeView debugging symbol, that seem not well understood by CDB. So I use an open source tool cv2pdb http://dsource.org/projects/cv2pdb to do conversion. So missing can come from cv2pdb or cdb plugin ...

So, question :

with :
struct bob{
  char str[200];
};

struct bob a_bob;
strcpy(a_bob,"data");

what look like :
a_bob.str
here I have only first char str 'd'


Thank you, the first response to my plugin :-)

It is not complete now, but i think that it offers more functionality as the "trunk" Plugin.
Feel free to enhance whatever you like and send me patches for it.

Martin

Offline Bat

  • Multiple posting newcomer
  • *
  • Posts: 48
Re: someone working on CDB debugger?
« Reply #48 on: December 29, 2012, 06:12:43 pm »
Here a patch to add "Breakpoint at main entry"


Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: someone working on CDB debugger?
« Reply #49 on: December 29, 2012, 06:32:54 pm »
Here a patch to add "Breakpoint at main entry"
Isn't this the same as using the step-into command instead of debug->start?
(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 Bat

  • Multiple posting newcomer
  • *
  • Posts: 48
Re: someone working on CDB debugger?
« Reply #50 on: December 29, 2012, 06:44:08 pm »
Here a patch to add "Breakpoint at main entry"
Isn't this the same as using the step-into command instead of debug->start?
Not really the same. In fact 4 cases :

-Hit run, with no bp at start : program run fully
-Hit step-into, with no bp at start : program stop just after loading (so long before main() or WinMain(), before initializing DLL and so on)
-Hit run, with bp at start : program stop at WinMain
-Hit step-into, with bp at start : program stop just after loading and if we run, it stop at main() WinMain() too ...

In case, Step-into+Bp we can change beahviour not to place main() bp ...

Patch include a configuration checkbox to activate (or not) Breakpoint at start

Offline Martin K.

  • Multiple posting newcomer
  • *
  • Posts: 86
Re: someone working on CDB debugger?
« Reply #51 on: December 29, 2012, 07:17:29 pm »
Here a patch to add "Breakpoint at main entry"
Isn't this the same as using the step-into command instead of debug->start?
Not really the same. In fact 4 cases :

-Hit run, with no bp at start : program run fully
-Hit step-into, with no bp at start : program stop just after loading (so long before main() or WinMain(), before initializing DLL and so on)
-Hit run, with bp at start : program stop at WinMain
-Hit step-into, with bp at start : program stop just after loading and if we run, it stop at main() WinMain() too ...

In case, Step-into+Bp we can change beahviour not to place main() bp ...

Patch include a configuration checkbox to activate (or not) Breakpoint at start


Hi,

Makes sense after the first look, are there some other comments on this?

Martin

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: someone working on CDB debugger?
« Reply #52 on: December 29, 2012, 07:24:52 pm »
-Hit step-into, with no bp at start : program stop just after loading (so long before main() or WinMain(), before initializing DLL and so on)
If you ask me, I'd make it to stop at main and I'll add an option to make it possible to stop just after load.
GDB does just this currently and in fact there is no option.
(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 #53 on: December 29, 2012, 09:20:42 pm »
-Hit step-into, with no bp at start : program stop just after loading (so long before main() or WinMain(), before initializing DLL and so on)
If you ask me, I'd make it to stop at main and I'll add an option to make it possible to stop just after load.
GDB does just this currently and in fact there is no option.

You mean:

1.) Run runs the program under debugger control with user breakpoints set - like currently and "step into" sets a temporary breakpoint at main, Winmain, _main or whatever is found by the debugger?
2.) make an option to stop the debuggee after it is loaded - before main.

right?

I haven't implemented it so far, because i haven't checked whats happen when my project is a shared library und another program (which uses this library) will be started as debuggee. There are two other points i'm aware of with CDB and executable breakpoints: CDB64 is able to debug 32 and 64 bit programs, but it sets another breakpoint while starting the 32bit runtime environment (WoW64), the debugger should go over it (maybe should an option also, or depending on the option "stop after loading"), the second is the ability of the MSVC Compiler to generate incremental link tables. When i set a breakpoint on a function entry while this feature is on, the debuggee will break at the link table entry and the user has to step one time to reach the requested breakpoint position. Maybe also an option for the user...

Martin

Offline Bat

  • Multiple posting newcomer
  • *
  • Posts: 48
Re: someone working on CDB debugger?
« Reply #54 on: December 30, 2012, 11:44:48 am »
You mean:

1.) Run runs the program under debugger control with user breakpoints set - like currently and "step into" sets a temporary breakpoint at main, Winmain, _main or whatever is found by the debugger?
2.) make an option to stop the debuggee after it is loaded - before main.

right?

For me it's a good base.

With DLL 2 or 3 possibility in fact :
-stop at main() of host program
-stop at DllEntry() of DLL (here EntryPoint name should be recovered)
-stop at both

Stopping at DllEntry is good option ?

And if we keep option "stop debuggee after loading", all other possibility can do manually

For 32/64 bit I haven't do enought 64 bits debugging. If debugger add itself some breakpoint they can be bypassed manually in first time ...

If it's ok I will do modification

Offline Bat

  • Multiple posting newcomer
  • *
  • Posts: 48
Re: someone working on CDB debugger?
« Reply #55 on: January 06, 2013, 09:32:13 pm »
So, I've make modification of previous post and enhanced watch variable/watch tooltips.
Here a list :
-modification of option added 'break at program entry'
-watchs improved
  -convert CDB type to C/C++
  -handle recurse subitem (struct, array) dynamically when user expand watch
  -handle string
  -update of all watch and subwatch when needed (seem to have some case where update is not ok)
  -handle of structure, structure pointer and cast ((MYSTRUCT*)prj->j where prj is a void * is ok)
  -handle of local variable
  -handle of function pointer, with recover of textual function name
-combination of TooltipWatch and Watch. They give now identical result, but some enhancement to make (Tooltips don't generate ExpandWatch ?)
-correction of RegExp for stack frame where function have parameter with array
 

Offline Martin K.

  • Multiple posting newcomer
  • *
  • Posts: 86
Re: someone working on CDB debugger?
« Reply #56 on: January 06, 2013, 09:39:21 pm »
So, I've make modification of previous post and enhanced watch variable/watch tooltips.
Here a list :
-modification of option added 'break at program entry'
-watchs improved
  -convert CDB type to C/C++
  -handle recurse subitem (struct, array) dynamically when user expand watch
  -handle string
  -update of all watch and subwatch when needed (seem to have some case where update is not ok)
  -handle of structure, structure pointer and cast ((MYSTRUCT*)prj->j where prj is a void * is ok)
  -handle of local variable
  -handle of function pointer, with recover of textual function name
-combination of TooltipWatch and Watch. They give now identical result, but some enhancement to make (Tooltips don't generate ExpandWatch ?)
-correction of RegExp for stack frame where function have parameter with array
 

sounds very good, thank you! I will have a look on it in the next days.

committed after a short test.

Martin
« Last Edit: January 07, 2013, 08:48:57 pm by Martin K. »

Offline geoffzou

  • Multiple posting newcomer
  • *
  • Posts: 11
Re: someone working on CDB debugger?
« Reply #57 on: May 14, 2013, 05:12:03 am »
So, I've make modification of previous post and enhanced watch variable/watch tooltips.
Here a list :
-modification of option added 'break at program entry'
-watchs improved
  -convert CDB type to C/C++
  -handle recurse subitem (struct, array) dynamically when user expand watch
  -handle string
  -update of all watch and subwatch when needed (seem to have some case where update is not ok)
  -handle of structure, structure pointer and cast ((MYSTRUCT*)prj->j where prj is a void * is ok)
  -handle of local variable
  -handle of function pointer, with recover of textual function name
-combination of TooltipWatch and Watch. They give now identical result, but some enhancement to make (Tooltips don't generate ExpandWatch ?)
-correction of RegExp for stack frame where function have parameter with array
 

sounds very good, thank you! I will have a look on it in the next days.

committed after a short test.

Martin

What is the status of this awsome development? Has Bat's patch been integrated to svn (rev.17) yet? Thanks!

Offline Bat

  • Multiple posting newcomer
  • *
  • Posts: 48
Re: someone working on CDB debugger?
« Reply #58 on: November 01, 2014, 12:28:42 am »
This topic is quite rather old, but here is a crude patch for actual update of this plugin
It's not clean, debug trace are still activated and so on.
It correct some few things on this plugin (small name variables, array, ...)

If there is an interest in it I can clean it