All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 1/2][RESENT] Add GDB qAttached support
@ 2013-07-17  8:10 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
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Jan Kiszka @ 2013-07-17  8:10 UTC (permalink / raw)
  To: Anthony Liguori; +Cc: qemu-devel, Fabien Chouteau

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;
 
-- 
1.7.3.4

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

* [Qemu-devel] [PATCH 2/2][RESENT] Revert "gdbstub: Do not kill target in system emulation mode"
  2013-07-17  8:10 [Qemu-devel] [PATCH 1/2][RESENT] Add GDB qAttached support Jan Kiszka
@ 2013-07-17  8:11 ` Jan Kiszka
  2013-07-26 18:26 ` [Qemu-devel] [PATCH v2 1/2] Add GDB qAttached support Jan Kiszka
  2014-03-12  7:37 ` [Qemu-devel] [PATCH 1/2][RESENT] " Jan Kiszka
  2 siblings, 0 replies; 8+ messages in thread
From: Jan Kiszka @ 2013-07-17  8:11 UTC (permalink / raw)
  To: Anthony Liguori; +Cc: qemu-devel, Fabien Chouteau

The requirements described in this patch are implemented by "Add GDB
qAttached support".

This reverts commit 00e94dbc7fd0110b0555d59592b004333adfb4b8.

Signed-off-by: Fabien Chouteau <chouteau@adacore.com>
---
 gdbstub.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/gdbstub.c b/gdbstub.c
index bc626f5..8c632ab 100644
--- a/gdbstub.c
+++ b/gdbstub.c
@@ -2198,11 +2198,9 @@ static int gdb_handle_packet(GDBState *s, const char *line_buf)
             goto unknown_command;
         }
     case 'k':
-#ifdef CONFIG_USER_ONLY
         /* Kill the target */
         fprintf(stderr, "\nQEMU: Terminated via GDBstub\n");
         exit(0);
-#endif
     case 'D':
         /* Detach packet */
         gdb_breakpoint_remove_all();
-- 
1.7.3.4

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

* [Qemu-devel] [PATCH v2 1/2] Add GDB qAttached support
  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 ` Jan Kiszka
  2014-03-12 16:58   ` Andreas Färber
  2014-03-12  7:37 ` [Qemu-devel] [PATCH 1/2][RESENT] " Jan Kiszka
  2 siblings, 1 reply; 8+ messages in thread
From: Jan Kiszka @ 2013-07-26 18:26 UTC (permalink / raw)
  To: Anthony Liguori; +Cc: qemu-devel, Fabien Chouteau

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

v2: Rebase over master

 gdbstub.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/gdbstub.c b/gdbstub.c
index 35ca7c2..4a6cc51 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
+
 static inline int target_memory_rw_debug(CPUState *cpu, target_ulong addr,
                                          uint8_t *buf, int len, bool is_write)
 {
@@ -2489,6 +2495,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;
 
-- 
1.7.3.4

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

* Re: [Qemu-devel] [PATCH 1/2][RESENT] Add GDB qAttached support
  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  7:37 ` Jan Kiszka
  2014-03-12 16:47   ` Peter Maydell
  2 siblings, 1 reply; 8+ messages in thread
From: Jan Kiszka @ 2014-03-12  7:37 UTC (permalink / raw)
  To: Peter Maydell; +Cc: Anthony Liguori, qemu-devel, Fabien Chouteau

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

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

* Re: [Qemu-devel] [PATCH 1/2][RESENT] Add GDB qAttached support
  2014-03-12  7:37 ` [Qemu-devel] [PATCH 1/2][RESENT] " Jan Kiszka
@ 2014-03-12 16:47   ` Peter Maydell
  0 siblings, 0 replies; 8+ messages in thread
From: Peter Maydell @ 2014-03-12 16:47 UTC (permalink / raw)
  To: Jan Kiszka; +Cc: Anthony Liguori, qemu-devel, Fabien Chouteau

On 12 March 2014 07:37, Jan Kiszka <jan.kiszka@siemens.com> wrote:
> 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.

I don't really want to apply more patches directly than I absolutely
have to, because it basically obliges me to do a full review and
functionality test of those patches...

thanks
-- PMM

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

* Re: [Qemu-devel] [PATCH v2 1/2] Add GDB qAttached support
  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
  0 siblings, 1 reply; 8+ messages in thread
From: Andreas Färber @ 2014-03-12 16:58 UTC (permalink / raw)
  To: Jan Kiszka; +Cc: Peter Maydell, Anthony Liguori, qemu-devel, Fabien Chouteau

Am 26.07.2013 20:26, schrieb Jan Kiszka:
> With this patch QEMU handles qAttached request from gdb. When QEMU

"With this patch" is always weird to read in Git history, also a
"gdbstub: " prefix would've been nice for consistency.

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

If this is based on code by Fabien, shouldn't it carry his Signed-off-by
before yours?

Since "GDB stub" is in "Odd Fixes" state, maybe just step up as
maintainer and send a pull like for SLIRP? :)

