Skip to contentSkip to conversation

gdbstub runstate check follow-ups

PATCH Applied Paolo Bonzini 4 participants 6 messages Jun 3, 2013 – Jun 10, 2013

lore
Share & tools
lore
#0 lore raw

cover gdbstub runstate check follow-ups

My patch committed at 87f25c12bfeaaa0c41fb857713bbc7e8a9b757dc was broken. These patches fix the problem in a better way.

Paolo

Paolo Bonzini (2):
gdbstub: fix for commit 87f25c12bfeaaa0c41fb857713bbc7e8a9b757dc
gdbstub: let the debugger resume from guest panicked state

 gdbstub.c | 5 ++++-
 vl.c      | 1 +
 2 files changed, 5 insertions(+), 1 deletion(-)
Signature · 1 line
1.8.1.4
#1 lore raw

PATCH 1/2 gdbstub: fix for commit 87f25c12bfeaaa0c41fb857713bbc7e8a9b757dc

This commit used the wrong check to prevent an assertion failure. After this commit, you need to start a guest in the monitor, you cannot use anymore the "c" command in the debugger. This is undesirable. The commit's aim was to prevent a restart after a KVM internal error or something like that; use runstate_needs_reset() for that.

---
 gdbstub.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
gdbstub.c +1 -1
index 90e54cb..e8541f3 100644
@@ -371,7 +371,7 @@ static inline void gdb_continue(GDBState *s)
 #ifdef CONFIG_USER_ONLY
     s->running_state = 1;
 #else
-    if (runstate_check(RUN_STATE_DEBUG)) {
+    if (!runstate_needs_reset()) {
         vm_start();
     }
 #endif
Signature · 1 line
1.8.1.4
#2 lore raw

PATCH 2/2 gdbstub: let the debugger resume from guest panicked state

In reply to Paolo Bonzini

While in general we forbid a "continue" from the guest panicked state, it makes sense to have an exception for that when continuing in the debugger. Perhaps the guest entered that state due to a bug, for example, and we want to continue no matter what.

---
 gdbstub.c | 3 +++
 vl.c      | 1 +
 2 files changed, 4 insertions(+)
gdbstub.c +3 -0
index e8541f3..94c78ce 100644
@@ -371,6 +371,9 @@ static inline void gdb_continue(GDBState *s)
 #ifdef CONFIG_USER_ONLY
     s->running_state = 1;
 #else
+    if (runstate_check(RUN_STATE_GUEST_PANICKED)) {
+        runstate_set(RUN_STATE_DEBUG);
+    }
     if (!runstate_needs_reset()) {
         vm_start();
     }
vl.c +1 -0
index 510d2c2..9fcf543 100644
@@ -610,6 +610,7 @@ static const RunStateTransition runstate_transitions_def[] = {
 
     { RUN_STATE_GUEST_PANICKED, RUN_STATE_PAUSED },
     { RUN_STATE_GUEST_PANICKED, RUN_STATE_FINISH_MIGRATE },
+    { RUN_STATE_GUEST_PANICKED, RUN_STATE_DEBUG },
 
     { RUN_STATE_MAX, RUN_STATE_MAX },
 };
Signature · 1 line
1.8.1.4
Tested-by on the v1 series
#4 lore raw
In reply to Paolo Bonzini

Am 03.06.2013 17:06, schrieb Paolo Bonzini:

Quoted 8 lines

My patch committed at 87f25c12bfeaaa0c41fb857713bbc7e8a9b757dc was broken. These patches fix the problem in a better way.

Paolo

Paolo Bonzini (2):
gdbstub: fix for commit 87f25c12bfeaaa0c41fb857713bbc7e8a9b757dc
gdbstub: let the debugger resume from guest panicked state

Andreas

Quoted 3 lines
 gdbstub.c | 5 ++++-
 vl.c      | 1 +
 2 files changed, 5 insertions(+), 1 deletion(-)
Signature · 2 lines
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg