From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12381 invoked by alias); 15 Jan 2013 09:31:57 -0000 Received: (qmail 12364 invoked by uid 22791); 15 Jan 2013 09:31:57 -0000 X-SWARE-Spam-Status: No, hits=-3.8 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL X-Spam-Check-By: sourceware.org Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 15 Jan 2013 09:31:49 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1Tv2s1-0000vU-5p from Yao_Qi@mentor.com for gdb-patches@sourceware.org; Tue, 15 Jan 2013 01:31:49 -0800 Received: from SVR-ORW-FEM-05.mgc.mentorg.com ([147.34.97.43]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Tue, 15 Jan 2013 01:31:48 -0800 Received: from qiyao.dyndns.org.dyndns.org (147.34.91.1) by svr-orw-fem-05.mgc.mentorg.com (147.34.97.43) with Microsoft SMTP Server id 14.1.289.1; Tue, 15 Jan 2013 01:31:46 -0800 From: Yao Qi To: Subject: [PATCH] Remove redundant condition checking. Date: Tue, 15 Jan 2013 09:31:00 -0000 Message-ID: <1358242261-16209-1-git-send-email-yao@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain 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: 2013-01/txt/msg00300.txt.bz2 Hi, I find a redundant condition checking the infcmd.c:step_once, if (!single_inst) <--- [1] { CORE_ADDR pc; /* Step at an inlined function behaves like "down". */ if (!skip_subroutines && !single_inst <-- [2] && inline_skipped_frames (inferior_ptid)) The condition '!single_inst' is checked in both [1] and [2], but the checking in [2] is not necessary. This patch is to remove the checking in [2], because I don't see keep it in [2] helps understanding the code. It is obvious to me, but the review is still welcome. gdb: 2013-01-15 Yao Qi * infcmd.c (step_once): Don't check '!single_inst' as it was check before. --- gdb/infcmd.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/gdb/infcmd.c b/gdb/infcmd.c index 085903d..fb34ae4 100644 --- a/gdb/infcmd.c +++ b/gdb/infcmd.c @@ -1032,7 +1032,7 @@ step_once (int skip_subroutines, int single_inst, int count, int thread) CORE_ADDR pc; /* Step at an inlined function behaves like "down". */ - if (!skip_subroutines && !single_inst + if (!skip_subroutines && inline_skipped_frames (inferior_ptid)) { ptid_t resume_ptid; -- 1.7.7.6