public inbox for insight@sourceware.org
 help / color / mirror / Atom feed
* Re: Plugins : Memory Reads
       [not found] <3ed46a5f.2d50.0@esatclear.ie>
@ 2003-05-29  0:23 ` Keith Seitz
  0 siblings, 0 replies; 3+ messages in thread
From: Keith Seitz @ 2003-05-29  0:23 UTC (permalink / raw)
  To: mckennad; +Cc: insight

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Plugins : Memory Reads
  2003-05-27 16:59 David Mc Kenna
@ 2003-05-27 17:25 ` Keith Seitz
  0 siblings, 0 replies; 3+ messages in thread
From: Keith Seitz @ 2003-05-27 17:25 UTC (permalink / raw)
  To: mckennad; +Cc: insight

On Tue, 2003-05-27 at 09:59, David Mc Kenna wrote:

> Unfortunately this reads information in table format and as such I cannot read
> several different non consecutive locations and place them in the same table
> to be displayed by Insight. Is there an alternate command/method available that
> can be used to read memory which can then be place into the table structure?

I'm afraid I don't understand your problem. You want to read several
non-consecutive memory addresses and stuff them into some sort of table
widget?

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.

Of course, it would be a lot better if we had a specific (and simpler)
call for a memory read for plugins. I'm sure there are other areas where
we could serve plugins better, too...

Keith


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Plugins : Memory Reads
@ 2003-05-27 16:59 David Mc Kenna
  2003-05-27 17:25 ` Keith Seitz
  0 siblings, 1 reply; 3+ messages in thread
From: David Mc Kenna @ 2003-05-27 16:59 UTC (permalink / raw)
  To: insight

Hi all,

In previous versions of Insight, before the new version of TCL/TK were merged
into the sources successfully, I was using the command: 

  set retVal [catch {gdb_get_mem $addr $format \
		       $size $nb $bytes_per_row $asc} vals]

to retrieve information from memory in non consecutive memory locations ( several
of these commands after which the data was placed in a table). Since Insight
has migrated to the newer version of TCL/TK this command has being depreciated.
The newer version of the command ( as used in memwin.itb ) is :

 set retVal [catch {gdb_update_mem ${this}_memval $current_addr $format $size
$nb $bytes_per_row} vals]

Unfortunately this reads information in table format and as such I cannot read
several different non consecutive locations and place them in the same table
to be displayed by Insight. Is there an alternate command/method available that
can be used to read memory which can then be place into the table structure?


Thanks,
Dave


--
http://www.iol.ie

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-05-29  0:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <3ed46a5f.2d50.0@esatclear.ie>
2003-05-29  0:23 ` Plugins : Memory Reads Keith Seitz
2003-05-27 16:59 David Mc Kenna
2003-05-27 17:25 ` Keith Seitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).