On 12/11/2017 09:52 PM, Alexandre Oliva wrote:
+/* output symbol LAB1 as an unsigned LEB128 quantity. */
+
+void
+dw2_asm_output_symname_uleb128 (const char *lab1 ATTRIBUTE_UNUSED,
+ const char *comment, ...)
I'm having trouble understanding the use of symbols for views. The
configure test for gas support doesn't obviously define a symbol
anywhere; is it implicitly defined by its use in the location directive?
This could use more documentation in dwarf2out.
+ view computation, and it is refers to a view identifier for which
"it refers"
Why do we need to use a non-zero view identifier for a zero view? Why
can't we always use 0 instead of the bitmap?
Rationale: location lists can refer to address and view, not
op_index, so views are reset at address changes, not at op_index
changes. Opcodes that advance op_index only will only reset the
view when they happen to advance the address, e.g. by exceeding
maximum_operations_per_instruction in op_index.
DW_LNS_fixed_advance_pc is the only opcode that may change the
address without resetting the view. It is available for compilers
to use when an address change is uncertain, e.g., when advancing
past opcodes that may expand to an empty sequence,
e.g. possibly-empty alignment sequences, optional no-operation
opcodes or the like.
+ if (debug_variable_location_views && table->view)
+ push_dw_line_info_entry (table, LI_adv_address, label_num);
It looks like you'll always use DW_LNS_fixed_advance_pc when we don't
have .loc support. Does that mean that the view never gets reset?
I'm uncomfortable with the special handling of this opcode; it isn't
special in DWARF5 except as a fallback if more compact encodings aren't
usable. Currently GCC is even more conservative than this, and always
use a relocation (DW_LNS_set_address); if we can use D_L_f_a_p instead,
I would expect that to help with link times. It seems wrong to use it
only in the context of view support.
Would it make sense to say for *all* opcodes that the view is reset if
and only if the address actually changes?
How are we coordinating the line number table and location list versions
of the view counter?
Jason