enhancements to wxStackFrame for Linux

Francesco Montorsi f18m_cpp217828 at yahoo.it
Wed Nov 1 06:15:54 PST 2006


Vaclav Slavik ha scritto:
> Hi,
> 
> Francesco Montorsi wrote:
>>   2) wxGUIAppTraitsBase::ShowAssertDialog uses wxMessageBox under
>> GTK2; unfortunately even with only 20 lines of stack trace the
>> resulting message box is too tall because all the stack trace lines
>> are wrapped.  2) wxGUIAppTraitsBase::ShowAssertDialog uses 
> wxMessageBox under GTK2; 
> 
> IMHO the best thing to do would be to use a (generic) wxAssertDialog 
> that would use wxCollapsiblePane and the stacktrace would be 
> initially hidden. For me, the most annoying thing about the 
> wxStackFrame performance is that when an assert happens, the app 
> completely freezes and it takes many seconds for something to happen. 
absolutely right. I forgot to say that I added a

#ifdef __UNIX__
     // usually it takes a while to walk the app's stack!
     // warn the user that we're doing that while he waits with the app 
hanged
     wxLogDebug(wxT("Generating stack trace"));
#endif

in GetAssertStackTrace() so that the user gets at least informed that 
the app is working.

Hopefully this won't be necessary once I get addr2line optimization running.


> In the meantime, you're given no indication that it's an assert 
> showing up. And when the assert finally shows, I usually don't need 
> the stack trace to fix it anyway.
> 
> So if the stack trace was initially hidden, a) the assert dialog would 
> show up instantly and b) wxStackFrame would be only used if the user 
> clicked on "Details". This alone would make the performance of 
> wxStackFrame much less critical.
right - I didn't think to it.
Even if wxStackFrame becomes fast* (hopefully will take only 1-2 
seconds), the wxCollapsiblePane usage may be a very good idea


> It would also have the benefit that we could use well-labeled buttons 
> like "Stop", "Ignore" and "Ignore All" in the assert dialog -- maybe 
> it's just me, but I still find the mapping of standard Yes/No/Cancel 
> buttons to Stop/Ignore/IgnoreAll actions very confusing, even after 
> seeing the dialog for years.
not only you, I always need to read the message to understand which 
button I want to hit :D

Francesco


[*] = I've just found that wxStackFrame is extremehely slow only when 
used against a statically linked wx app (which happens to be my 
favourite configuration - d'oh). That's almost surely because all the 
addr2line calls in that case are much faster since the app is about 500 
times smaller... this doesn't mean however that addr2line optimization 
should be avoid.





More information about the wx-dev mailing list