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