Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. How to create a debugging helper for struct that has a char*
QtWS25 Last Chance

How to create a debugging helper for struct that has a char*

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
1 Posts 1 Posters 300 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    skycrestway
    wrote on last edited by
    #1

    I am trying to create a QtCreator debugging helper for a structure.

    struct B {
    int i1;
    char* c1;
    };

    B b;
    b.i1 = 11;
    b.c1 = "def";
    

    I have created the following to report both structure fields on a single line.

    def qdump__B(d, value):
    t = '%d %s' % (value["i1"], value["c1"])
    d.putValue(t)

    However, I don't get what I want for output. I want:

    11 def

    I get:

    11 Value(name='c1',type=char*,bsize=64,bpos=None,data=,address=0x7fffffffcdc8)

    How do you format a char* for the above problem?

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved