All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: Anthony Liguori <anthony@codemonkey.ws>,
	qemu-devel <qemu-devel@nongnu.org>,
	Fabien Chouteau <chouteau@adacore.com>
Subject: Re: [Qemu-devel] [PATCH 1/2][RESENT] Add GDB qAttached support
Date: Wed, 12 Mar 2014 08:37:16 +0100	[thread overview]
Message-ID: <53200EAC.2070504@siemens.com> (raw)
In-Reply-To: <51E65168.5080907@siemens.com>

On 2013-07-17 10:10, Jan Kiszka wrote:
> With this patch QEMU handles qAttached request from gdb. When QEMU
> replies 1, GDB sends a "detach" command at the end of a debugging
> session otherwise GDB sends "kill".
> 
> The default value for qAttached is 1 on system emulation and 0 on user
> emulation.
> 
> Based on original version by Fabien Chouteau.
> 
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> ---
>  gdbstub.c |   10 ++++++++++
>  1 files changed, 10 insertions(+), 0 deletions(-)
> 
> diff --git a/gdbstub.c b/gdbstub.c
> index 0ee82a9..bc626f5 100644
> --- a/gdbstub.c
> +++ b/gdbstub.c
> @@ -42,6 +42,12 @@
>  #include "sysemu/kvm.h"
>  #include "qemu/bitops.h"
>  
> +#ifdef CONFIG_USER_ONLY
> +#define GDB_ATTACHED "0"
> +#else
> +#define GDB_ATTACHED "1"
> +#endif
> +
>  #ifndef TARGET_CPU_MEMORY_RW_DEBUG
>  static inline int target_memory_rw_debug(CPUArchState *env, target_ulong addr,
>                                           uint8_t *buf, int len, int is_write)
> @@ -2504,6 +2510,10 @@ static int gdb_handle_packet(GDBState *s, const char *line_buf)
>              break;
>          }
>  #endif
> +        if (strncmp(p, "Attached", 8) == 0) {
> +            put_packet(s, GDB_ATTACHED);
> +            break;
> +        }
>          /* Unrecognised 'q' command.  */
>          goto unknown_command;
>  
> 

Peter, could you pick up these two almost trivial long-pending patches?
They still apply and are still useful. If you prefer that I repost them,
just let me know.

Thanks,
Jan

-- 
Siemens AG, Corporate Technology, CT RTC ITP SES-DE
Corporate Competence Center Embedded Linux

  parent reply	other threads:[~2014-03-12  7:37 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-17  8:10 [Qemu-devel] [PATCH 1/2][RESENT] Add GDB qAttached support Jan Kiszka
2013-07-17  8:11 ` [Qemu-devel] [PATCH 2/2][RESENT] Revert "gdbstub: Do not kill target in system emulation mode" Jan Kiszka
2013-07-26 18:26 ` [Qemu-devel] [PATCH v2 1/2] Add GDB qAttached support Jan Kiszka
2014-03-12 16:58   ` Andreas Färber
2014-03-12 17:31     ` Jan Kiszka
2014-03-12 17:50       ` Peter Maydell
2014-03-12  7:37 ` Jan Kiszka [this message]
2014-03-12 16:47   ` [Qemu-devel] [PATCH 1/2][RESENT] " Peter Maydell

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=53200EAC.2070504@siemens.com \
    --to=jan.kiszka@siemens.com \
    --cc=anthony@codemonkey.ws \
    --cc=chouteau@adacore.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.