From: Michael Rolnik <mrolnik@gmail.com>
To: qemu-devel@nongnu.org
Cc: Sarah Harris <S.E.Harris@kent.ac.uk>,
Michael Rolnik <mrolnik@gmail.com>,
rth@twiddle.net
Subject: [Qemu-devel] [PATCH RFC v20 3/8] target/avr: Add mechanism to check for active debugger connection
Date: Thu, 30 May 2019 22:07:33 +0300 [thread overview]
Message-ID: <20190530190738.22713-4-mrolnik@gmail.com> (raw)
In-Reply-To: <20190530190738.22713-1-mrolnik@gmail.com>
From: Sarah Harris <S.E.Harris@kent.ac.uk>
AVR CPUs have a BREAK instruction which behaves differently depending on whether debugging is enabled.
Since the hardware fuses that normally control this are difficult to emulate, and the BREAK instruction is useful for testing, the BREAK instruction is instead enabled/disabled depending on whether a GDB session is attached.
Signed-off-by: Sarah Harris <S.E.Harris@kent.ac.uk>
Signed-off-by: Michael Rolnik <mrolnik@gmail.com>
---
gdbstub.c | 5 +++++
include/exec/gdbstub.h | 4 ++++
2 files changed, 9 insertions(+)
diff --git a/gdbstub.c b/gdbstub.c
index 462f89edfe..94ee45798b 100644
--- a/gdbstub.c
+++ b/gdbstub.c
@@ -1793,6 +1793,11 @@ static int gdb_handle_packet(GDBState *s, const char *line_buf)
return RS_IDLE;
}
+bool gdb_is_active(void)
+{
+ return gdbserver_state != NULL;
+}
+
void gdb_set_stop_cpu(CPUState *cpu)
{
GDBProcess *p = gdb_get_cpu_process(gdbserver_state, cpu);
diff --git a/include/exec/gdbstub.h b/include/exec/gdbstub.h
index 08363969c1..d059bf5339 100644
--- a/include/exec/gdbstub.h
+++ b/include/exec/gdbstub.h
@@ -45,6 +45,10 @@ void gdb_do_syscall(gdb_syscall_complete_cb cb, const char *fmt, ...);
*/
void gdb_do_syscallv(gdb_syscall_complete_cb cb, const char *fmt, va_list va);
int use_gdb_syscalls(void);
+/**
+ * gdb_is_active: return true if debugging in progress
+ */
+bool gdb_is_active(void);
void gdb_set_stop_cpu(CPUState *cpu);
void gdb_exit(CPUArchState *, int);
#ifdef CONFIG_USER_ONLY
--
2.18.0
next prev parent reply other threads:[~2019-05-30 19:09 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-30 19:07 [Qemu-devel] [PATCH RFC v20 0/8] QEMU AVR 8 bit cores Michael Rolnik
2019-05-30 19:07 ` [Qemu-devel] [PATCH RFC v20 1/8] target/avr: Add outward facing interfaces and core CPU logic Michael Rolnik
2019-05-31 8:02 ` Igor Mammedov
2019-05-31 8:15 ` Michael Rolnik
2019-05-31 9:56 ` Igor Mammedov
2019-05-30 19:07 ` [Qemu-devel] [PATCH RFC v20 2/8] target/avr: Add instruction helpers Michael Rolnik
2019-05-31 13:50 ` Richard Henderson
2019-05-30 19:07 ` Michael Rolnik [this message]
2019-05-31 13:54 ` [Qemu-devel] [PATCH RFC v20 3/8] target/avr: Add mechanism to check for active debugger connection Richard Henderson
2019-06-01 21:12 ` Michael Rolnik
2019-06-03 15:44 ` Richard Henderson
2019-06-03 16:29 ` Michael Rolnik
2019-06-03 16:36 ` Richard Henderson
2019-06-03 17:04 ` Michael Rolnik
2019-06-05 7:20 ` Michael Rolnik
2019-06-05 14:36 ` Richard Henderson
2019-06-05 15:19 ` Michael Rolnik
2019-06-05 16:06 ` Richard Henderson
2019-06-05 16:10 ` Alex Bennée
2019-06-05 17:57 ` Michael Rolnik
2019-05-30 19:07 ` [Qemu-devel] [PATCH RFC v20 4/8] target-avr: Add instruction decoding Michael Rolnik
2019-05-31 14:45 ` Richard Henderson
2019-06-03 20:13 ` Michael Rolnik
2019-06-03 21:48 ` Richard Henderson
2019-05-30 19:07 ` [Qemu-devel] [PATCH RFC v20 5/8] target/avr: Add instruction translation Michael Rolnik
2019-05-31 15:31 ` Richard Henderson
2019-06-02 3:44 ` Michael Rolnik
2019-06-03 15:31 ` Richard Henderson
2019-06-03 15:34 ` Michael Rolnik
2019-05-30 19:07 ` [Qemu-devel] [PATCH RFC v20 6/8] target/avr: Add limited support for USART and 16 bit timer peripherals Michael Rolnik
2019-05-30 19:07 ` [Qemu-devel] [PATCH RFC v20 7/8] target/avr: Add example board configuration Michael Rolnik
2019-05-31 8:06 ` Igor Mammedov
2019-05-30 19:07 ` [Qemu-devel] [PATCH RFC v20 8/8] target/avr: Register AVR support with the rest of QEMU, the build system, and the MAINTAINERS file Michael Rolnik
2019-05-31 14:50 ` Eric Blake
2019-06-01 21:20 ` Michael Rolnik
2019-06-03 19:47 ` Eric Blake
2019-06-03 19:53 ` Michael Rolnik
2019-05-30 20:16 ` [Qemu-devel] [PATCH RFC v20 0/8] QEMU AVR 8 bit cores no-reply
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=20190530190738.22713-4-mrolnik@gmail.com \
--to=mrolnik@gmail.com \
--cc=S.E.Harris@kent.ac.uk \
--cc=qemu-devel@nongnu.org \
--cc=rth@twiddle.net \
/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 NNTP newsgroup(s).