public inbox for insight@sourceware.org
 help / color / mirror / Atom feed
* showing the gdb commands executed by insight ?
@ 2005-01-14 16:40 Jim Sullivan
  2005-01-14 17:12 ` Keith Seitz
  0 siblings, 1 reply; 4+ messages in thread
From: Jim Sullivan @ 2005-01-14 16:40 UTC (permalink / raw)
  To: insight


If I run insight and give it a symbol file 
I can disassemble the code and it works correctly. 

If I run with straight gdb I can not get it to work. 
(i.e. it shows code but it does not look correct.)

Is there a way to run insight such that the 
gdb commands that are executed are displayed ? 
This would allow me to see the sequence of commands
I need to use with GDB to get this to work.



thanks Jim

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

* Re: showing the gdb commands executed by insight ?
  2005-01-14 16:40 showing the gdb commands executed by insight ? Jim Sullivan
@ 2005-01-14 17:12 ` Keith Seitz
  2005-01-14 19:56   ` Jim Sullivan
  0 siblings, 1 reply; 4+ messages in thread
From: Keith Seitz @ 2005-01-14 17:12 UTC (permalink / raw)
  To: Jim Sullivan; +Cc: insight

On Fri, 2005-01-14 at 08:39, Jim Sullivan wrote:
> If I run insight and give it a symbol file 
> I can disassemble the code and it works correctly. 

Sometimes.

> If I run with straight gdb I can not get it to work. 
> (i.e. it shows code but it does not look correct.)

If you post your procedure, target, host, etc, I might be able to help.

> Is there a way to run insight such that the 
> gdb commands that are executed are displayed ? 
> This would allow me to see the sequence of commands
> I need to use with GDB to get this to work.

The majority of insight does not work that way. Unlike DDD, eclipse and
other separate-process debuggers built with gdb, Insight *is* gdb: they
are the same process. Many insight functions (including all the
disassembly) make gdb pseudo-API calls.

If you're using a remote target, I'll bet it appears to work because
insight always disassembles from the image file (as I recall). Gdb, on
the other hand, will disassemble from memory, so if you haven't loaded
an image onto your target, you're going to get gibberish.

You should be able to get gdb to behave similarly by using:
(gdb) help set trust-readonly-sections
Set mode for reading from readonly sections.
When this mode is on, memory reads from readonly sections (such as
.text)
will be read from the object file instead of from the target.  This will
result in significant performance improvement for remote targets.

Keith

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

* Re: showing the gdb commands executed by insight ?
  2005-01-14 17:12 ` Keith Seitz
@ 2005-01-14 19:56   ` Jim Sullivan
  2005-01-14 20:09     ` Keith Seitz
  0 siblings, 1 reply; 4+ messages in thread
From: Jim Sullivan @ 2005-01-14 19:56 UTC (permalink / raw)
  To: Keith Seitz; +Cc: insight

Hi Keith, 

Here is an overview of my environment and the problem I am trying
to solve. 

I am using a remote target. 
For debugging I typically 
1. startup insight with the symbol file in the same directory. 
2. set the target setting to remote serial, or remote tcp ...etc.   
3. connect to the target 
 
All this works great. 
I can also disassem code after step 1 above, which implies
that I do not have to be connected to the target to read 
the code. I would guess that insight looks at the symbol  
file, and object file to dump this information. 

Now if I wanted to do the same thing using GDB. 
I.e. disassem the code without connecting to the target
I would think that I need only provide a symbol file
and the location of the source, however your previous
response implies it is more involved that this. 

more comments below.  


On Fri, 2005-01-14 at 12:11, Keith Seitz wrote:
> On Fri, 2005-01-14 at 08:39, Jim Sullivan wrote:
> > If I run insight and give it a symbol file 
> > I can disassemble the code and it works correctly. 
> 
> Sometimes.

Can you explain ? 

> If you're using a remote target, I'll bet it appears to work because
> insight always disassembles from the image file (as I recall). Gdb, on
> the other hand, will disassemble from memory, so if you haven't loaded
> an image onto your target, you're going to get gibberish.

This would seem to explain it, but using 
set trust-readonly-sections did not solve the problem. 

thanks, Jim







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

* Re: showing the gdb commands executed by insight ?
  2005-01-14 19:56   ` Jim Sullivan
@ 2005-01-14 20:09     ` Keith Seitz
  0 siblings, 0 replies; 4+ messages in thread
From: Keith Seitz @ 2005-01-14 20:09 UTC (permalink / raw)
  To: Jim Sullivan; +Cc: insight

 On Fri, 2005-01-14 at 11:56, Jim Sullivan wrote:
> 1. startup insight with the symbol file in the same directory. 

You can disassemble here with either gdb or insight: both will
disassemble from your image file.

> 2. set the target setting to remote serial, or remote tcp ...etc.   
> 3. connect to the target 

As soon as you connect to the target, gdb will disassemble from memory.
To force it to disassemble from the file (as insight does), set
trust-readonly-sections. [I think: it has been quite some time since I
used a remote w/gdb or insight.]
 
> I can also disassem code after step 1 above, which implies
> that I do not have to be connected to the target to read 
> the code. I would guess that insight looks at the symbol  
> file, and object file to dump this information. 

Right.

> Now if I wanted to do the same thing using GDB. 
> I.e. disassem the code without connecting to the target
> I would think that I need only provide a symbol file
> and the location of the source, however your previous
> response implies it is more involved that this. 

I would have thought that just setting "trust-readonly-sections" would
do it, but I am mistaken. Something else is amiss. You should send a
sessions transcript to the gdb folks. They'll be able to help you much
more quickly and authoritatively than I can.

> > Sometimes.
> 
> Can you explain ? 

For a few commands, insight does use vanilla gdb commands, just as if it
were typed by a user. However, the majority of insight functionality,
particularly source file handling, disassembly, and memory/stack
frame/variable inspection all use APIs (as far as they exist). There is
no human typable command behind those calls. 

> This would seem to explain it, but using 
> set trust-readonly-sections did not solve the problem. 

Again, you're best bet now is to contact the experts.

Keith

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

end of thread, other threads:[~2005-01-14 20:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-01-14 16:40 showing the gdb commands executed by insight ? Jim Sullivan
2005-01-14 17:12 ` Keith Seitz
2005-01-14 19:56   ` Jim Sullivan
2005-01-14 20:09     ` 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).