Hi, when debugging a wx project(e.g. a wx project create by wxwidgets wizard in C::B), you can simply set a breakpoint in a event handler, for example:
void NumCheckFrame::OnAbout(wxCommandEvent& event)
{
wxString msg = wxbuildinfo(long_f); //Set a breakpoint here
wxMessageBox(msg, _("Welcome to..."));
}
When GDB hit the BP, you try to see the "event" value, but you get:
> p event
[debug]> p event
[debug]$1 = (wxCommandEvent &) @0x22fb34: <incomplete type>
[debug]>>>>>>cb_gdb:
$1 = (wxCommandEvent &) @0x22fb34: <incomplete type>
You see "incomplete type". This happens also when you type: "ptype wxCommandEvent".
I use GDB CVS head mingw build.
gcc 4.6.3 + wx2.8.12release build lib ----> have this issue
gcc 4.7.1 + wx2.8.12release build lib ----> have this issue
But if you link to wx2.8.12debug build lib, there is no such issue.
Do you have the same result under Linux?
Is it the expect behavior, I see a related post several years ago : Debug watches problem (Incomplete type) (http://forums.codeblocks.org/index.php/topic,4420.msg34957.html#msg34957)
Thanks.
Hi, Obf, thanks for the report from Linux.
I just check the exe file (link to release-wx-library) build by using "objdump -W xxx.exe >>a.txt", I found one entry:
<1><32811>: Abbrev Number: 130 (DW_TAG_class_type)
<32813> DW_AT_name : (indirect string, offset: 0xa54): wxCommandEvent
<32817> DW_AT_declaration : 1
<32818> DW_AT_sibling : <0x32865>
Look, there is no DW_AT_decl_file and DW_AT_decl_line information.
If I check the exe file link to a debug-wx-library, I see a similar entry DW_TAG_class_type about wxCommandEvent without any DW_AT_decl_file and DW_AT_decl_line info.
So, I believe the line and file info was saved in wxmsw28ud_gcc_custom.dll, which was 180M in my computer, running objdump -W on this dll file will produce a 1.6G text file (in-fact I stop this command by CTRL+C, because I think there is no text editor can read such big text file), anyway, as "ptype wxCommandEvent" works fine in this case, so the DW_AT_decl_file and DW_AT_decl_line of wxCommandEvent should in this big dll.
I'm not sure why GCC does not put the DW_AT_decl_file and DW_AT_decl_line of wxCommandEvent in the exe file, maybe, it just optimized the output size.... Maybe, its a GCC bug.
@ollydbg: is value of 'event' correctly displayed in watches window?
If the app link to a wx-release-library, and you does NOT use the "-femit-class-debug-always", then nothing will shown in the watch window.
See log:
[debug]> whatis event
[debug]type = wxCommandEvent &
[debug]>>>>>>cb_gdb:
[debug]> output event
[debug](wxCommandEvent &) @0x22fb34: <incomplete type>>>>>>>cb_gdb:
If not try to cast it to 'wxCommandEvent' (without reference).
It is already wxCommandEvent, right? See the log previous and also my first post.
Yes, but this is because there is too much data.
Can you try to contact the gdb devs to see what is their opinion?
The GDB devs already noticed this regression, so they have a bugzilla report: Bug 15412 – Performance regression in "info {func,var,types} foo" (mostly info types). (http://sourceware.org/bugzilla/show_bug.cgi?id=15412)