Author Topic: Debugging QString  (Read 33322 times)

Offline LordCB

  • Multiple posting newcomer
  • *
  • Posts: 79
Re: Debugging QString
« Reply #15 on: September 16, 2009, 11:59:07 am »
@ jens:

Do you mean like this :
Code
source: X:\CODEBLOCKS\CB_DebuggerScripts\qstring.script

under Debugger initialization command

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Debugging QString
« Reply #16 on: September 16, 2009, 12:41:08 pm »
Yes, that is what he means :)
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline LordCB

  • Multiple posting newcomer
  • *
  • Posts: 79
Re: Debugging QString
« Reply #17 on: September 16, 2009, 04:08:30 pm »
Ok I have done it and now my question.

What changes?
What do I expect during debugging a QString or where I have to look at the content of the string, cause now I see nothing else than a adress to the string like 0x7c9291d5 this one

[attachment deleted by admin]
« Last Edit: September 16, 2009, 04:30:50 pm by LordCB »

Offline LordCB

  • Multiple posting newcomer
  • *
  • Posts: 79
Re: Debugging QString
« Reply #18 on: September 16, 2009, 04:35:55 pm »
This are my settings

[attachment deleted by admin]

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Debugging QString
« Reply #19 on: September 16, 2009, 04:45:09 pm »
Where you see "command:" type "printqstring strstr" and hit enter :)
Also you can add some logging commands to your Evaluate_QString and Parse_QString functions.
Unfortunately this is the only way to debug it...
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline LordCB

  • Multiple posting newcomer
  • *
  • Posts: 79
Re: Debugging QString
« Reply #20 on: September 16, 2009, 05:16:04 pm »
Thanks but I get an

Code

Undefined command: "printqstring".  Try "help".
Undefined command: "printqstring".  Try "help".

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Debugging QString
« Reply #21 on: September 16, 2009, 05:25:02 pm »
The source command has failed...
Try to execute it from the command field, try different paths. Spaces in the path may cause problems (just a suggestion)
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Debugging QString
« Reply #22 on: September 16, 2009, 05:59:30 pm »
if you really use "source:" as posted before, that's the cause.
No colon after the post (except for the one in the drive letter).

Offline LordCB

  • Multiple posting newcomer
  • *
  • Posts: 79
Re: Debugging QString
« Reply #23 on: September 16, 2009, 10:33:15 pm »
Ok,

now I get this.

Code
Attempt to extract a component of a value that is not a structure.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Debugging QString
« Reply #24 on: September 17, 2009, 10:03:31 am »
I think this's a gdb problem cause by the use of "source stl-views-1.0.3.script".
In the wxpropgrid_debugger branch I've implemented a workaround by calling "whatis &{watched_var}" instead of "whatis {watched_var}", when the plugin wants to understand the type of the watched variable.

The same problem happens when one tries to watch "const wxString &str"...
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline LordCB

  • Multiple posting newcomer
  • *
  • Posts: 79
Re: Debugging QString
« Reply #25 on: September 17, 2009, 10:13:20 am »
I really do not want to annoy you, but what does that mean now

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Debugging QString
« Reply #26 on: September 17, 2009, 10:25:30 am »
The only way to workaround the problem is to delete the stl-views-1.0.3.script file.
Or you could try the new wxpropgrid_debugger branch.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline LordCB

  • Multiple posting newcomer
  • *
  • Posts: 79
Re: Debugging QString
« Reply #27 on: September 17, 2009, 01:16:46 pm »
Ok, I have now a rudimentary. Using gdb 6.3 it works with gdb 6.8 not.
Observed for all who try it again  :)

one more thing I enable the option "Evaluate expression under cursor".

When I go over a qstring it popups a big popmenu with this content
Code
> output &strtrtr
(QString *) 0x22b78c>>>>>>cb_gdb:
> output strtrtr
{
  static null = {<No data fields>},
  static shared_null = {
    ref = {
      _q_value = 2148
    },
    alloc = 0,
    size = 0,
    data = 0x10203122,
    clean = 0,
    simpletext = 0,
    righttoleft = 0,
    asciiCache = 0,
    capacity = 0,
    reserved = 0,
    array = {0}
  },
  static shared_empty = {
    ref = {
      _q_value = 2
    },
    alloc = 0,
    size = 0,
    data = 0x10203136,
    clean = 0,
    simpletext = 0,
    righttoleft = 0,
    asciiCache = 0,
    capacity = 0,
    reserved = 0,
    array = {0}
  },
  d = 0x77e1da8,
  static codecForCStrings = 0x0
}>>>>>>cb_gdb:
down to the border of my screen.
Is it possible to make it scrollable or adjustable....

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Debugging QString
« Reply #28 on: September 17, 2009, 01:44:10 pm »
The scripts are not run for the "Evaluate expression under cursor"
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline LordCB

  • Multiple posting newcomer
  • *
  • Posts: 79
Re: Debugging QString
« Reply #29 on: September 17, 2009, 04:39:12 pm »
Ok but for int it is very nice. IsnĀ“t it?

What about scrollability from those tooltips