From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8896 invoked by alias); 12 Dec 2012 04:13:15 -0000 Received: (qmail 8290 invoked by uid 22791); 12 Dec 2012 04:13:13 -0000 X-SWARE-Spam-Status: No, hits=-4.6 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,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; Wed, 12 Dec 2012 04:13:06 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1Tidgv-0001DU-Bf from Yao_Qi@mentor.com for gdb-patches@sourceware.org; Tue, 11 Dec 2012 20:13:05 -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, 11 Dec 2012 20:13:05 -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, 11 Dec 2012 20:13:04 -0800 From: Yao Qi To: Subject: [PATCH 2/3] Remove dead code for dprintf. Date: Wed, 12 Dec 2012 04:13:00 -0000 Message-ID: <1355285581-28889-3-git-send-email-yao@codesourcery.com> In-Reply-To: <1355285581-28889-1-git-send-email-yao@codesourcery.com> References: <1355285581-28889-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: 2012-12/txt/msg00376.txt.bz2 Hi, For a given dprintf B, B->commands can never be null, so the condition below is always false. This patch is to remove it as sort of dead code. When creating a dprintf B, the following call chain can be found unconditionally, init_breakpoint_sal --> update_dprintf_command_list (because B->extra_string can't be null) --> breakpoint_set_commands (because PRINT_LINE can't be null) --> set B->commands. gdb: 2012-12-12 Yao Qi * breakpoint.c (print_one_breakpoint_location): Remove dead code. --- gdb/breakpoint.c | 9 --------- 1 files changed, 0 insertions(+), 9 deletions(-) diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index e1da50b..65bdc2c 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -6091,15 +6091,6 @@ print_one_breakpoint_location (struct breakpoint *b, ui_out_text (uiout, " bytes\n"); } } - - if (!part_of_multiple && b->extra_string - && b->type == bp_dprintf && !b->commands) - { - annotate_field (7); - ui_out_text (uiout, "\t(agent printf) "); - ui_out_field_string (uiout, "printf", b->extra_string); - ui_out_text (uiout, "\n"); - } l = b->commands ? b->commands->commands : NULL; if (!part_of_multiple && l) -- 1.7.7.6