This is the mail archive of the
gdb-prs@sourceware.org
mailing list for the GDB project.
[Bug testsuite/13860] Fail in gdb.mi/mi-solib.exp in async mode
- From: "qiyao at gcc dot gnu.org" <sourceware-bugzilla at sourceware dot org>
- To: gdb-prs at sourceware dot org
- Date: Tue, 08 May 2012 14:15:17 +0000
- Subject: [Bug testsuite/13860] Fail in gdb.mi/mi-solib.exp in async mode
- Auto-submitted: auto-generated
- References: <bug-13860-4717@http.sourceware.org/bugzilla/>
http://sourceware.org/bugzilla/show_bug.cgi?id=13860
--- Comment #5 from Yao Qi <qiyao at gcc dot gnu.org> 2012-05-08 14:15:17 UTC ---
OK, I've drafted one patch, but not tested yet. Will start regression test for
it.
gdb:
2012-05-08 Yao Qi <yao@codesourcery.com>
Fix PR mi/13860.
* mi/mi-interp.c (mi_on_normal_stop): Print frame unconditionally.
---
gdb/mi/mi-interp.c | 28 +++++++++++++---------------
1 files changed, 13 insertions(+), 15 deletions(-)
diff --git a/gdb/mi/mi-interp.c b/gdb/mi/mi-interp.c
index daae480..1a2f266 100644
--- a/gdb/mi/mi-interp.c
+++ b/gdb/mi/mi-interp.c
@@ -438,26 +438,24 @@ mi_on_normal_stop (struct bpstats *bs, int print_frame)
if (print_frame)
{
int core;
+ struct target_waitstatus last;
+ ptid_t last_ptid;
+ struct ui_out *saved_uiout = NULL;
+ int current_uiout_is_not_mi = (current_uiout != mi_uiout);
- if (current_uiout != mi_uiout)
- {
- /* The normal_stop function has printed frame information
- into CLI uiout, or some other non-MI uiout. There's no
- way we can extract proper fields from random uiout
- object, so we print the frame again. In practice, this
- can only happen when running a CLI command in MI. */
- struct ui_out *saved_uiout = current_uiout;
- struct target_waitstatus last;
- ptid_t last_ptid;
+ get_last_target_status (&last_ptid, &last);
+ if (current_uiout_is_not_mi)
+ {
+ saved_uiout = current_uiout;
current_uiout = mi_uiout;
+ }
- get_last_target_status (&last_ptid, &last);
- bpstat_print (bs, last.kind);
+ bpstat_print (bs, last.kind);
+ print_stack_frame (get_selected_frame (NULL), 0, SRC_AND_LOC);
- print_stack_frame (get_selected_frame (NULL), 0, SRC_AND_LOC);
- current_uiout = saved_uiout;
- }
+ if (current_uiout_is_not_mi)
+ current_uiout = saved_uiout;
ui_out_field_int (mi_uiout, "thread-id",
pid_to_thread_id (inferior_ptid));
--
1.7.0.4
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.