From patchwork Wed Aug 13 22:57:55 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Evans X-Patchwork-Id: 2392 Received: (qmail 16478 invoked by alias); 13 Aug 2014 22:58:03 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 15890 invoked by uid 89); 13 Aug 2014 22:57:59 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.2 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-pd0-f201.google.com Received: from mail-pd0-f201.google.com (HELO mail-pd0-f201.google.com) (209.85.192.201) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Wed, 13 Aug 2014 22:57:58 +0000 Received: by mail-pd0-f201.google.com with SMTP id g10so139586pdj.4 for ; Wed, 13 Aug 2014 15:57:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-type; bh=XxvlVVw/nV8Ft5mPQclhJqeoau4k7azHsnd1+3lDM78=; b=SG8m+uxGSav9ZY28ftrx77fPUXrAgQL9F3O6p5Xi2uhYRjH3YebMvv7gWsz+jmIkxO nTYKzfO9IEtqNQjtr6BW1OOFPAHxJac8pJxwxWcyZtlifIqnh/5Rq0drNxsHbRvKh/SA hgWaIcU699aSvf9IdG2Bx6VC4Rc2Fc1NqOeRMcAjFPFB7Nme4qr1mX8buYE9mDnL4zGN ad+2XQA4L/62xf4Sz5leeIVfeCzEGPCA0spvE8v+5XfvVRf2LeWOuQGpOAUkqvzfhHxX YzuWSmg8wZbFbW6G68mddg2COUu7hph6Z0JixnIaEMdc6rc8TpTKlaCvsrtHojsrfLsp OhYg== X-Gm-Message-State: ALoCoQnHMtnBITdgPBe3NCIOCh0Ubsj1Yjsu6Oe4PCwlBaUXKpVL9URfNEheeW8u9h9/tA9QoSkZU33DoB95izSSOtHwksOpueeo/0Nq9JDkRpQzkDrMCf21myanO97BDwYlRNNVMxfg X-Received: by 10.66.65.131 with SMTP id x3mr3614748pas.13.1407970676697; Wed, 13 Aug 2014 15:57:56 -0700 (PDT) Received: from corp2gmr1-1.hot.corp.google.com (corp2gmr1-1.hot.corp.google.com [172.24.189.92]) by gmr-mx.google.com with ESMTPS id l23si240196yhg.1.2014.08.13.15.57.56 for (version=TLSv1.1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 13 Aug 2014 15:57:56 -0700 (PDT) Received: from ruffy.mtv.corp.google.com (ruffy.mtv.corp.google.com [172.17.128.44]) by corp2gmr1-1.hot.corp.google.com (Postfix) with ESMTP id 3F7FF31C5B3 for ; Wed, 13 Aug 2014 15:57:56 -0700 (PDT) From: Doug Evans To: gdb-patches@sourceware.org Subject: [PATCH] dwarf_decode_lines_1: Delete local basic_block, unused Date: Wed, 13 Aug 2014 15:57:55 -0700 Message-ID: MIME-Version: 1.0 X-IsSubscribed: yes Hi. This is a mildly interesting patch. The dwarf line number state machine is non-trivial, and there is value in documentating all the state changes, even if gdb doesn't use them all today. I went as far back as gdb 4.18, and basic_block has never AFAICT been used. Should I apply this patch? [btw, I came across this while debugging a testsuite failure when using clang: clang emits discriminators and gdb ends up creating multiple line number entries for the same line. When printing a source line gdb will print the pc value if it is not at the start of a line, and, for example, watchpoint-reuse-slot.exp depends on this behaviour. With multiple line number entries for the same line it can happen that the pc is really in the middle of the line but gdb doesn't think so.] 2014-08-13 Doug Evans * dwarf2read.c (dwarf_decode_lines_1): Delete local basic_block, unused. diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index abe47d1..688e12a 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -17206,7 +17206,6 @@ dwarf_decode_lines_1 (struct line_header *lh, const char *comp_dir, unsigned int line = 1; unsigned int column = 0; int is_stmt = lh->default_is_stmt; - int basic_block = 0; int end_sequence = 0; CORE_ADDR addr; unsigned char op_index = 0; @@ -17269,7 +17268,6 @@ dwarf_decode_lines_1 (struct line_header *lh, const char *comp_dir, (*p_record_line) (current_subfile, line, addr); } } - basic_block = 0; } else switch (op_code) { @@ -17367,7 +17365,6 @@ dwarf_decode_lines_1 (struct line_header *lh, const char *comp_dir, (*p_record_line) (current_subfile, line, addr); } } - basic_block = 0; break; case DW_LNS_advance_pc: { @@ -17419,7 +17416,6 @@ dwarf_decode_lines_1 (struct line_header *lh, const char *comp_dir, is_stmt = (!is_stmt); break; case DW_LNS_set_basic_block: - basic_block = 1; break; /* Add to the address register of the state machine the address increment value corresponding to special opcode