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

Jonas Devlieghere via lldb-commits lldb-commits at lists.llvm.org
Fri Mar 15 14:58:50 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;
----------------
JDevlieghere wrote:

Actually... it's not: `LLDB_INVALID_LINE_NUMBER` is `UINT32_MAX`. I'll update the comment since I'm already touching the line. 

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


More information about the lldb-commits mailing list