[Lldb-commits] [lldb] [lldb] Store SupportFile in FileEntry (NFC) (PR #85468)

Adrian Prantl via lldb-commits lldb-commits at lists.llvm.org
Fri Mar 15 14:56:15 PDT 2024


================
@@ -130,18 +130,27 @@ struct LineEntry {
   ///     Shared pointer to the target this LineEntry belongs to.
   void ApplyFileMappings(lldb::TargetSP target_sp);
 
-  // Member variables.
-  AddressRange range; ///< The section offset address range for this line entry.
-  FileSpec file; ///< The source file, possibly mapped by the target.source-map
-                 ///setting
-  lldb::SupportFileSP
-      original_file_sp; ///< The original source file, from debug info.
-  uint32_t line = LLDB_INVALID_LINE_NUMBER; ///< The source line number, or zero
-                                            ///< if there is no line number
-                                            /// information.
-  uint16_t column =
-      0; ///< The column number of the source line, or zero if there
-         /// is no column information.
+  const FileSpec &GetFile() const {
+    assert(file_sp);
+    return file_sp->GetSpecOnly();
+  }
+
+  /// The section offset address range for this line entry.
+  AddressRange range;
+
+  /// The source file, possibly mapped by the target.source-map setting.
+  lldb::SupportFileSP file_sp;
+
+  /// The original source file, from debug info.
+  lldb::SupportFileSP original_file_sp;
+
+  /// The source line number, or zero if there is no line number information.
+  uint32_t line = LLDB_INVALID_LINE_NUMBER;
----------------
adrian-prantl wrote:

Is LLDB_INVALID_LINE_NUMBER 0?

https://github.com/llvm/llvm-project/pull/85468


More information about the lldb-commits mailing list