This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] Add discriminators to DWARF line table


On Wed, Apr 29, 2009 at 19:20, Cary Coutant <ccoutant@google.com> wrote:

> Â Â Â Â* basic-block.h (struct basic_block_def): Add discriminator field.
> Â Â Â Â* dbxout.c (dbxout_source_line): Add new parameter. ÂChange all
> Â Â Â Âcallers.
> Â Â Â Â* debug.c (do_nothing_debug_hooks): Add additional entry.
> Â Â Â Â(debug_nothing_int_charstar_int): New function.
> Â Â Â Â* debug.h (struct gcc_debug_hooks): Add parameter to source_line
> Â Â Â Âhook.
> Â Â Â Â(debug_nothing_int_charstar_int): New declaration.
> Â Â Â Â* dwarf2out.c (dwarf2out_source_line): Add new parameter. ÂWrite
> Â Â Â Âdiscriminator value in .loc directive.
> Â Â Â Â* final.c (last_discriminator): New variable.
> Â Â Â Â(discriminator): New variable.
> Â Â Â Â(final_start_function): Initialize above variables, pass current
> Â Â Â Âdiscriminator to debug hook.
> Â Â Â Â(notice_source_line): Check for discriminator change.
> Â Â Â Â* gimple-pretty-print.c (dump_bb_header): Print discriminator value.
> Â Â Â Â* sdbout.c (sdbout_source_line): New parameter.
> Â Â Â Â* tree-cfg.c (struct locus_discrim_map): New structure type.
> Â Â Â Â(discriminator_per_locus): New hash table.
> Â Â Â Â(build_gimple_cfg): Allocate and free discriminator hash table.
> Â Â Â Â(make_edges): Call assign_discriminator.
> Â Â Â Â(locus_map_hash): New function.
> Â Â Â Â(locus_map_eq): New function.
> Â Â Â Â(next_discriminator_for_locus): New function.
> Â Â Â Â(same_line_p): New function.
> Â Â Â Â(assign_discriminator): New function.
> Â Â Â Â(make_cond_expr_edges): Call assign_discriminator.
> Â Â Â Â(make_gimple_switch_edges): Likewise.
> Â Â Â Â(first_non_label_stmt): New function.
> Â Â Â Â* vmsdbgout.c (vmsdbgout_source_line): Add new parameter. ÂChange
> Â Â Â Âall callers.
> Â Â Â Â* xcoffout.c (xcoffout_source_line): Add new parameter.
>
> Â Â Â Â* configure.ac (gcc_cv_as_discriminator): New configury check for
> Â Â Â Âgas support for discriminator.
> Â Â Â Â* configure: Regenerate.
> Â Â Â Â* 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 = (const struct locus_discrim_map*) va;
> +  const struct locus_discrim_map* b = (const struct locus_discrim_map*) vb;

Likewise.

> +  from = expand_location (locus1);
> +  to = expand_location (locus2);
> +  return (from.file == to.file && from.line == 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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]