From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 126359 invoked by alias); 10 Jun 2015 20:04:25 -0000 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 Received: (qmail 126345 invoked by uid 89); 10 Jun 2015 20:04:24 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mail-oi0-f52.google.com Received: from mail-oi0-f52.google.com (HELO mail-oi0-f52.google.com) (209.85.218.52) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Wed, 10 Jun 2015 20:04:23 +0000 Received: by oiha141 with SMTP id a141so39297120oih.0 for ; Wed, 10 Jun 2015 13:04:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=Qe2lt0njczvkFEWWQmLgEM2EqRe1juf+tEO7xfnbCVU=; b=A4raAFkNzXmDn9rT1tUVBxD03F6zFOcGiDCwcknp9YBrMgb5vsXu9nIB9NKrZC4Rnq FRyubKOwTwePA2Ht9a5559ALTkyUxOXeJk1IjR3Fx5Az5yNS0d0Ki+9MHj0MDMJwfQhy 0eeXcYPltB1MWohT8uQuXrmaQHIK33LCq1EfwU0Z1KuMZTtC/l6mAqKtjgHJU0PykNSC 5809sGwliGbW8Z4v3qZb/uQ8Age0T+81N+VmpMMXMXAXmEdMs+uYqIQhHao7Y5xTJorY fq/qrNkeqUJzSeuHSy7CLsX3+PkBInczKXScMOq8h1JvM3WCH2wyWfBeZCXNavSbHT1Y XsHw== X-Gm-Message-State: ALoCoQl3jaCL2HPBVxxMOWVdvrkFLwL9Uva796z+jTrPKN0KSkJ0kHVDiD5tJhYouwQTkZbN9dZf MIME-Version: 1.0 X-Received: by 10.182.22.11 with SMTP id z11mr4290119obe.77.1433966661334; Wed, 10 Jun 2015 13:04:21 -0700 (PDT) Received: by 10.182.89.99 with HTTP; Wed, 10 Jun 2015 13:04:21 -0700 (PDT) In-Reply-To: <557893A6.1050000@ericsson.com> References: <001a11376bdcb0959e051717abd5@google.com> <557893A6.1050000@ericsson.com> Date: Wed, 10 Jun 2015 20:04:00 -0000 Message-ID: Subject: Re: [PATCH 4/6] DWARF Two Level Line Tables: lnp_state_machine, lnp_reader_state From: Doug Evans To: Simon Marchi Cc: gdb-patches Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2015-06/txt/msg00197.txt.bz2 On Wed, Jun 10, 2015 at 12:44 PM, Simon Marchi wrote: > On 15-05-27 06:21 PM, Doug Evans wrote: >> Doug Evans writes: >> > Hi. >> > >> > This patch puts the line number state machine into a struct >> > to make it clear exactly what is part of the state machine >> > and what is not. Previously, gdb just had a bunch of local variables. >> > >> > 2015-03-12 Doug Evans >> > >> > * dwarf2read.c (lnp_state_machine): New typedef. >> > (lnp_reader_state): New typedef. >> > (dwarf_record_line_1): Renamed from dwarf_record_line. >> > All callers updated. >> > (dwarf_record_line): New function. >> > (init_lnp_state_machine): New function. >> > (check_line_address): Replace p_record_line parameter with state. >> > All callers updated. >> > (dwarf_decode_lines_1): Call dwarf_record_line, init_lnp_state_machine. >> > Update to record state in lnp_state_machine. >> >> Here is what I committed. >> Just a few comment changes to remove references to two level >> line tables, which are in a later patch. > > Hi Doug, > > I have a little question about something this patch. One behaviour changed, > but I don't know if it was intentional or not. I assume it is not, since the goal > of this patch was to refactor/cleanup. > > When reading full symbols, after an end_sequence, dwarf_finish_line was called > unconditionally. Now, the call to dwarf_finish_line is guarded by: > > if (state->last_subfile != current_subfile) { > > Before this patch, the two other calls to dwarf_finish_line were guarded by this if. > However, the third one wasn't. Is this change intentional? > > I am asking this because that call is apparently important for gdb to properly > understand DWARF generated by one of our internal compiler. To restore the previous > behaviour, I did the following. Would it make sense to have the same change in FSF's gdb? > > ---8<--- > > diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c > index 1e290c3..d79b2e3 100644 > --- a/gdb/dwarf2read.c > +++ b/gdb/dwarf2read.c > @@ -17658,7 +17658,7 @@ dwarf_record_line (lnp_reader_state *reader, lnp_state_machine *state, > lh->file_names[file - 1].included_p = 1; > if (reader->record_lines_p && is_stmt) > { > - if (state->last_subfile != current_subfile) > + if (state->last_subfile != current_subfile || end_sequence) > { > dwarf_finish_line (reader->gdbarch, state->last_subfile, > state->address, state->record_line); > > --->8--- Yikes. My bad, thanks for catching this. LGTM