public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Andreas Arnez <arnez@linux.vnet.ibm.com>
To: Kevin Buettner <kevinb@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH 1/2] GDB test suite: Add helper for locating core files
Date: Wed, 11 Oct 2017 14:53:00 -0000	[thread overview]
Message-ID: <m3vajlg2jc.fsf@oc1027705133.ibm.com> (raw)
In-Reply-To: <20171011011733.19b3658c@pinnacle.lan> (Kevin Buettner's message	of "Wed, 11 Oct 2017 01:17:33 -0700")

On Wed, Oct 11 2017, Kevin Buettner wrote:

> On Mon, 09 Oct 2017 20:46:21 +0200
> Andreas Arnez <arnez@linux.vnet.ibm.com> wrote:
>
>> > Instead, several warnings are now printed instead:
>> >
>> >     WARNING: Can not generate core dump on remote target.  
>> 
>> These warnings are newly introduced by the patch.
>
> Yes, I saw that.
>
>> They are meant to
>> improve diagnostics when someone attempts to run the tests on a "real"
>> remote target.  I wanted to clearly document the fact that this is
>> unsupported (and always was).  Also, by documenting this restriction,
>> maybe someone feels encouraged to lift it ;-)
>
> In the distant past, I used to run the testsuite against resource
> constrained linux machines often of a different architecture from the
> host I was running the tests from.  These machines would run gdbserver
> built for that architecture.

OK, in that scenario, core file test cases would need to be roughly
executed in four steps:

(1) Build executable.
(2) Run executable on the remote machine.
(3) Transfer core dump to the local host.
(4) Start GDB on the local host.

AFAIK, steps (2) and (3) have not been implemented for the GDB test
suite so far.

> Now, I don't recall whether corefile support in the testsuite actually
> worked for those targets, but it at least seems possible due to the
> various invocations of remote_exec which are present (prior to your
> patch).

Fairly unlikely.  See, for instance, the beginning of corefile.exp:

  # are we on a target board
  if ![isnative] then {
      return
  }

A check like this appears in all core dump test cases.

Also note that the core_find command in gdb.exp uses expect's "system"
command for invoking the executable:

  catch "system \"(cd ${coredir}; ulimit -c unlimited; ${binfile} ${arg}; true) >/dev/null 2>&1\""

Which means that this command line will be executed on the local machine
and will fail in a remote setup.

But you're right that there were remote_exec invocations; mostly for
file handling such as:

  remote_exec build "mv $i $destcore"

  remote_exec build "mv $corefile $destcore"

  remote_exec build "rmdir $coredir"

TBH, I don't quite understand their intention.  In a native remote
setup, "build" is the remote machine.  Moving the core file around there
doesn't make it appear on the local machine.  And in a cross remote
setup, "build" is the local machine, whereas the core dump should be
generated on the remote machine.  So I think these commands only work if
host == build == target.  Since I found this too misleading, I replaced
them by local commands.

> Do you think you could restore those calls to remote_exec in your
> patch?  Or do you know for a fact that they do not work?

I'm pretty sure they don't.  Thus I wanted to document this restriction
more clearly.

--
Andreas

  reply	other threads:[~2017-10-11 14:53 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-18 18:42 [PATCH 0/2] GDB test suite: Support targets with systemd-coredump Andreas Arnez
2017-09-18 18:43 ` [PATCH 1/2] GDB test suite: Add helper for locating core files Andreas Arnez
2017-10-07 16:45   ` Kevin Buettner
2017-10-09 18:46     ` Andreas Arnez
2017-10-11  8:17       ` Kevin Buettner
2017-10-11 14:53         ` Andreas Arnez [this message]
2017-10-12 13:47       ` Pedro Alves
2017-10-12 16:48         ` Pedro Alves
2017-10-17  9:22           ` Pedro Alves
2017-10-12 17:00         ` Andreas Arnez
2017-10-13  9:28           ` Maciej W. Rozycki
2017-10-13 10:56             ` Andreas Arnez
2017-10-17 13:58               ` Maciej W. Rozycki
2017-10-17 10:06           ` Pedro Alves
2017-10-17 10:01       ` Pedro Alves
2017-10-17 18:21         ` Maciej W. Rozycki
2017-10-18 11:46           ` Pedro Alves
2017-09-18 18:44 ` [PATCH 2/2] GDB test suite: Get core files on targets with systemd-coredump Andreas Arnez
2017-10-17 10:22   ` Pedro Alves
2017-10-17 17:37     ` Andreas Arnez
2017-10-17 18:09       ` Pedro Alves
2017-10-17 18:14         ` Pedro Alves
2017-10-17 18:17           ` Pedro Alves
2017-10-18 15:56         ` Andreas Arnez
2017-10-19 10:48           ` Pedro Alves
2017-10-23 13:41             ` Andreas Arnez
2017-10-23 14:30               ` Pedro Alves

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=m3vajlg2jc.fsf@oc1027705133.ibm.com \
    --to=arnez@linux.vnet.ibm.com \
    --cc=gdb-patches@sourceware.org \
    --cc=kevinb@redhat.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).