Cheers,
Andreas

> 
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> ---
> 
> v2: Rebase over master
> 
>  gdbstub.c |   10 ++++++++++
>  1 files changed, 10 insertions(+), 0 deletions(-)
> 
> diff --git a/gdbstub.c b/gdbstub.c
> index 35ca7c2..4a6cc51 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
> +
>  static inline int target_memory_rw_debug(CPUState *cpu, target_ulong addr,
>                                           uint8_t *buf, int len, bool is_write)
>  {
> @@ -2489,6 +2495,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;
>  
> 


-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg

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

* Re: [Qemu-devel] [PATCH v2 1/2] Add GDB qAttached support
  2014-03-12 16:58   ` Andreas Färber
@ 2014-03-12 17:31     ` Jan Kiszka
  2014-03-12 17:50       ` Peter Maydell
  0 siblings, 1 reply; 8+ messages in thread
From: Jan Kiszka @ 2014-03-12 17:31 UTC (permalink / raw)
  To: Andreas Färber
  Cc: Peter Maydell, Anthony Liguori, qemu-devel, Fabien Chouteau

On 2014-03-12 17:58, Andreas Färber wrote:
> Am 26.07.2013 20:26, schrieb Jan Kiszka:
>> With this patch QEMU handles qAttached request from gdb. When QEMU
> 
> "With this patch" is always weird to read in Git history, also a
> "gdbstub: " prefix would've been nice for consistency.

Yes, will rephrase this.

> 
>> 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.
> 
> If this is based on code by Fabien, shouldn't it carry his Signed-off-by
> before yours?

Need to check how similar our versions actually are, if I can reuse his
signed-off or if I changed it (in that case it's not appropriate to keep
the original signed-off - according to my understanding).

> 
> Since "GDB stub" is in "Odd Fixes" state, maybe just step up as
> maintainer and send a pull like for SLIRP? :)

Oh, I can surely send a pull, but I can't handle another maintainership
properly. Slirp already became a stepchild...

Thanks for looking into this.

Jan

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

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

* Re: [Qemu-devel] [PATCH v2 1/2] Add GDB qAttached support
  2014-03-12 17:31     ` Jan Kiszka
@ 2014-03-12 17:50       ` Peter Maydell
  0 siblings, 0 replies; 8+ messages in thread
From: Peter Maydell @ 2014-03-12 17:50 UTC (permalink / raw)
  To: Jan Kiszka
  Cc: Anthony Liguori, Andreas Färber, Fabien Chouteau, qemu-devel

On 12 March 2014 17:31, Jan Kiszka <jan.kiszka@siemens.com> wrote:
> On 2014-03-12 17:58, Andreas Färber wrote:
>> Am 26.07.2013 20:26, schrieb Jan Kiszka:
>>> Based on original version by Fabien Chouteau.
>>
>> If this is based on code by Fabien, shouldn't it carry his Signed-off-by
>> before yours?
>
> Need to check how similar our versions actually are, if I can reuse his
> signed-off or if I changed it (in that case it's not appropriate to keep
> the original signed-off - according to my understanding).

If there's still some of Fabien's code in there then as I understand it
the usual approach is to retain his authorship and Signed-off-by:,
and then follow that with "[you: summary of your changes]" and then
your signed-off-by. See for instance commit f19e00d77 where I
did a fair amount of rework on a patch originally submitted by Alex.

If you have significantly or totally rewritten the code then you can give
the patch your own author and signed-off-by, and acknowledge that
somebody else found the problem or suggested the general
approach for a fix with a Reported-by: or Suggested-by: tag.

Where exactly the line between the two lies is a judgement call.

This is really about making sure we give credit where due (and
conversely that we don't silently attribute later changes to an
original author who might not agree with them). (The legal audit
trail aspect is satisfied even without the original author's signoff
provided that original work was under a suitable license; this is
for instance how signoffs work for big chunks of other-project
code we import like the binutils disassemblers, libvixl, etc.)

thanks
-- PMM

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

end of thread, other threads:[~2014-03-12 17:51 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 ` [Qemu-devel] [PATCH 1/2][RESENT] " Jan Kiszka
2014-03-12 16:47   ` Peter Maydell

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.