public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Fix PR 15693 - Extra *running event when call-style dprintf hits
@ 2013-07-08  8:19 Hui Zhu
  2013-07-29 19:24 ` Tom Tromey
  0 siblings, 1 reply; 6+ messages in thread
From: Hui Zhu @ 2013-07-08  8:19 UTC (permalink / raw)
  To: gdb-patches ml; +Cc: Marc Khouzam, Pedro Alves

[-- Attachment #1: Type: text/plain, Size: 505 bytes --]

Hi,

After I see the comments of this PR and check the code running, I
found that after run_inferior_call call the function, it change the
call_thread->state.
Then set_running will call observer_notify_target_resumed make GDB
output a lot of *running,thread-id="1".
So I make a patch to save call_thread->state and set it back in
run_inferior_call.

Thanks,
Hui

2013-07-08  Hui Zhu  <hui@codesourcery.com>

	PR gdb/15693
	infcall.c (run_inferior_call): Save value of call_thread->state
	and set it back.

[-- Attachment #2: fix-15693.txt --]
[-- Type: text/plain, Size: 618 bytes --]

--- a/gdb/infcall.c
+++ b/gdb/infcall.c
@@ -385,6 +385,7 @@ run_inferior_call (struct thread_info *c
 {
   volatile struct gdb_exception e;
   int saved_in_infcall = call_thread->control.in_infcall;
+  int saved_state = call_thread->state;
   ptid_t call_thread_ptid = call_thread->ptid;
 
   call_thread->control.in_infcall = 1;
@@ -428,7 +429,10 @@ run_inferior_call (struct thread_info *c
     }
 
   if (call_thread != NULL)
-    call_thread->control.in_infcall = saved_in_infcall;
+    {
+      call_thread->control.in_infcall = saved_in_infcall;
+      call_thread->state = saved_state;
+    }
 
   return e;
 }

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-05-29 11:45 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-08  8:19 [PATCH] Fix PR 15693 - Extra *running event when call-style dprintf hits Hui Zhu
2013-07-29 19:24 ` Tom Tromey
2013-07-31  8:15   ` Hui Zhu
2014-05-16  0:56     ` [PATCH] PR15693 - Fix spurious *running events, thread state, dprintf-style call Pedro Alves
2014-05-16  8:28       ` Hui Zhu
2014-05-29 11:45       ` [pushed] " Pedro Alves

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 read-only IMAP folder(s) and NNTP newsgroup(s).