Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Simon Marchi <simon.marchi@ericsson.com>
To: Thomas Preudhomme <thomas.preudhomme@foss.arm.com>,
	Sergio Durigan Junior	<sergiodj@redhat.com>
Cc: GDB Patches <gdb-patches@sourceware.org>
Subject: Re: [PATCH v5] Implement the ability to set/unset environment variables to GDBserver when starting the inferior
Date: Tue, 05 Sep 2017 18:41:00 -0000	[thread overview]
Message-ID: <526a7ca9-6562-91d7-1c7a-d8d692967395@ericsson.com> (raw)
In-Reply-To: <9a49351b-97ec-663b-3464-f7798117df05@foss.arm.com>

On 2017-09-05 07:09 PM, Thomas Preudhomme wrote:
> Hi Simon,
>
> Sorry if I wasn't clear. I actually meant that this test *should* be relevant
> for cross-debugger using native gdbserver but it is currently skipped in that
> case (because the test only checks if that gdb uses a stub).

The native in native-gdbserver (as in --target_board=native-gdbserver) means
that we are testing against a gdbserver compiled for the same architecture as
the build machine.  Moreover, that board happens to spawn gdbserver locally, on
the same machine that runs the testsuite.  It's easy to build & test this
configuration, since you can do everything on the same machine.  If you build a
cross-debugger, it means that the architecture where gdb runs is different from
the architecture gdbserver runs and debug.  It kind of doesn't make sense to
use the native-gdbserver board when testing a cross debugger, since it would
imply that gdb and gdbserver run the same architecture, but then it's not a
cross-debugger...

You can (and maybe you already do) write your own board file in order to test a
cross-debugger. [1]

The reason why native-gdbserver is not relevant in that case is that it uses
the "remote" protocol, as opposed to the "extended-remote" protocol as used by
the native-extended-gdbserver board.  A difference between the two is that only
in extended-remote can you spawn/run new processes.  And setting the
environment variables in GDB with "set environment" only affects processes
created by gdb (and now gdbserver).  This is why it doesn't make sense to run
the test with native-gdbserver (or anything that uses the non-extended "remote"
protocol).

> Did I misunderstand the meaning of gdb stub?

The way I understand it is that a "gdb stub" is a debugging interface that
talks the non-extended remote protocol and is embedded in whatever you try to
debug [2].  Therefore, there's no notion of starting a new process.  When you
connect to it, the thing already exists.  And if it exits, the remote
connection dies with it, since you don't have anybody to talk to anymore.  So
with a GDB stub, you would always talk the remote protocol, not
extended-remote.  In the testsuite, "use_gdb_stub" is pretty much equivalent to
the "remote" protocol.  When using the native-extended-remote board file, you
are not using the extended-remote protocol, and can create new processes, and
therefore it's !use_gdb_stub.

Hopefully that help clear things up.

[1] https://sourceware.org/gdb/wiki/TestingGDB#Testing_gdbserver_in_a_remote_cross-target_configuration
[2] Of course, gdbserver is not embedded in what you try to debug, but it's
    the same result, it has the same lifetime.


  reply	other threads:[~2017-09-05 18:41 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-29 19:41 [PATCH] Implement the ability to transmit " Sergio Durigan Junior
2017-07-10 21:32 ` Sergio Durigan Junior
2017-07-13 21:47 ` Simon Marchi
2017-07-14 17:34   ` Sergio Durigan Junior
2017-07-27  3:36 ` [PATCH v2] Implement the ability to set/unset " Sergio Durigan Junior
2017-07-27 17:10   ` Eli Zaretskii
2017-07-27 22:05   ` Simon Marchi
2017-08-01  2:33     ` Sergio Durigan Junior
2017-08-01  9:35       ` Simon Marchi
2017-08-04 22:56         ` Sergio Durigan Junior
2017-07-29 22:36   ` Simon Marchi
2017-08-01  2:43     ` Sergio Durigan Junior
2017-08-01  9:54       ` Simon Marchi
2017-08-04 23:03         ` Sergio Durigan Junior
2017-08-05 18:14           ` Simon Marchi
2017-08-12  4:34             ` Sergio Durigan Junior
2017-08-12  8:11               ` Simon Marchi
     [not found]   ` <256083325d9f9c4cc4f5518fe6e5292d@polymtl.ca>
2017-08-12  4:19     ` Sergio Durigan Junior
2017-08-13  6:19 ` [PATCH v3] " Sergio Durigan Junior
2017-08-21 19:11   ` Sergio Durigan Junior
2017-08-24 19:25   ` Simon Marchi
2017-08-28 21:25     ` Sergio Durigan Junior
2017-08-28 23:13 ` [PATCH v4] " Sergio Durigan Junior
2017-08-31 19:37   ` Simon Marchi
2017-08-31 20:34     ` Sergio Durigan Junior
2017-08-31 20:39       ` Simon Marchi
2017-08-31 20:49 ` [PATCH v5] " Sergio Durigan Junior
2017-08-31 21:03   ` Simon Marchi
2017-08-31 21:26     ` Sergio Durigan Junior
2017-09-05 15:33       ` Thomas Preudhomme
2017-09-05 16:26         ` Simon Marchi
2017-09-05 17:09           ` Thomas Preudhomme
2017-09-05 18:41             ` Simon Marchi [this message]
2017-09-06  8:36               ` Thomas Preudhomme
2017-09-01  6:19   ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=526a7ca9-6562-91d7-1c7a-d8d692967395@ericsson.com \
    --to=simon.marchi@ericsson.com \
    --cc=gdb-patches@sourceware.org \
    --cc=sergiodj@redhat.com \
    --cc=thomas.preudhomme@foss.arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox