From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11810 invoked by alias); 12 Dec 2008 20:07:50 -0000 Received: (qmail 11798 invoked by uid 22791); 12 Dec 2008 20:07:49 -0000 X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.45.13) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 12 Dec 2008 20:07:13 +0000 Received: from wpaz37.hot.corp.google.com (wpaz37.hot.corp.google.com [172.24.198.101]) by smtp-out.google.com with ESMTP id mBCK7BNv018942 for ; Fri, 12 Dec 2008 12:07:11 -0800 Received: from localhost (ruffy.corp.google.com [172.18.118.116]) by wpaz37.hot.corp.google.com with ESMTP id mBCK7AC1020149 for ; Fri, 12 Dec 2008 12:07:10 -0800 Received: by localhost (Postfix, from userid 67641) id 51E071C7A0E; Fri, 12 Dec 2008 12:07:10 -0800 (PST) To: gdb-patches@sourceware.org Subject: [RFA] * linux-low.c (linux_wait_for_process): Don't clobber current_inferior Message-Id: <20081212200710.51E071C7A0E@localhost> Date: Fri, 12 Dec 2008 20:07:00 -0000 From: dje@google.com (Doug Evans) X-IsSubscribed: yes 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-12/txt/msg00235.txt.bz2 Hi. linux-low.c:linux_wait_for_process has this: if (debug_threads && WIFSTOPPED (*wstatp)) { current_inferior = (struct thread_info *) find_inferior_id (&all_threads, (*childp)->lwpid); /* For testing only; i386_stop_pc prints out a diagnostic. */ if (the_low_target.get_pc != NULL) get_stop_pc (); } Clobbering current_inferior in a debugging printf is asking for trouble. [If current_inferior is supposed to be changed here, let's move it outside the test for debug_threads.] Ok to check in? 2008-12-12 Doug Evans * linux-low.c (linux_wait_for_process): Don't clobber current_inferior in debugging printf. Index: linux-low.c =================================================================== RCS file: /cvs/src/src/gdb/gdbserver/linux-low.c,v retrieving revision 1.82 diff -u -p -r1.82 linux-low.c --- linux-low.c 2 Dec 2008 07:57:37 -0000 1.82 +++ linux-low.c 12 Dec 2008 20:03:34 -0000 @@ -643,11 +642,13 @@ retry: if (debug_threads && WIFSTOPPED (*wstatp)) { + struct thread_info *saved_inferior = current_inferior; current_inferior = (struct thread_info *) find_inferior_id (&all_threads, (*childp)->lwpid); /* For testing only; i386_stop_pc prints out a diagnostic. */ if (the_low_target.get_pc != NULL) get_stop_pc (); + current_inferior = saved_inferior; } }