[PATCH] D135166: [DebugInfo] getMergedLocation: Maintain the line number if they match

Juan Manuel Martinez Caamaño via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 10 04:47:27 PDT 2022


jmmartinez added a comment.

In D135166#3846325 <https://reviews.llvm.org/D135166#3846325>, @Orlando wrote:

> "line 0" has a special meaning - that the instruction can't be attributed a single line number (e.g. because the instruction represents some merged instruction). I don't think that is actually mentioned anywhere in the DWARF spec but is more of a convention between DWARF emitters and consumers. Does column 0 convey the same meaning I wonder? I guess if your debugger uses column info and points at the start of the line (column 0) then that is an intuitive indication that column number isn't known, even if it's not explicit.

As far as I understand it's in the DWARF standard (in section 6.2.2 https://dwarfstd.org/doc/DWARF5.pdf ):

- **line**: An unsigned integer indicating a source line number. Lines are numbered beginning at 1. The compiler may emit the value 0 in cases where an instruction cannot be attributed to any source line.
- **column**: An unsigned integer indicating a column number within a source line. Columns are numbered beginning at 1. The value 0 is reserved to indicate that a statement begins at the “left edge” of the line.

The behaviour for the column is slightly different for declarations (in section 2.14): The value of the `DW_AT_decl_column` attribute represents the source column number at which the first character of the identifier of the declared object appears. The value 0 indicates that no column has been specified.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D135166/new/

https://reviews.llvm.org/D135166



More information about the llvm-commits mailing list