Issue 140917.1: procedure/subroutine/subprogram terminology
Section many, pg many
The net result of this proposal is that (a) "procedure" always means "DWARF procedure"
(except when it's a PASCAL keyword in an example); (b) "subroutine" always means a
piece of the compiled program being debugged.
The DW_AT_default_value attribute is described as possibly being a
reference to a "subroutine" and it computes "the value returned by the
referenced subroutine." This language implies a call to a part of the
compiled program, but recent discussion within the committee suggests
that the intent was to call a DWARF procedure. This proposal changes
the language describing DW_AT_default_value to make that completely
clear.
Related terminology issue #1: The description of DW_OP_call* also uses
the word "subroutine" to describe the called thingy; it's the only place
obviously referring to a DWARF procedure that doesn't use the term
"DWARF procedure." For consistency, it should.
Related terminology issue #2: There are 4 places that use the word
"procedure" to refer to a part of the compiled program, rather than
a DWARF procedure. I think it would be prudent to change all these
to "subroutine" or "subprogram" (editor's choice).
(The terms "subroutine" and "subprogram" are used widely throughout
the document to refer to a part of the compiled program. It doesn't
seem worth the trouble to make them all use the same word.)
PROPOSED EDITS
==============
(Section/page references per dwarf5.20140618.pdf.)
Fixing DW_AT_default_value
--------------------------
Section 4.1 item 9, p.83.
This one is basically a complete replacement because of how intertwined
all the cases are.
Current text:
9. A DW_AT_default_value attribute for a formal parameter entry. The
value of this attribute is a reference to the debugging information
entry for a variable or subroutine, or the value may be a constant.
If the attribute form is of class reference, the default value of the
parameter is the value of the referenced variable (which may be
constant) or the value returned by the referenced subroutine; a
reference value of 0 means that no default value has been specified.
If the value is of class constant, that constant is interpreted as a
default value of the type of the formal parameter.
*For a constant form there is no way to express the absence of a default
value.*
Replacement text:
9. A DW_AT_default_value attribute for a formal parameter entry. The
value of this attribute may be a constant, or a reference to the
debugging information entry for a variable, or a reference to a
debugging information entry containing a DWARF procedure. If the
attribute form is of class constant, that constant is interpreted as
a default value of the type of the formal parameter. If the attribute
form is of class reference, and the referenced entry is for a
variable, the default value of the parameter is the value of the
referenced variable. If the reference value is 0, no default value
has been specified. Otherwise, the attribute represents an implicit
DW_OP_call_ref to the referenced debugging information entry, and
the default value of the parameter is the value returned by that
DWARF procedure, interpreted as a value of the type of the formal
parameter.
*For a constant form there is no way to express the absence of a default
value.*
Fixing "subroutine" -> "DWARF procedure"
----------------------------------------
section 2.5.1.5 p.24 item 4
First sentence currently reads:
DW_OP_call2, DW_OP_call4, and DW_OP_call_ref perform subroutine calls
during evaluation of a DWARF expression or location description.
Replace "subroutine" with "DWARF procedure"
Fixing "procedure" -> "subprogram"/"subroutine"
-----------------------------------------------
I propose to leave it to the editor's discretion whether to use
"subprogram" or "subroutine" in any given place.
section 3.3.5
p.66 non-normative text (middle of the page, 3 occurrences)
p.67 item 1 (note: item 2 uses "subroutine" to mean the same thing!)
section 6.2.1
p.123 definition of "basic block"
section 6.4.1
p.144 1st paragraph
section E.1.2.1
p.312 2nd paragraph (but is that correct FORTRAN terminology?)
--
10/21/2014 -- Accepted.