This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug gdb/20487] Thread sync broken between mi and cli with new-ui command


https://sourceware.org/bugzilla/show_bug.cgi?id=20487

--- Comment #9 from Pedro Alves <palves at redhat dot com> ---
I see.  From a quick skim (reading patches in bugzilla sucks), I think the
observer notification calls would be much clearer if you replace the two
boolean arguments with an enum or enum flags (common/enum-flags.h).


+  if (ptid_equal (inferior_ptid, null_ptid))
+    return;
+  else
+    tp = inferior_thread ();
+
+  /* The thread is mandatory.  */
+  if (tp == NULL)
+    return;

this is redundant, because inferior_thread never returns NULL.

I'd drop the else:

  if (ptid_equal (inferior_ptid, null_ptid))
    return;

  tp = inferior_thread ();


+      current_ui->prompt_state = PROMPT_NEEDED;
+      display_gdb_prompt (NULL);
+    }

Doesn't look like these work correctly when the UI was in sync mode?
E.g.,:

 - Do "continue" in the console.  Since that was a sync command, the console
doesn't prompt until the target stops.
 - Select another thread in the MI UI.
 - We display the prompt in the console?  (and input is disabled..)

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]