public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* GDB - hardware server
@ 2021-04-29  5:59 Mahesh Bodapati
  2021-04-30 18:06 ` Simon Marchi
  0 siblings, 1 reply; 4+ messages in thread
From: Mahesh Bodapati @ 2021-04-29  5:59 UTC (permalink / raw)
  To: gdb

Hi,
we have 3 different target descriptions for the same target.

gdb has been built for all the 3 configurations but the 1st target
configuration is the default description. we are able to set configurations
from executable files but how to set the target descriptions from the
contents of the server.

tar remote host:port ,can I set the target description based on the
contents[like arch,register size..]  from the hardware server.I can only
see the comparison of what gdb is expecting and what gdb is getting from
the server. is there a way to change the gdb target descriptions from the
contents of server ?

Thanks for the help.

Mahesh B

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

* Re: GDB - hardware server
  2021-04-29  5:59 GDB - hardware server Mahesh Bodapati
@ 2021-04-30 18:06 ` Simon Marchi
  2021-05-03  6:19   ` Mahesh Bodapati
  0 siblings, 1 reply; 4+ messages in thread
From: Simon Marchi @ 2021-04-30 18:06 UTC (permalink / raw)
  To: Mahesh Bodapati, gdb

On 2021-04-29 1:59 a.m., Mahesh Bodapati via Gdb wrote:
> Hi,
> we have 3 different target descriptions for the same target.
> 
> gdb has been built for all the 3 configurations but the 1st target
> configuration is the default description. we are able to set configurations
> from executable files but how to set the target descriptions from the
> contents of the server.
> 
> tar remote host:port ,can I set the target description based on the
> contents[like arch,register size..]  from the hardware server.I can only
> see the comparison of what gdb is expecting and what gdb is getting from
> the server. is there a way to change the gdb target descriptions from the
> contents of server ?

I'm not sure I understand the problem correctly, but the server can send
the XML target description to GDB.

Simon

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

* Re: GDB - hardware server
  2021-04-30 18:06 ` Simon Marchi
@ 2021-05-03  6:19   ` Mahesh Bodapati
  2021-05-03 14:35     ` Simon Marchi
  0 siblings, 1 reply; 4+ messages in thread
From: Mahesh Bodapati @ 2021-05-03  6:19 UTC (permalink / raw)
  To: Simon Marchi; +Cc: gdb

Thank You.
It looks like I didn't frame my problem correctly.
server is sending the target descriptions but I have the problem when there
is a mismatch between the "expected number of bytes" and "got number of
bytes"
for instance,
gdb has been built for 32 bit abi by default then
case 1:
if server send 32 bit target description then we didn't see any error

case 2 :
if server send 64 bit target descriptions then it results an error saying
mismatch between  "expected number of bytes" and "got number of bytes"

and my question is "how can we support 2nd case ? "
can we switch the ABI when we receive 64 bit target description from server
? if yes, how can we do that?
or do we need to build a different gdb for 64 bit ABI?

Note : We can read the ABI from executable but here we are not giving
executable file to the gdb.

Thanks,
Mahesh B



On Fri, Apr 30, 2021 at 11:36 PM Simon Marchi <simon.marchi@polymtl.ca>
wrote:

> On 2021-04-29 1:59 a.m., Mahesh Bodapati via Gdb wrote:
> > Hi,
> > we have 3 different target descriptions for the same target.
> >
> > gdb has been built for all the 3 configurations but the 1st target
> > configuration is the default description. we are able to set
> configurations
> > from executable files but how to set the target descriptions from the
> > contents of the server.
> >
> > tar remote host:port ,can I set the target description based on the
> > contents[like arch,register size..]  from the hardware server.I can only
> > see the comparison of what gdb is expecting and what gdb is getting from
> > the server. is there a way to change the gdb target descriptions from the
> > contents of server ?
>
> I'm not sure I understand the problem correctly, but the server can send
> the XML target description to GDB.
>
> Simon
>

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

* Re: GDB - hardware server
  2021-05-03  6:19   ` Mahesh Bodapati
@ 2021-05-03 14:35     ` Simon Marchi
  0 siblings, 0 replies; 4+ messages in thread
From: Simon Marchi @ 2021-05-03 14:35 UTC (permalink / raw)
  To: Mahesh Bodapati; +Cc: gdb

On 2021-05-03 2:19 a.m., Mahesh Bodapati wrote:
> Thank You.
> It looks like I didn't frame my problem correctly.
> server is sending the target descriptions but I have the problem when there is a mismatch between the "expected number of bytes" and "got number of bytes"
> for instance,
> gdb has been built for 32 bit abi by default then 
> case 1:
> if server send 32 bit target description then we didn't see any error
> 
> case 2 :
> if server send 64 bit target descriptions then it results an error saying mismatch between  "expected number of bytes" and "got number of bytes"

Does this "wrong number of bytes" happens when parsing a g packet (read
registers packet)?  This is typically what I've seen.

When you return a target description, that describes all the registers
that are going to be included in the g packets.  So if GDB is saying
this, I would first verify that the registers you return in the g packet
really match what you are describing in the target description.

After connecting to your target, you could use some GDB commands to
determine what GDB expects the expected layout of the g register to be.
From memory, I think this is "maintenance print registers".  You can
also use "maintenance print xml-tdesc" to make GDB print in XML what it
thinks the target description for the current inferior is.

> and my question is "how can we support 2nd case ? "
> can we switch the ABI when we receive 64 bit target description from server ? if yes, how can we do that?
> or do we need to build a different gdb for 64 bit ABI?

No, in theory it's all supposed to work, as long as you've included the
support for all the architectures you're going to use in the GDB builds.
I didn't work a lot on target descriptions, so there may be some other
important details I'm not aware of.

Simon


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

end of thread, other threads:[~2021-05-03 14:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-29  5:59 GDB - hardware server Mahesh Bodapati
2021-04-30 18:06 ` Simon Marchi
2021-05-03  6:19   ` Mahesh Bodapati
2021-05-03 14:35     ` Simon Marchi

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).