From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7384 invoked by alias); 2 Jun 2009 20:38:57 -0000 Received: (qmail 7365 invoked by uid 22791); 2 Jun 2009 20:38:52 -0000 X-SWARE-Spam-Status: No, hits=-1.2 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_24,J_CHICKENPOX_44,J_CHICKENPOX_92,SARE_MSGID_LONG40,SPF_PASS X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.45.13) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 02 Jun 2009 20:38:44 +0000 Received: from zps18.corp.google.com (zps18.corp.google.com [172.25.146.18]) by smtp-out.google.com with ESMTP id n52KcgIV009295 for ; Tue, 2 Jun 2009 13:38:43 -0700 Received: from fxm22 (fxm22.prod.google.com [10.184.13.22]) by zps18.corp.google.com with ESMTP id n52Kce0f022631 for ; Tue, 2 Jun 2009 13:38:41 -0700 Received: by fxm22 with SMTP id 22so8800108fxm.9 for ; Tue, 02 Jun 2009 13:38:39 -0700 (PDT) MIME-Version: 1.0 Received: by 10.204.69.66 with SMTP id y2mr142178bki.49.1243975119807; Tue, 02 Jun 2009 13:38:39 -0700 (PDT) In-Reply-To: References: <20090422041933.GA32221@caradoc.them.org> Date: Tue, 02 Jun 2009 20:38:00 -0000 Message-ID: Subject: Re: [patch] Add discriminators to DWARF line table From: Diego Novillo To: Cary Coutant Cc: gcc-patches Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-System-Of-Record: true X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2009-06/txt/msg00204.txt.bz2 On Wed, Apr 29, 2009 at 19:20, Cary Coutant wrote: > =C2=A0 =C2=A0 =C2=A0 =C2=A0* basic-block.h (struct basic_block_def): Add = discriminator field. > =C2=A0 =C2=A0 =C2=A0 =C2=A0* dbxout.c (dbxout_source_line): Add new param= eter. =C2=A0Change all > =C2=A0 =C2=A0 =C2=A0 =C2=A0callers. > =C2=A0 =C2=A0 =C2=A0 =C2=A0* debug.c (do_nothing_debug_hooks): Add additi= onal entry. > =C2=A0 =C2=A0 =C2=A0 =C2=A0(debug_nothing_int_charstar_int): New function. > =C2=A0 =C2=A0 =C2=A0 =C2=A0* debug.h (struct gcc_debug_hooks): Add parame= ter to source_line > =C2=A0 =C2=A0 =C2=A0 =C2=A0hook. > =C2=A0 =C2=A0 =C2=A0 =C2=A0(debug_nothing_int_charstar_int): New declarat= ion. > =C2=A0 =C2=A0 =C2=A0 =C2=A0* dwarf2out.c (dwarf2out_source_line): Add new= parameter. =C2=A0Write > =C2=A0 =C2=A0 =C2=A0 =C2=A0discriminator value in .loc directive. > =C2=A0 =C2=A0 =C2=A0 =C2=A0* final.c (last_discriminator): New variable. > =C2=A0 =C2=A0 =C2=A0 =C2=A0(discriminator): New variable. > =C2=A0 =C2=A0 =C2=A0 =C2=A0(final_start_function): Initialize above varia= bles, pass current > =C2=A0 =C2=A0 =C2=A0 =C2=A0discriminator to debug hook. > =C2=A0 =C2=A0 =C2=A0 =C2=A0(notice_source_line): Check for discriminator = change. > =C2=A0 =C2=A0 =C2=A0 =C2=A0* gimple-pretty-print.c (dump_bb_header): Prin= t discriminator value. > =C2=A0 =C2=A0 =C2=A0 =C2=A0* sdbout.c (sdbout_source_line): New parameter. > =C2=A0 =C2=A0 =C2=A0 =C2=A0* tree-cfg.c (struct locus_discrim_map): New s= tructure type. > =C2=A0 =C2=A0 =C2=A0 =C2=A0(discriminator_per_locus): New hash table. > =C2=A0 =C2=A0 =C2=A0 =C2=A0(build_gimple_cfg): Allocate and free discrimi= nator hash table. > =C2=A0 =C2=A0 =C2=A0 =C2=A0(make_edges): Call assign_discriminator. > =C2=A0 =C2=A0 =C2=A0 =C2=A0(locus_map_hash): New function. > =C2=A0 =C2=A0 =C2=A0 =C2=A0(locus_map_eq): New function. > =C2=A0 =C2=A0 =C2=A0 =C2=A0(next_discriminator_for_locus): New function. > =C2=A0 =C2=A0 =C2=A0 =C2=A0(same_line_p): New function. > =C2=A0 =C2=A0 =C2=A0 =C2=A0(assign_discriminator): New function. > =C2=A0 =C2=A0 =C2=A0 =C2=A0(make_cond_expr_edges): Call assign_discrimina= tor. > =C2=A0 =C2=A0 =C2=A0 =C2=A0(make_gimple_switch_edges): Likewise. > =C2=A0 =C2=A0 =C2=A0 =C2=A0(first_non_label_stmt): New function. > =C2=A0 =C2=A0 =C2=A0 =C2=A0* vmsdbgout.c (vmsdbgout_source_line): Add new= parameter. =C2=A0Change > =C2=A0 =C2=A0 =C2=A0 =C2=A0all callers. > =C2=A0 =C2=A0 =C2=A0 =C2=A0* xcoffout.c (xcoffout_source_line): Add new p= arameter. > > =C2=A0 =C2=A0 =C2=A0 =C2=A0* configure.ac (gcc_cv_as_discriminator): New = configury check for > =C2=A0 =C2=A0 =C2=A0 =C2=A0gas support for discriminator. > =C2=A0 =C2=A0 =C2=A0 =C2=A0* configure: Regenerate. > =C2=A0 =C2=A0 =C2=A0 =C2=A0* config.in: Regenerate. OK with: > #ifndef DWARF2_FRAME_INFO > @@ -3243,7 +3243,7 @@ dwarf2out_begin_prologue (unsigned int l > prologue case, not the eh frame case. */ > #ifdef DWARF2_DEBUGGING_INFO > if (file) > - dwarf2out_source_line (line, file); > + dwarf2out_source_line (line, file, 0); For a line that uses no discriminators, is 'file:line:0' the same as 'file:line'? I expect, yes. Should we support a discriminator other than 0 to be the 'no discriminator' setting? I don't know what the standard says, so this may be a silly question. > @@ -91,6 +99,9 @@ static void make_edges (void); > static void make_cond_expr_edges (basic_block); > static void make_gimple_switch_edges (basic_block); > static void make_goto_expr_edges (basic_block); > +static unsigned int locus_map_hash (const void*); > +static int locus_map_eq (const void*, const void*); Space before '*'. > +/* Trivial hash function for a location_t. */ > + > +static unsigned int > +locus_map_hash (const void* item) Document ITEM. Space before '*'. > +/* Equality function for the locus-to-discriminator map. */ > + > +static int > +locus_map_eq (const void* va, const void* vb) Document VA and VB. Space before '*'. > +{ > + const struct locus_discrim_map* a =3D (const struct locus_discrim_map*= ) va; > + const struct locus_discrim_map* b =3D (const struct locus_discrim_map*= ) vb; Likewise. > + from =3D expand_location (locus1); > + to =3D expand_location (locus2); > + return (from.file =3D=3D to.file && from.line =3D=3D to.line); Are file name strings canonicalized by the location_t code? I assume they are, but I'm not sure. If not, you may need a better matching code here. Diego.