qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH RFC v20 3/8] target/avr: Add mechanism to check for


From: Michael Rolnik
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

From: Sarah Harris <address@hidden>

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 <address@hidden>
Signed-off-by: Michael Rolnik <address@hidden>
---
 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]