Plugins : Memory Reads
Keith Seitz
keiths@redhat.com
Thu May 29 00:23:00 GMT 2003
On Wed, 2003-05-28 at 00:50, David Mc Kenna wrote:
> Hi Keith
>
> Thanks for the reply.
>
> >If the table is displaying non-contiguous regions of memory (or just a
> >byte here and a byte there), it seems that you ought to be able to
> >accomplish this by passing gdb_update_mem a private array. Then your
> >plugin code could grab the interesting bits and stuff them into the
> >table.
> >
> >So for the same table widget that the memory window uses, you would copy
> >the interesting bits into another data array that the widget uses. Since
> >the memory window only shows contiguous regions of memory, it has the
> >luxury of sharing one array across the call.
>
> So, in essence what you are saying is read the consecutive regions into several
> different arrays, and then merge them into one array that the table uses. I
> have tried this with the following code :
>
> set current_addr 0xfffff800
> set nb 8
>
> set retVal [catch {gdb_update_mem ${this}_memval2 $current_addr $format $size
> $nb $bytes_per_row} vals]
>
> set row 3
> set current_addr 0xfffff820
> set nb 0x20
>
> set retVal [catch {gdb_update_mem ${this}_memval3 $current_addr $format $size
> $nb $bytes_per_row} vals]
>
>
> This generates two arrays with the relevant data stored in them. My problem
> was merging the data back into ${this}_memval which is the widget that the table
> uses. I have tried all the standard methods such as , for example, :
>
> set ${this}_memval(0,0) ${this}_memval2(10,0)
>
> but this fails, this is probably a TCL/TK problem which , unfortunately, is
> not one of my strong points. Any ideas??
Hmm. Are you really doing the assignment above? I don't think that will
work: you will be assigning the variable name ${this}_memval2(10,0) to
${this}_memval(0,0). I don't think that's what you want.
When I get in this predicament, I usually do another "set":
set ${this}_memval(0,0) [set ${this}_memval2(10,0)]
I'm sure there are other ways, e.g. "upvar #0 ..."
If that fails, does the "set" command of the table work? (See the man
page in src/libgui/doc/tkTable.n.)
Keith
More information about the Insight
mailing list