From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16060 invoked by alias); 23 Dec 2009 06:52:07 -0000 Received: (qmail 16051 invoked by uid 22791); 23 Dec 2009 06:52:06 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 23 Dec 2009 06:52:02 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 02FD52BAB7A; Wed, 23 Dec 2009 01:52:00 -0500 (EST) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id YC-7GrcYv3pz; Wed, 23 Dec 2009 01:52:00 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 801DD2BAB4A; Wed, 23 Dec 2009 01:51:59 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id B044FF5937; Wed, 23 Dec 2009 07:51:41 +0100 (CET) Date: Wed, 23 Dec 2009 06:52:00 -0000 From: Joel Brobecker To: Hui Zhu Cc: Michael Snyder , shuchang zhou , paawan oza , Tom Tromey , gdb-patches ml Subject: Re: [RFC] Add support of software single step to process record Message-ID: <20091223065141.GT2788@adacore.com> References: <4B2BD97E.1020106@vmware.com> <20091220133009.GI2788@adacore.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) 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: 2009-12/txt/msg00357.txt.bz2 > Joel, I remove the current_gdbarch() from this patch, but for > get_current_frame, I cannot find any function that fit for replace it. > Could you help me with it? Upon further investigation, I believe that this is the only way to do this. I don't think you can get the frame from the arguments provided to "resume". I did a quick research and infrun.c:resume does the same thing (actually, it's maybe_software_singlestep). > + if (single_step_breakpoints[0] != NULL > + || single_step_breakpoints[1] != NULL) > + return 1; > + > + return 0; Style nit: You really don't have to fix this, as this is a matter of style more than correctness, but we usually write the above code as return (single_step_breakpoints[0] != NULL || single_step_breakpoints[1] != NULL) This avoids the type of mistake you made. I tend to like the style you used when there are several consecutive if conditions that allow me to return early (a type of soft assert), or to avoid unreasonable nesting levels. -- Joel