User forums > Help

Can't see value of unicode strings while debugging

<< < (2/4) > >>

Biplab:
I hope you mean the following.



It works fine with me though I do get that "Kernel event for..." message. :)

eranif:

--- Quote ---I don't know why, but when I try to watch

str.ToAscii()

I get an error message

gdb: Kernel event for pid=XXXX tid=YYYY code=EXCEPTION_DEBUG_EVENT

does someone knows why?
--- End quote ---

this is not an error message, these are messages that the debugger displays when setting the debugevent to on.
I guess that the debugger plugin uses this event to capture some information about the debugee process (debugee process ID maybe?)

Anyway, passing the following to the debugger, will make him shutup:

--- Code: ---set debugevent off
--- End code ---

Eran

Denis:
However, is there fast solution to see value of unicode string?

marlo_nl:
I've encountered the same issue during (gdb) debugging of a wxSmith Dialog Based application within my CodeBlocks environment:
The debugger does not show contents of wxString variables.

Just to make sure that this was not related to an “old” version of CodeBlocks (snv 4237) I’ve updated my CodeBlocks environment to a more recent nightly build (snv 4564),  however the issue remains.

I've been searching the internet for half a day, but I did find a clear answer to the question if the gdb debugger within CodeBlocks is able to show wxString contents or not.

From reading threads I learned that the CodeBlocks script file "gdb_types.script" should make the (gdb) debugger aware of wxString variables.
When starting a debug session I can see that wxString is registered as new type by looking to the “Debugger Messages” window:

  Starting debugger: done
  Registered new type: wxString
  Registered new type: STL String
  Registered new type: STL Vector
  Setting breakpoints
  Debugger name and version: GNU gdb 6.3

However, if I move the mouse cursor over a wxString variable (evaluate expression under cursor), the debugger messages window tells “Cannot evaluate function -- may be inlined” and the popup window will show:
  Symbol :  <varname> (wxString)
  Address:  0x…….
  “”
If I add a wxString variable to the “Watch” Window the debugger messages window also tells “Cannot evaluate function -- may be inlined” and the Watch Window will show:
  <varname> = “”


To repeat I question I’ve seen appear in a number of threads on the internet:

- Is it possible to see the contents of wxString variables in gdb debug sessions within CodeBlocks?


If the answer is to this question is yes, are there specific boundary conditions that need to be met? For example:
- is the wxWidgets library used relevant (I’m currently using a static debug library: libwxmsw28ud.a)?
- is the project type relevant (I’m currently using a wxSmith Dialog Based project)?


Regards, Marlo

mandrav:

--- Quote from: marlo on November 04, 2007, 12:33:05 pm ---- is the wxWidgets library used relevant (I’m currently using a static debug library: libwxmsw28ud.a)?

--- End quote ---

Yes. The linker strips code you never use from static libraries. In this case, wxString::c_str() is needed which you obviously don't use directly in your code (and so is being stripped off the resulting binary).
Evaluating wxStrings works fine with dll-based wx configurations because the aforementioned stripping does not take place.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version