public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Mark Wielaard <mark@klomp.org>
To: Andrew Burgess <aburgess@redhat.com>,
	ahajkova@sourceware.org,  gdb-patches@sourceware.org
Subject: Re: [PATCH v2]     remote.c: Allow inferior to reply with an error
Date: Wed, 18 Jan 2023 10:48:13 +0100	[thread overview]
Message-ID: <0676f6c1b4fe81ff3ff24ad8de030dda2a27b3eb.camel@klomp.org> (raw)
In-Reply-To: <87zgahdsyi.fsf@redhat.com>

Hi Andrew,

On Tue, 2023-01-17 at 16:30 +0000, Andrew Burgess wrote:
> 
> So, then I went to the docs again, and re-read what we say about
> QSetWorkingDir:
> 
>   This packet is used to inform the remote server of the intended
>   current working directory for programs that are going to be
> executed.
> 
> Note the use of the word 'intended'.  This packet does not try to
> change
> the directory NOW, it will try to change the directory LATER, when
> the
> inferior is actually executed.
> 
> My current reading of the docs is that the QSetWorkingDir packet, is
> either not supported, or should never fail.
> 
> If you specify an invalid directory then future attempts to start an
> inferior will fail, but the QSetWorkingDir packet itself shouldn't
> fail.

This is part of nicer integration of the valgrind gdbserver and gdb.
One of the issues we have been struggling with is making this more user
friendly. Although the reply to some packets, like vRun, can include an
error value ('Enn', An error occurred. The error number nn is given as
hex digits), gdb seems to not use the error number at all (and the
remote protocol doesn't seem to define meaning to the error numbers).

But a lot of different things can go wrong with vRun. But all gdb will
say is "Running on the remote target failed". So that is why we like
the different vRun "setup" packets that currently don't take an Error
return to explain to the user what exactly goes wrong.

So if you think things like QSetWorkingDir shouldn't return an error,
then how do we get what is going wrong when handling the vRun packet
back to the gdb user?

Thanks,

Mark

  reply	other threads:[~2023-01-18  9:48 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-13 11:59 
2023-01-13 13:16 ` Eli Zaretskii
2023-01-17 16:30 ` Andrew Burgess
2023-01-18  9:48   ` Mark Wielaard [this message]
2023-01-18 18:10     ` Andrew Burgess
2023-01-18 13:37   ` Alexandra Petlanova Hajkova
2023-01-18 18:19     ` Andrew Burgess

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=0676f6c1b4fe81ff3ff24ad8de030dda2a27b3eb.camel@klomp.org \
    --to=mark@klomp.org \
    --cc=aburgess@redhat.com \
    --cc=ahajkova@sourceware.org \
    --cc=gdb-patches@sourceware.org \
    /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).