Author Topic: Smarter debugger?  (Read 4412 times)

Offline Ceniza

  • Developer
  • Lives here!
  • *****
  • Posts: 1441
    • CenizaSOFT
Smarter debugger?
« on: May 28, 2008, 11:28:01 pm »
I just tried to debug something today and the debugger is acting strange. It seems to be a bit smarter by only trying to go to the first file that makes sense, and it even discards all frames that seem to point to a corrupted/unknown/whatever frame.

There seems to be an option to enable/disable that behavior: When stopping, auto-switch to first frame with valid source info. I disabled it, and it does nothing.

The debugger output goes like this:

Code
>>>>>>cb_gdb:
> bt 30
#0  ccp::ConstExprEvaluator<std::vector<ccp::Token<STDString, ccp::EmptyType>, std::allocator<ccp::Token<STDString, ccp::EmptyType> > > >::eval (tokens=@0x7fff4f53e910) at include/lexer/pp/constexprevaluator.h:247
#1  0x00000000004309bd in ccp::Preprocessor<ccp::PPLexer<ccp::Token<STDString, ccp::EmptyType>, STDMapStrLookupTable, IStreamDataFetcher<STDString> >, STDMapStrLookupTable, FStreamSourceProvider<STDString, STDStringFunctions> >::evalIfCondition (this=0x7fff4f53fe38) at include/lexer/pp/ifsection.h:105
#2  0x00000000004356ad in ccp::Preprocessor<ccp::PPLexer<ccp::Token<STDString, ccp::EmptyType>, STDMapStrLookupTable, IStreamDataFetcher<STDString> >, STDMapStrLookupTable, FStreamSourceProvider<STDString, STDStringFunctions> >::if_section<(ccp::directivesType)7> (this=0x7fff4f53fe38) at include/lexer/pp/ifsection.h:121
#3  0x00000000004395b2 in ccp::Preprocessor<ccp::PPLexer<ccp::Token<STDString, ccp::EmptyType>, STDMapStrLookupTable, IStreamDataFetcher<STDString> >, STDMapStrLookupTable, FStreamSourceProvider<STDString, STDStringFunctions> >::group_part<(ccp::Preprocessor<ccp::PPLexer<ccp::Token<STDString, ccp::EmptyType>, STDMapStrLookupTable, IStreamDataFetcher<STDString> >, STDMapStrLookupTable, FStreamSourceProvider<STDString, STDStringFunctions> >::eReturnDT)0> (this=0x7fff4f53fe38) at include/lexer/pp/grouppart.h:203
#4  0x000000000043c3f7 in ccp::Preprocessor<ccp::PPLexer<ccp::Token<STDString, ccp::EmptyType>, STDMapStrLookupTable, IStreamDataFetcher<STDString> >, STDMapStrLookupTable, FStreamSourceProvider<STDString, STDStringFunctions> >::nextToken (this=0x7fff4f53fe38) at include/lexer/preprocessor.h:124
#5  0x000000000043c4b7 in ccp::Lexer<ccp::Preprocessor<ccp::PPLexer<ccp::Token<STDString, ccp::EmptyType>, STDMapStrLookupTable, IStreamDataFetcher<STDString> >, STDMapStrLookupTable, FStreamSourceProvider<STDString, STDStringFunctions> >, STDMapStrLookupTable>::_nextToken (this=0x7fff4f53fe30) at include/lexer/lexer.h:146
#6  0x000000000043c4ef in ccp::Lexer<ccp::Preprocessor<ccp::PPLexer<ccp::Token<STDString, ccp::EmptyType>, STDMapStrLookupTable, IStreamDataFetcher<STDString> >, STDMapStrLookupTable, FStreamSourceProvider<STDString, STDStringFunctions> >, STDMapStrLookupTable>::nextToken (this=0x7fff4f53fe30) at include/lexer/lexer.h:108
#7  0x0000000000402748 in main (argc=2, argv=0x7fff4f5405f8) at /home/ceniza/Programming/C++/CCP/trunk/src/test/main.cpp:48
>>>>>>cb_gdb:

It looks to me like all of them are right, and the debugger should be able to jump to any of them. However, it starts by discarding frame #0, so I never know where the program actually is. That's not all, in the Call stack the only frames shown are: 1, 4, 5, 6 and 7. What happened to 0, 2 and 3?

I know the output looks evil, but that's not a reason for not being able to see at filename:linenumber at the end.

I'll take a look at it anyway...

Offline Ceniza

  • Developer
  • Lives here!
  • *****
  • Posts: 1441
    • CenizaSOFT
Re: Smarter debugger?
« Reply #1 on: May 29, 2008, 01:02:47 am »
I just checked it, and it was a problem caused by some regular expressions that didn't take into account such an evil output. I just committed the new regular expressions, but I'm getting now '(' as the address for frame #0. At least that's better than getting no frame #0 at all :wink: