This is the mail archive of the 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] Improve OpenMP debug info for threadprivate vars and shared local statics

> x and y in the first testcase and thr and svar2 aren't visible in the
> debugger when in *omp_fn* function.  While in theory it should be possible
> for the debugger to look at the containing function in the initial thread
> (*omp_fn* is DW_AT_artificial) and find those vars there, that can take a
> long time before it is implemented in gdb.
> The following patch adds the referenced fn local threadprivate and statics
> to the *omp_fn* DW_TAG_subprogram too.

IMHO it would be better to do it without such duplication.  I think we
can beat the support out of the gdb people well enough, if the "proper"
indirect representations of all the info are there.

With 4.4.4(RH)-10, I see:

<subprogram name="main.omp_fn.0" prototyped=1 artificial=1 low_pc=0x4005e0 high_pc=0x4005fc frame_base={locexpr}>

Shouldn't that have static_link to refer to main as a nested function
would?  If it did, wouldn't that make the debugger handle it as it
should already handle nested functions?

These following questions are tangential, but it's the first time I've
really looked at -fopenmp DWARF output.

The name "main.omp_fn.0" is not a source identifier.  Should it really
be there in name?  IMHO it seems more proper for that to have only
artificial=true, linkage_name="main.omp_fn.0", and no name.  (Perhaps
linkage_name is not useful or appropriate since it's not DW_AT_external.)


   <formal_parameter name=".omp_data_i" type="#ref1" artificial=1 location={locexpr}/>

Should that really have a name?  As it stands, the debugger is going to
present ".omp_data_i" as a resolvable identifier in this scope, as it
would for any other artifical parameter (such as C++ "this").


  <structure_type ref="ref4" name=".omp_data_s.10" byte_size=0x8>

This needs artificial=true too.  Again, it seems quite questionable
whether the non-source name should appear at all.  AIUI, this sort of
thing is exactly what DW_AT_description is for.


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