Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ TheIDE » U++ TheIDE: Compiling, Linking, Debugging of your packages » Watching global variables in IDE debugger with MSC7-1
Watching global variables in IDE debugger with MSC7-1 [message #215] Sun, 04 December 2005 06:26 Go to next message
gprentice is currently offline  gprentice
Messages: 260
Registered: November 2005
Location: New Zealand
Experienced Member


Hi

I'm trying out the debugger in the IDE with MSC7.1 build and when I try to add a watch for a global variable it says the variable is undefined. It shows me local variables ok.

If I fire up the V Studio debugger from TheIDE with "devenv" I can add the global variable to the watch list ok (though I seem to be forced to create a "solution" file).

The global variable is just a simple DWORD variable.
Any ideas why The IDE says it's "undefined" - I checked the name carefully? I could use devenv but I'm just wondering if this should work.

Graeme
Re: Watching global variables in IDE debugger with MSC7-1 [message #221 is a reply to message #215] Sun, 04 December 2005 18:41 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Sorry, this is the feature.

The reason is that dbghelp.dll - MS library that provides API to resolve symbolic information in executables - has serious problem with global symbols - any operation that involves globals takes very very long time. That is why for the time being, I gave up global variables.

Actually, I somebody would try to resolve this issue, I would be happy (as always with U++, hacking into this should be easy...)
Re: Watching global variables in IDE debugger with MSC7-1 [message #288 is a reply to message #221] Wed, 07 December 2005 09:10 Go to previous messageGo to next message
gprentice is currently offline  gprentice
Messages: 260
Registered: November 2005
Location: New Zealand
Experienced Member


Can you give me a hint as to which of the dbghelp API functions was too slow and roughly whereabouts in the upp source this code would be if it weren't too slow. It'll take me a while to find my way around the upp debugging code.

Graeme
Re: Watching global variables in IDE debugger with MSC7-1 [message #289 is a reply to message #288] Wed, 07 December 2005 11:35 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
gprentice wrote on Wed, 07 December 2005 03:10



Can you give me a hint as to which of the dbghelp API functions was too slow and roughly whereabouts in the upp source this code would be if it weren't too slow. It'll take me a while to find my way around the upp debugging code.

Graeme



"ide" main package, "ide/Debuggers" package, file Debug.cpp, line 82 - there is excluded code to load global variables info.
Re: Watching global variables in IDE debugger with MSC7-1 [message #292 is a reply to message #289] Wed, 07 December 2005 12:58 Go to previous messageGo to next message
gprentice is currently offline  gprentice
Messages: 260
Registered: November 2005
Location: New Zealand
Experienced Member
Quote:


"ide" main package, "ide/Debuggers" package, file Debug.cpp, line 82 - there is excluded code to load global variables info.


Thanks. I tried enabling the code and running new ide but global symbols are still undefined - though I had actually already noticed the string returned to the EnumGlobals callback was saved in "test" and never looked at anywhere - but for some strange reason I decided to try it anyway !! - well, I see the "watch" is an array control but I have no clue how to hook up global symbols to it.

I might investigate some more, coz I might learn something useful, but I have one more question ... I don't see any usenet posters complaining of performance problems with SymEnumSymbols (any idea why not?) and I'm surprised MS wouldn't fix showstopping performance problems so I was wondering if you could explain what kind of performance problem e.g. is it 5 seconds, 50 seconds, 5 minutes ... to update the watch list - and is this with large .exe like theIDE ?

(Maybe dbghelp functions are mainly for crash dump analysis and not for people to write their own debuggers ??)

(That reminds me, I remember wxWidgets had some kind of crash dump analysis facilities for end users apps to use).

Graeme

[Updated on: Wed, 07 December 2005 12:59]

Report message to a moderator

Re: Watching global variables in IDE debugger with MSC7-1 [message #293 is a reply to message #292] Wed, 07 December 2005 13:03 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Well, that part is just left form the last time I have tried to resolve the issue - I was hoping that with the new version of dbghelp.dll, things should improve. So this is just a performance test - with result "Still slow".

To fully activate global variables, some more work in Sym.cpp and Exp.cpp would be needed...
Re: Watching global variables in IDE debugger with MSC7-1 [message #294 is a reply to message #293] Wed, 07 December 2005 13:16 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
I think I should explain where the problem really is: To display global variable, you have to find the global symbol address and type info. Now there is specific function in dbghelp.dll to do this, but it has nasty trait that when symbol is not found, it peforms very slowly (I do not know why, perhaps it is trying to find the symbol using other ways...).

Second option there is to load all global symbols and create database in the debugger. Once again, function is there, but is slow (5-10s if I remember well).

Maybe the solution would be to load global symbols on demand.... Ugly from user perspective, but maybe the best of bad solutions.
Re: Watching global variables in IDE debugger with MSC7-1 [message #327 is a reply to message #215] Thu, 08 December 2005 11:59 Go to previous messageGo to next message
gprentice is currently offline  gprentice
Messages: 260
Registered: November 2005
Location: New Zealand
Experienced Member


I took a chance that someone might know why dbghelp was slow, even though I didn't quite know what question to ask Smile

http://www.dotnetnewsgroups.com/newsgroupthread.asp?ID=22061 6

http://groups.google.com/group/microsoft.public.vsnet.debugg ing/browse_frm/thread/bf56c1c73498f390/7bd007429374d3ed?lnk= st&q=insubject%3Aaddress+insubject%3Aof+insubject%3Aglob al+insubject%3Asymbol&rnum=2&hl=en#7bd007429374d3ed

An answer from Oleg is below - don't know if it helps.

I really don't need this working, so don't spend any time on this on my account. (I tried MingW UPP installation on my work PC today and GDB crashed if I had a breakpoint, but still it was useful and must be the easiest way to start using GCC/MingW/GDB !)

Graeme



<quote from Oleg on microsoft.public.vsnet.debugging>

One situation when it can happen is when symbols for some modules are loaded
as deferred (SYMOPT_DEFERRED_LOADS option is set). Then an attempt
to search for nonexistent symbol will cause DbgHelp to actually load symbols for
all such modules (spending time on symbol search, potentially with symbol server access).
There are two workarounds:
1) Do not use SYMOPT_DEFERRED_LOADS option
2) Limit the search only to modules whose symbols are already loaded (it is done by
setting SYMOPT_NO_UNQUALIFIED_LOADS option)

Also, of course, the time spent searching for nonexistent symbol depends on the
number of modules to search.

Regards,
Oleg
[VC++ MVP]


Re: Watching global variables in IDE debugger with MSC7-1 [message #336 is a reply to message #327] Thu, 08 December 2005 14:02 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Thanks, something to check... At the moment, I am using just
SYMOPT_LOAD_LINES|SYMOPT_UNDNAME, but at least I have some hints now....
Re: Watching global variables in IDE debugger with MSC7-1 [message #364 is a reply to message #336] Thu, 08 December 2005 21:14 Go to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Well, I do not know what it is... but once again you have send me to the right direction. Flags you (or Oleg) suggest failed to improve situation, but then I have tried one flag after another and found that with SYMOPT_NO_PUBLICS search is fast (do not ask me why), but at the same moment local variables info stops working Smile

So the solution is to SetSymOptions with SYMOPT_NO_PUBLICS before retrieving global var info and once again without after it to get local variable info working. Seems like TheIDE is now able to display the value of global variables!

Thanks!
Previous Topic: ArrayCrl - compiling error
Next Topic: Arguments of MS C++ Toolkit
Goto Forum:
  


Current Time: Mon Apr 29 14:57:16 CEST 2024

Total time taken to generate the page: 0.03280 seconds