From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21385 invoked by alias); 24 Apr 2008 16:45:57 -0000 Received: (qmail 21334 invoked by uid 22791); 24 Apr 2008 16:45:56 -0000 X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 24 Apr 2008 16:45:35 +0000 Received: (qmail 14026 invoked from network); 24 Apr 2008 16:45:31 -0000 Received: from unknown (HELO localhost) (vladimir@127.0.0.2) by mail.codesourcery.com with ESMTPA; 24 Apr 2008 16:45:31 -0000 From: Vladimir Prus Date: Thu, 24 Apr 2008 23:08:00 -0000 Subject: [RFA] Make continuations per-thread. To: gdb-patches@sources.redhat.com X-TUID: 548d25431068470a X-Length: 4876 X-UID: 164 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200804242045.39246.vladimir@codesourcery.com> Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-04/txt/msg00562.txt.bz2 Right now, continuations are global. This means that if we're doing 'finish' in one thread, then we cannot do 'finish' or anything that also uses continuations, in any other thread. This seems unnecessary limitation, and this patch makes continuations per-thread. Further into non-stop series, it really allows me to do 'finish' or 'step' in several threads independently. OK? - Volodya --- gdb/gdbthread.h | 15 +++++++++++++-- gdb/infrun.c | 8 ++++++-- gdb/thread.c | 16 ++++++++++++++-- 3 files changed, 33 insertions(+), 6 deletions(-) diff --git a/gdb/gdbthread.h b/gdb/gdbthread.h index 6cfb1f9..56cbd51 100644 --- a/gdb/gdbthread.h +++ b/gdb/gdbthread.h @@ -64,6 +64,11 @@ struct thread_info when we finally do stop stepping. */ bpstat stepping_through_solib_catchpoints; + struct continuation *continuations; + struct continuation *intermediate_continations; + + int proceed_to_finish; + /* Private data used by the target vector implementation. */ struct private_thread_info *private; }; @@ -130,7 +135,10 @@ extern void save_infrun_state (ptid_t ptid, int stepping_through_solib_after_catch, bpstat stepping_through_solib_catchpoints, int current_line, - struct symtab *current_symtab); + struct symtab *current_symtab, + struct continuation *continuations, + struct continuation *intermediate_continations, + int proceed_to_finish); /* infrun context switch: load the debugger state previously saved for the given thread. */ @@ -146,7 +154,10 @@ extern void load_infrun_state (ptid_t ptid, int *stepping_through_solib_affter_catch, bpstat *stepping_through_solib_catchpoints, int *current_line, - struct symtab **current_symtab); + struct symtab **current_symtab, + struct continuation **continuations, + struct continuation **intermediate_continations, + int *proceed_to_finish); /* Switch from one thread to another. */ extern void switch_to_thread (ptid_t ptid); diff --git a/gdb/infrun.c b/gdb/infrun.c index d68b7a5..d6e2c62 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -1518,7 +1518,9 @@ context_switch (struct execution_control_state *ecs) ecs->handling_longjmp, ecs->stepping_over_breakpoint, ecs->stepping_through_solib_after_catch, ecs->stepping_through_solib_catchpoints, - ecs->current_line, ecs->current_symtab); + ecs->current_line, ecs->current_symtab, + cmd_continuation, intermediate_continuation, + proceed_to_finish); /* Load infrun state for the new thread. */ load_infrun_state (ecs->ptid, &prev_pc, @@ -1528,7 +1530,9 @@ context_switch (struct execution_control_state *ecs) &ecs->handling_longjmp, &ecs->stepping_over_breakpoint, &ecs->stepping_through_solib_after_catch, &ecs->stepping_through_solib_catchpoints, - &ecs->current_line, &ecs->current_symtab); + &ecs->current_line, &ecs->current_symtab, + &cmd_continuation, &intermediate_continuation, + &proceed_to_finish); } switch_to_thread (ecs->ptid); diff --git a/gdb/thread.c b/gdb/thread.c index 431d88f..bba32e8 100644 --- a/gdb/thread.c +++ b/gdb/thread.c @@ -333,7 +333,10 @@ load_infrun_state (ptid_t ptid, int *stepping_through_solib_after_catch, bpstat *stepping_through_solib_catchpoints, int *current_line, - struct symtab **current_symtab) + struct symtab **current_symtab, + struct continuation **continuations, + struct continuation **intermediate_continations, + int *proceed_to_finish) { struct thread_info *tp; @@ -357,6 +360,9 @@ load_infrun_state (ptid_t ptid, tp->stepping_through_solib_catchpoints; *current_line = tp->current_line; *current_symtab = tp->current_symtab; + *continuations = tp->continuations; + *intermediate_continations = tp->intermediate_continations; + *proceed_to_finish = tp->proceed_to_finish; } /* Save infrun state for the thread PID. */ @@ -374,7 +380,10 @@ save_infrun_state (ptid_t ptid, int stepping_through_solib_after_catch, bpstat stepping_through_solib_catchpoints, int current_line, - struct symtab *current_symtab) + struct symtab *current_symtab, + struct continuation *continuations, + struct continuation *intermediate_continations, + int proceed_to_finish) { struct thread_info *tp; @@ -396,6 +405,9 @@ save_infrun_state (ptid_t ptid, tp->stepping_through_solib_catchpoints = stepping_through_solib_catchpoints; tp->current_line = current_line; tp->current_symtab = current_symtab; + tp->continuations = continuations; + tp->intermediate_continations = intermediate_continations; + tp->proceed_to_finish = proceed_to_finish; } /* Return true if TP is an active thread. */ -- 1.5.3.5