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. Problems with dumping memory for bitmap image visualization with GDB

Problems with dumping memory for bitmap image visualization with GDB

Scheduled Pinned Locked Moved Qt Creator and other tools
1 Posts 1 Posters 936 Views 1 Watching
  • 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.
  • D Offline
    D Offline
    dtmoodie
    wrote on last edited by
    #1

    Hi I'm trying to do a memory dump of an OpenCV image so that I can use the built in image display functions, similar to what can be found here:
    http://blog.qt.digia.com/blog/2010/04/22/peek-and-poke-vol-3/

    I have a pointer to the data in the form of a uchar* that I can successfully deference one byte at a time.
    I can also increment the pointer and deference the next byte.
    However I've poured over all of the different versions of the QImage dumper qdump__QImage found in qttypes.py, and I haven't been able to successfully get a full memory dump.
    In one example, I found the the developer would cast the QImage "bits" pointer to an int pointer and then use a for loop to deference and increment the entire image. And in another example the developer uses d.readMemory to read a section of memory.
    I've tried casting the uchar* into an int* with the following:
    p = bits.cast(lookupType("unsigned char").pointer())
    The result is a "Not Accessible" error.

    When I try to use d.readMemory with the uchar* and the number of bytes to read, I get nothing.

    Now it's possible that it is correctly reading the memory, but it just isn't displaying it, but I've copied the syntax for the QImage dumper exactly, so I don't see why it wouldn't work. I even remembered to make my own qform__cv__Mat function.

    The contents of my visualizer can be found here:
    https://github.com/dtmoodie/GDB-ImageWatch/blob/master/qt-imageWatch/cvTypes.py

    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