Author Topic: Features in Windows Debugger CDB running VS2010 compiler  (Read 2469 times)

Offline tigerbeard

  • Multiple posting newcomer
  • *
  • Posts: 104
Features in Windows Debugger CDB running VS2010 compiler
« on: March 08, 2016, 05:41:46 pm »
Hi
Using Relelase 15.12 on Win7, x64 I configured the 32-bit version of compiler and debugger from Windows SDK 7.1. for use in CodeBlocks. For testing I set up a default console application Hello World which worked fine.

I am aware that GDB support is more advanced as CBD, but I have not found anything on the actual limitations of the current debugger plugin for CDB. Forum seaches seem to ignoe the term "CDB", so I might have missed key posts. I did not see anything in the wiki. I found the following posts about CDB:
 http://forums.codeblocks.org/index.php/topic,7331.msg55775.html#msg55775
 http://forums.codeblocks.org/index.php/topic,8454.msg62299.html#msg62299
 http://forums.codeblocks.org/index.php/topic,16885.msg134940.html#msg134940

I extended HelloWold with a class with two variables and a member function. Also I adde a string, int and
float.

The stepping worked very well. The watches are different to the gdb:
 - Locals are listed, but seem not to do anything, even when I step into the class
 - the class shows "Unexpected token '<'EOL>'. It can be unfolded and correctly shows the value
   of the two int member vars as "0n1" and "0n2" instead of "1" and "2". I can not change the display
   to Decimal.
 - The string shows "Parsing CDB output failed for "strName". In the debug log I can not see the
  string content, indeed. When I unfold the string line I can see the values _Mproxy, _Bx, _Mysize,
   _Myres and _Alval. The Size value shows the correct length
 - The int variable is shown with the correct value, but output as "0n4" instead "4". Via context
   menu I can open properties and set the base to decimal, but nothing changes.

I checked the logger output for general errors and found the following:
 - Symbol file could not be found. Defaultet to export symbols for ntdll.dll
 - Warning: unable to veriy checksum for <Executable name>
 - Warning: Stack unwind information not available Following Frames may be wrong
    [...]
 - virtual void CDB_driver::MemoryDump(): not implemented in driver

I do not have the feeling the errors are really related, but I am not sure. I did not install the symbol files for the OS, indeed. Since the pdb for the executable is available I understand that those symbold are not
required for this simple case. Again, that may be a wrong assumption...


My question is wether or not that is the actual status of the plugin? 
Second, I would expect for CDB there is no matching thing for pretty-printers in GDB, is there?


Tiger



Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12678
    • Travis build status
Re: Features in Windows Debugger CDB running VS2010 compiler
« Reply #1 on: March 08, 2016, 08:18:45 pm »
Can you post the code and a full log (check the debugger settings) from a debug session?
Most of the features in cdb are not implemented (locals for example).
The watches parsing should work for some basic things, but probably there is a change in the output in the cdb you're using (this is a guess).

Also there is another debugger plugin that integrates cdb, probably it works better, but I've not tried it.
Also I don't spend much time on windows, so I'm not really working on cdb support.
But patches are welcome.
(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 oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12678
    • Travis build status
Re: Features in Windows Debugger CDB running VS2010 compiler
« Reply #2 on: March 08, 2016, 08:23:48 pm »
Obviously one of the linked topics points to this: https://sourceforge.net/projects/debuggercdb/
(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 tigerbeard

  • Multiple posting newcomer
  • *
  • Posts: 104
Re: Features in Windows Debugger CDB running VS2010 compiler
« Reply #3 on: March 08, 2016, 08:49:12 pm »
Also there is another debugger plugin that integrates cdb, probably it works better, but I've not tried it.

Oh. I did see that of course, but was under the impression that this got merged into the CDB plugin. If there are two separate things, I understand now, why there were talking about patches. I'm not really good at this, so please forgive me if its a stupid question. If I would want to try it out I would need to download the source, apply those patches from the other thread (or merg the other source manually) and then compile C::B?
I am probably not a good enough programmer to continue that, but I think the cdb plugin seem little used which is sad since it has great potential. Are your aware of any technical reason (i mean aside manpower) for not merging the 2 approaches or switching to the more complete version of the two?.


Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12678
    • Travis build status
Re: Features in Windows Debugger CDB running VS2010 compiler
« Reply #4 on: March 08, 2016, 09:09:24 pm »
This is a separate plugin. You need to compile only this plugin.

Probably this link http://wiki.codeblocks.org/index.php/Linking_the_plugin_to_a_Nightly_Build might help.
But I don't know if the plugin will compile cleanly with the latest changes to cb.
(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 oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12678
    • Travis build status
Re: Features in Windows Debugger CDB running VS2010 compiler
« Reply #5 on: March 08, 2016, 09:10:36 pm »
Also there are no technical issues integrating this plugin in the main source, just lack of a maintainer.
(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 tigerbeard

  • Multiple posting newcomer
  • *
  • Posts: 104
Re: Features in Windows Debugger CDB running VS2010 compiler
« Reply #6 on: March 09, 2016, 02:06:51 am »
Probably this link http://wiki.codeblocks.org/index.php/Linking_the_plugin_to_a_Nightly_Build might help.
Ok, thanks. I stumbled across that description before, but had nothing to relate to. Now that a good reason to check that out.


I would have posted my log already, but currently go a very weird case that it would not compile. The problem does not seem to be the plugin, but the PDB file thats gernerated which is not recoginised by CDB. Even native WinDBG would not do it. The plugin returns right after the g command with status 0.
The weird thing is that cbd/Wincdb is for that test.exe not looking for the Test.pdb which is there but rather for an image001f0000.pdf or image001f0000.dbg. Internet does not seem to be full of people with that problem...

Offline tigerbeard

  • Multiple posting newcomer
  • *
  • Posts: 104
Re: Features in Windows Debugger CDB running VS2010 compiler
« Reply #7 on: March 09, 2016, 03:54:03 am »
Quote
The problem does not seem to be the plugin, but the PDB file thats gernerated which is not recoginised by CDB. Even native WinDBG would not do it. The plugin returns right after the g command with status 0.

Found that. Weird indeed.

The source was a blockade in the Build Option dialog; the LinkerSettings/Policy was empty. That caused the libs and linker options to be ignored. Thus the linker did not include the \Debug flag and the correct libs. Strangely it did not produce any.
The output PDB of course was not matching the exe any more, so CDB would not accept to load it. That caused to debug run to quit instantly. Why WinDbg did not complain about a pdb file mismatch remains a bit mysterious. I did not find a single mention in the web that CDB tries to load a pdb for an image instead of the module itself. Would be happy to understand that a bit better, but of course thats off topic to the C:B forum.

So I got the source but not the cause. Unfortunately I could not reproduce the effect to get that combobox to display nothing. Seem that it should get to its default value "Append target options to project options" in case anything is weird.

At least learned a lot about CBD in a short time 8)