[Lldb-commits] [PATCH] D40311: elf-core: Split up parsing code into os-specific functions

2017-11-23 Thread Pavel Labath via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL318903: elf-core: Split up parsing code into os-specific 
functions (authored by labath).

Repository:
  rL LLVM

https://reviews.llvm.org/D40311

Files:
  lldb/trunk/source/Plugins/Process/elf-core/ProcessElfCore.cpp
  lldb/trunk/source/Plugins/Process/elf-core/ProcessElfCore.h
  lldb/trunk/source/Plugins/Process/elf-core/ThreadElfCore.cpp
  lldb/trunk/source/Plugins/Process/elf-core/ThreadElfCore.h
  lldb/trunk/source/Plugins/Process/elf-core/elf-core-enums.h

Index: lldb/trunk/source/Plugins/Process/elf-core/ThreadElfCore.h
===
--- lldb/trunk/source/Plugins/Process/elf-core/ThreadElfCore.h
+++ lldb/trunk/source/Plugins/Process/elf-core/ThreadElfCore.h
@@ -58,15 +58,15 @@
 
   ELFLinuxPrStatus();
 
-  lldb_private::Status Parse(lldb_private::DataExtractor ,
- lldb_private::ArchSpec );
+  lldb_private::Status Parse(const lldb_private::DataExtractor ,
+ const lldb_private::ArchSpec );
 
   // Return the bytesize of the structure
   // 64 bit - just sizeof
   // 32 bit - hardcoded because we are reusing the struct, but some of the
   // members are smaller -
   // so the layout is not the same
-  static size_t GetSize(lldb_private::ArchSpec );
+  static size_t GetSize(const lldb_private::ArchSpec );
 };
 
 static_assert(sizeof(ELFLinuxPrStatus) == 112,
@@ -79,7 +79,7 @@
 
   ELFLinuxSigInfo();
 
-  lldb_private::Status Parse(lldb_private::DataExtractor ,
+  lldb_private::Status Parse(const lldb_private::DataExtractor ,
  const lldb_private::ArchSpec );
 
   // Return the bytesize of the structure
@@ -114,15 +114,15 @@
 
   ELFLinuxPrPsInfo();
 
-  lldb_private::Status Parse(lldb_private::DataExtractor ,
- lldb_private::ArchSpec );
+  lldb_private::Status Parse(const lldb_private::DataExtractor ,
+ const lldb_private::ArchSpec );
 
   // Return the bytesize of the structure
   // 64 bit - just sizeof
   // 32 bit - hardcoded because we are reusing the struct, but some of the
   // members are smaller -
   // so the layout is not the same
-  static size_t GetSize(lldb_private::ArchSpec );
+  static size_t GetSize(const lldb_private::ArchSpec );
 };
 
 static_assert(sizeof(ELFLinuxPrPsInfo) == 136,
Index: lldb/trunk/source/Plugins/Process/elf-core/ThreadElfCore.cpp
===
--- lldb/trunk/source/Plugins/Process/elf-core/ThreadElfCore.cpp
+++ lldb/trunk/source/Plugins/Process/elf-core/ThreadElfCore.cpp
@@ -259,7 +259,7 @@
   memset(this, 0, sizeof(ELFLinuxPrStatus));
 }
 
-size_t ELFLinuxPrStatus::GetSize(lldb_private::ArchSpec ) {
+size_t ELFLinuxPrStatus::GetSize(const lldb_private::ArchSpec ) {
   constexpr size_t mips_linux_pr_status_size_o32 = 96;
   constexpr size_t mips_linux_pr_status_size_n32 = 72;
   if (arch.IsMIPS()) {
@@ -285,7 +285,8 @@
   }
 }
 
-Status ELFLinuxPrStatus::Parse(DataExtractor , ArchSpec ) {
+Status ELFLinuxPrStatus::Parse(const DataExtractor ,
+   const ArchSpec ) {
   Status error;
   if (GetSize(arch) > data.GetByteSize()) {
 error.SetErrorStringWithFormat(
@@ -334,7 +335,7 @@
   memset(this, 0, sizeof(ELFLinuxPrPsInfo));
 }
 
-size_t ELFLinuxPrPsInfo::GetSize(lldb_private::ArchSpec ) {
+size_t ELFLinuxPrPsInfo::GetSize(const lldb_private::ArchSpec ) {
   constexpr size_t mips_linux_pr_psinfo_size_o32_n32 = 128;
   if (arch.IsMIPS()) {
 uint8_t address_byte_size = arch.GetAddressByteSize();
@@ -355,7 +356,8 @@
   }
 }
 
-Status ELFLinuxPrPsInfo::Parse(DataExtractor , ArchSpec ) {
+Status ELFLinuxPrPsInfo::Parse(const DataExtractor ,
+   const ArchSpec ) {
   Status error;
   ByteOrder byteorder = data.GetByteOrder();
   if (GetSize(arch) > data.GetByteSize()) {
@@ -424,7 +426,7 @@
   }
 }
 
-Status ELFLinuxSigInfo::Parse(DataExtractor , const ArchSpec ) {
+Status ELFLinuxSigInfo::Parse(const DataExtractor , const ArchSpec ) {
   Status error;
   if (GetSize(arch) > data.GetByteSize()) {
 error.SetErrorStringWithFormat(
Index: lldb/trunk/source/Plugins/Process/elf-core/elf-core-enums.h
===
--- lldb/trunk/source/Plugins/Process/elf-core/elf-core-enums.h
+++ lldb/trunk/source/Plugins/Process/elf-core/elf-core-enums.h
@@ -10,6 +10,10 @@
 #ifndef LLDB_ELF_CORE_ENUMS_H
 #define LLDB_ELF_CORE_ENUMS_H
 
+#include "Plugins/ObjectFile/ELF/ObjectFileELF.h"
+#include "lldb/Utility/DataExtractor.h"
+
+namespace lldb_private {
 /// Core files PT_NOTE segment descriptor types
 
 namespace FREEBSD {
@@ -52,4 +56,11 @@
 };
 }
 
+struct CoreNote {
+  ELFNote info;
+  DataExtractor data;
+};
+
+} // namespace lldb_private
+
 #endif // #ifndef LLDB_ELF_CORE_ENUMS_H
Index: 

[Lldb-commits] [PATCH] D40311: elf-core: Split up parsing code into os-specific functions

2017-11-22 Thread Mark Kettenis via Phabricator via lldb-commits
kettenis added a comment.

Looks like a good improvement to me.


https://reviews.llvm.org/D40311



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D40311: elf-core: Split up parsing code into os-specific functions

2017-11-22 Thread Pavel Labath via Phabricator via lldb-commits
labath updated this revision to Diff 123898.
labath added a comment.

Update comments.


https://reviews.llvm.org/D40311

Files:
  source/Plugins/Process/elf-core/ProcessElfCore.cpp
  source/Plugins/Process/elf-core/ProcessElfCore.h
  source/Plugins/Process/elf-core/ThreadElfCore.cpp
  source/Plugins/Process/elf-core/ThreadElfCore.h
  source/Plugins/Process/elf-core/elf-core-enums.h

Index: source/Plugins/Process/elf-core/elf-core-enums.h
===
--- source/Plugins/Process/elf-core/elf-core-enums.h
+++ source/Plugins/Process/elf-core/elf-core-enums.h
@@ -10,6 +10,10 @@
 #ifndef LLDB_ELF_CORE_ENUMS_H
 #define LLDB_ELF_CORE_ENUMS_H
 
+#include "Plugins/ObjectFile/ELF/ObjectFileELF.h"
+#include "lldb/Utility/DataExtractor.h"
+
+namespace lldb_private {
 /// Core files PT_NOTE segment descriptor types
 
 namespace FREEBSD {
@@ -52,4 +56,11 @@
 };
 }
 
+struct CoreNote {
+  ELFNote info;
+  DataExtractor data;
+};
+
+} // namespace lldb_private
+
 #endif // #ifndef LLDB_ELF_CORE_ENUMS_H
Index: source/Plugins/Process/elf-core/ThreadElfCore.h
===
--- source/Plugins/Process/elf-core/ThreadElfCore.h
+++ source/Plugins/Process/elf-core/ThreadElfCore.h
@@ -58,15 +58,15 @@
 
   ELFLinuxPrStatus();
 
-  lldb_private::Status Parse(lldb_private::DataExtractor ,
- lldb_private::ArchSpec );
+  lldb_private::Status Parse(const lldb_private::DataExtractor ,
+ const lldb_private::ArchSpec );
 
   // Return the bytesize of the structure
   // 64 bit - just sizeof
   // 32 bit - hardcoded because we are reusing the struct, but some of the
   // members are smaller -
   // so the layout is not the same
-  static size_t GetSize(lldb_private::ArchSpec );
+  static size_t GetSize(const lldb_private::ArchSpec );
 };
 
 static_assert(sizeof(ELFLinuxPrStatus) == 112,
@@ -79,7 +79,7 @@
 
   ELFLinuxSigInfo();
 
-  lldb_private::Status Parse(lldb_private::DataExtractor ,
+  lldb_private::Status Parse(const lldb_private::DataExtractor ,
  const lldb_private::ArchSpec );
 
   // Return the bytesize of the structure
@@ -114,15 +114,15 @@
 
   ELFLinuxPrPsInfo();
 
-  lldb_private::Status Parse(lldb_private::DataExtractor ,
- lldb_private::ArchSpec );
+  lldb_private::Status Parse(const lldb_private::DataExtractor ,
+ const lldb_private::ArchSpec );
 
   // Return the bytesize of the structure
   // 64 bit - just sizeof
   // 32 bit - hardcoded because we are reusing the struct, but some of the
   // members are smaller -
   // so the layout is not the same
-  static size_t GetSize(lldb_private::ArchSpec );
+  static size_t GetSize(const lldb_private::ArchSpec );
 };
 
 static_assert(sizeof(ELFLinuxPrPsInfo) == 136,
Index: source/Plugins/Process/elf-core/ThreadElfCore.cpp
===
--- source/Plugins/Process/elf-core/ThreadElfCore.cpp
+++ source/Plugins/Process/elf-core/ThreadElfCore.cpp
@@ -259,7 +259,7 @@
   memset(this, 0, sizeof(ELFLinuxPrStatus));
 }
 
-size_t ELFLinuxPrStatus::GetSize(lldb_private::ArchSpec ) {
+size_t ELFLinuxPrStatus::GetSize(const lldb_private::ArchSpec ) {
   constexpr size_t mips_linux_pr_status_size_o32 = 96;
   constexpr size_t mips_linux_pr_status_size_n32 = 72;
   if (arch.IsMIPS()) {
@@ -285,7 +285,8 @@
   }
 }
 
-Status ELFLinuxPrStatus::Parse(DataExtractor , ArchSpec ) {
+Status ELFLinuxPrStatus::Parse(const DataExtractor ,
+   const ArchSpec ) {
   Status error;
   if (GetSize(arch) > data.GetByteSize()) {
 error.SetErrorStringWithFormat(
@@ -334,7 +335,7 @@
   memset(this, 0, sizeof(ELFLinuxPrPsInfo));
 }
 
-size_t ELFLinuxPrPsInfo::GetSize(lldb_private::ArchSpec ) {
+size_t ELFLinuxPrPsInfo::GetSize(const lldb_private::ArchSpec ) {
   constexpr size_t mips_linux_pr_psinfo_size_o32_n32 = 128;
   if (arch.IsMIPS()) {
 uint8_t address_byte_size = arch.GetAddressByteSize();
@@ -355,7 +356,8 @@
   }
 }
 
-Status ELFLinuxPrPsInfo::Parse(DataExtractor , ArchSpec ) {
+Status ELFLinuxPrPsInfo::Parse(const DataExtractor ,
+   const ArchSpec ) {
   Status error;
   ByteOrder byteorder = data.GetByteOrder();
   if (GetSize(arch) > data.GetByteSize()) {
@@ -424,7 +426,7 @@
   }
 }
 
-Status ELFLinuxSigInfo::Parse(DataExtractor , const ArchSpec ) {
+Status ELFLinuxSigInfo::Parse(const DataExtractor , const ArchSpec ) {
   Status error;
   if (GetSize(arch) > data.GetByteSize()) {
 error.SetErrorStringWithFormat(
Index: source/Plugins/Process/elf-core/ProcessElfCore.h
===
--- source/Plugins/Process/elf-core/ProcessElfCore.h
+++ source/Plugins/Process/elf-core/ProcessElfCore.h
@@ -29,6 +29,7 @@
 #include "lldb/Utility/Status.h"
 
 #include 

[Lldb-commits] [PATCH] D40311: elf-core: Split up parsing code into os-specific functions

2017-11-22 Thread Pavel Labath via Phabricator via lldb-commits
labath added inline comments.



Comment at: source/Plugins/Process/elf-core/ProcessElfCore.cpp:735
 ///   (see ELFNote structure)
 /// 3) A Thread Context in a core file usually described by 3 NOTE entries.
 ///a) NT_PRSTATUS - Register context

krytarowski wrote:
> Can we label it as SVR4-style (Linux, FreeBSD, Solaris)? Alternatively move 
> it to other place in order to describe Linux and FreeBSD separately (NetBSD 
> an OpenBSD can be skipped now).
Yeah, I was wondering what to do with that comment -- it is so vague it is 
nearly useless. I agree we should move the core file description to the 
individual OS's parsing functions. I've written a description of the linux 
notes. Freebsd ones seem pretty similar, but don't know enough about them to 
say if the description applies to them as well.


https://reviews.llvm.org/D40311



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D40311: elf-core: Split up parsing code into os-specific functions

2017-11-21 Thread Kamil Rytarowski via Phabricator via lldb-commits
krytarowski added inline comments.



Comment at: source/Plugins/Process/elf-core/ProcessElfCore.cpp:735
 ///   (see ELFNote structure)
 /// 3) A Thread Context in a core file usually described by 3 NOTE entries.
 ///a) NT_PRSTATUS - Register context

Can we label it as SVR4-style (Linux, FreeBSD, Solaris)? Alternatively move it 
to other place in order to describe Linux and FreeBSD separately (NetBSD an 
OpenBSD can be skipped now).


https://reviews.llvm.org/D40311



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D40311: elf-core: Split up parsing code into os-specific functions

2017-11-21 Thread Pavel Labath via Phabricator via lldb-commits
labath added inline comments.



Comment at: source/Plugins/Process/elf-core/ProcessElfCore.cpp:488
+ELFNote note = ELFNote();
+note.Parse(segment, );
+

clayborg wrote:
> Do we need to check anything after parsing a note here to ensure it parsed? 
> Can offset end up not changing and could we get into an infinite loop here? 
> Seems like we should do:
> ```
> if (!note.Parse(segment, ))
>   break;
> ```
Good point. There was no error checking in the original code, but it looks like 
there should be...



Comment at: source/Plugins/Process/elf-core/ProcessElfCore.cpp:763-765
+return llvm::make_error(
+"Don't know how to parse core file. Unsupported OS.",
+llvm::inconvertibleErrorCode());

clayborg wrote:
> This won't cause a crash right?
Only if the caller does not do anything with the result function (and it that 
case, it will assert regardless of whether the function returned an error or 
not).


https://reviews.llvm.org/D40311



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D40311: elf-core: Split up parsing code into os-specific functions

2017-11-21 Thread Pavel Labath via Phabricator via lldb-commits
labath updated this revision to Diff 123816.
labath added a comment.

Address review comments.


https://reviews.llvm.org/D40311

Files:
  source/Plugins/Process/elf-core/ProcessElfCore.cpp
  source/Plugins/Process/elf-core/ProcessElfCore.h
  source/Plugins/Process/elf-core/ThreadElfCore.cpp
  source/Plugins/Process/elf-core/ThreadElfCore.h
  source/Plugins/Process/elf-core/elf-core-enums.h

Index: source/Plugins/Process/elf-core/elf-core-enums.h
===
--- source/Plugins/Process/elf-core/elf-core-enums.h
+++ source/Plugins/Process/elf-core/elf-core-enums.h
@@ -10,6 +10,10 @@
 #ifndef LLDB_ELF_CORE_ENUMS_H
 #define LLDB_ELF_CORE_ENUMS_H
 
+#include "Plugins/ObjectFile/ELF/ObjectFileELF.h"
+#include "lldb/Utility/DataExtractor.h"
+
+namespace lldb_private {
 /// Core files PT_NOTE segment descriptor types
 
 namespace FREEBSD {
@@ -52,4 +56,11 @@
 };
 }
 
+struct CoreNote {
+  ELFNote info;
+  DataExtractor data;
+};
+
+} // namespace lldb_private
+
 #endif // #ifndef LLDB_ELF_CORE_ENUMS_H
Index: source/Plugins/Process/elf-core/ThreadElfCore.h
===
--- source/Plugins/Process/elf-core/ThreadElfCore.h
+++ source/Plugins/Process/elf-core/ThreadElfCore.h
@@ -58,15 +58,15 @@
 
   ELFLinuxPrStatus();
 
-  lldb_private::Status Parse(lldb_private::DataExtractor ,
- lldb_private::ArchSpec );
+  lldb_private::Status Parse(const lldb_private::DataExtractor ,
+ const lldb_private::ArchSpec );
 
   // Return the bytesize of the structure
   // 64 bit - just sizeof
   // 32 bit - hardcoded because we are reusing the struct, but some of the
   // members are smaller -
   // so the layout is not the same
-  static size_t GetSize(lldb_private::ArchSpec );
+  static size_t GetSize(const lldb_private::ArchSpec );
 };
 
 static_assert(sizeof(ELFLinuxPrStatus) == 112,
@@ -79,7 +79,7 @@
 
   ELFLinuxSigInfo();
 
-  lldb_private::Status Parse(lldb_private::DataExtractor ,
+  lldb_private::Status Parse(const lldb_private::DataExtractor ,
  const lldb_private::ArchSpec );
 
   // Return the bytesize of the structure
@@ -114,15 +114,15 @@
 
   ELFLinuxPrPsInfo();
 
-  lldb_private::Status Parse(lldb_private::DataExtractor ,
- lldb_private::ArchSpec );
+  lldb_private::Status Parse(const lldb_private::DataExtractor ,
+ const lldb_private::ArchSpec );
 
   // Return the bytesize of the structure
   // 64 bit - just sizeof
   // 32 bit - hardcoded because we are reusing the struct, but some of the
   // members are smaller -
   // so the layout is not the same
-  static size_t GetSize(lldb_private::ArchSpec );
+  static size_t GetSize(const lldb_private::ArchSpec );
 };
 
 static_assert(sizeof(ELFLinuxPrPsInfo) == 136,
Index: source/Plugins/Process/elf-core/ThreadElfCore.cpp
===
--- source/Plugins/Process/elf-core/ThreadElfCore.cpp
+++ source/Plugins/Process/elf-core/ThreadElfCore.cpp
@@ -259,7 +259,7 @@
   memset(this, 0, sizeof(ELFLinuxPrStatus));
 }
 
-size_t ELFLinuxPrStatus::GetSize(lldb_private::ArchSpec ) {
+size_t ELFLinuxPrStatus::GetSize(const lldb_private::ArchSpec ) {
   constexpr size_t mips_linux_pr_status_size_o32 = 96;
   constexpr size_t mips_linux_pr_status_size_n32 = 72;
   if (arch.IsMIPS()) {
@@ -285,7 +285,8 @@
   }
 }
 
-Status ELFLinuxPrStatus::Parse(DataExtractor , ArchSpec ) {
+Status ELFLinuxPrStatus::Parse(const DataExtractor ,
+   const ArchSpec ) {
   Status error;
   if (GetSize(arch) > data.GetByteSize()) {
 error.SetErrorStringWithFormat(
@@ -334,7 +335,7 @@
   memset(this, 0, sizeof(ELFLinuxPrPsInfo));
 }
 
-size_t ELFLinuxPrPsInfo::GetSize(lldb_private::ArchSpec ) {
+size_t ELFLinuxPrPsInfo::GetSize(const lldb_private::ArchSpec ) {
   constexpr size_t mips_linux_pr_psinfo_size_o32_n32 = 128;
   if (arch.IsMIPS()) {
 uint8_t address_byte_size = arch.GetAddressByteSize();
@@ -355,7 +356,8 @@
   }
 }
 
-Status ELFLinuxPrPsInfo::Parse(DataExtractor , ArchSpec ) {
+Status ELFLinuxPrPsInfo::Parse(const DataExtractor ,
+   const ArchSpec ) {
   Status error;
   ByteOrder byteorder = data.GetByteOrder();
   if (GetSize(arch) > data.GetByteSize()) {
@@ -424,7 +426,7 @@
   }
 }
 
-Status ELFLinuxSigInfo::Parse(DataExtractor , const ArchSpec ) {
+Status ELFLinuxSigInfo::Parse(const DataExtractor , const ArchSpec ) {
   Status error;
   if (GetSize(arch) > data.GetByteSize()) {
 error.SetErrorStringWithFormat(
Index: source/Plugins/Process/elf-core/ProcessElfCore.h
===
--- source/Plugins/Process/elf-core/ProcessElfCore.h
+++ source/Plugins/Process/elf-core/ProcessElfCore.h
@@ -29,6 +29,7 @@
 #include "lldb/Utility/Status.h"
 
 #include 

[Lldb-commits] [PATCH] D40311: elf-core: Split up parsing code into os-specific functions

2017-11-21 Thread Greg Clayton via Phabricator via lldb-commits
clayborg added inline comments.



Comment at: source/Plugins/Process/elf-core/ProcessElfCore.cpp:488
+ELFNote note = ELFNote();
+note.Parse(segment, );
+

Do we need to check anything after parsing a note here to ensure it parsed? Can 
offset end up not changing and could we get into an infinite loop here? Seems 
like we should do:
```
if (!note.Parse(segment, ))
  break;
```



Comment at: source/Plugins/Process/elf-core/ProcessElfCore.cpp:763-765
+return llvm::make_error(
+"Don't know how to parse core file. Unsupported OS.",
+llvm::inconvertibleErrorCode());

This won't cause a crash right?



Comment at: source/Plugins/Process/elf-core/ProcessElfCore.h:32
 #include "Plugins/ObjectFile/ELF/ELFHeader.h"
+#include "Plugins/ObjectFile/ELF/ObjectFileELF.h"
+#include "Plugins/Process/elf-core/elf-core-enums.h"

Why is this needed here? Doesn't seem to be. Can you include only in .cpp file?


https://reviews.llvm.org/D40311



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D40311: elf-core: Split up parsing code into os-specific functions

2017-11-21 Thread Pavel Labath via Phabricator via lldb-commits
labath created this revision.

We've had a single function responsible for splitting a core segment
into notes, and parsing the notes themselves, bearing in mind variations
between 4 supported OS types. This commit splits that code into 5
pieces:

- (os-independent) code for splitting a segment into individual notes
- per-os function for parsing the notes into thread information


https://reviews.llvm.org/D40311

Files:
  source/Plugins/Process/elf-core/ProcessElfCore.cpp
  source/Plugins/Process/elf-core/ProcessElfCore.h
  source/Plugins/Process/elf-core/ThreadElfCore.cpp
  source/Plugins/Process/elf-core/ThreadElfCore.h
  source/Plugins/Process/elf-core/elf-core-enums.h

Index: source/Plugins/Process/elf-core/elf-core-enums.h
===
--- source/Plugins/Process/elf-core/elf-core-enums.h
+++ source/Plugins/Process/elf-core/elf-core-enums.h
@@ -10,6 +10,10 @@
 #ifndef LLDB_ELF_CORE_ENUMS_H
 #define LLDB_ELF_CORE_ENUMS_H
 
+#include "Plugins/ObjectFile/ELF/ObjectFileELF.h"
+#include "lldb/Utility/DataExtractor.h"
+
+namespace lldb_private {
 /// Core files PT_NOTE segment descriptor types
 
 namespace FREEBSD {
@@ -52,4 +56,11 @@
 };
 }
 
+struct CoreNote {
+  ELFNote info;
+  DataExtractor data;
+};
+
+} // namespace lldb_private
+
 #endif // #ifndef LLDB_ELF_CORE_ENUMS_H
Index: source/Plugins/Process/elf-core/ThreadElfCore.h
===
--- source/Plugins/Process/elf-core/ThreadElfCore.h
+++ source/Plugins/Process/elf-core/ThreadElfCore.h
@@ -58,15 +58,15 @@
 
   ELFLinuxPrStatus();
 
-  lldb_private::Status Parse(lldb_private::DataExtractor ,
- lldb_private::ArchSpec );
+  lldb_private::Status Parse(const lldb_private::DataExtractor ,
+ const lldb_private::ArchSpec );
 
   // Return the bytesize of the structure
   // 64 bit - just sizeof
   // 32 bit - hardcoded because we are reusing the struct, but some of the
   // members are smaller -
   // so the layout is not the same
-  static size_t GetSize(lldb_private::ArchSpec );
+  static size_t GetSize(const lldb_private::ArchSpec );
 };
 
 static_assert(sizeof(ELFLinuxPrStatus) == 112,
@@ -79,7 +79,7 @@
 
   ELFLinuxSigInfo();
 
-  lldb_private::Status Parse(lldb_private::DataExtractor ,
+  lldb_private::Status Parse(const lldb_private::DataExtractor ,
  const lldb_private::ArchSpec );
 
   // Return the bytesize of the structure
@@ -114,15 +114,15 @@
 
   ELFLinuxPrPsInfo();
 
-  lldb_private::Status Parse(lldb_private::DataExtractor ,
- lldb_private::ArchSpec );
+  lldb_private::Status Parse(const lldb_private::DataExtractor ,
+ const lldb_private::ArchSpec );
 
   // Return the bytesize of the structure
   // 64 bit - just sizeof
   // 32 bit - hardcoded because we are reusing the struct, but some of the
   // members are smaller -
   // so the layout is not the same
-  static size_t GetSize(lldb_private::ArchSpec );
+  static size_t GetSize(const lldb_private::ArchSpec );
 };
 
 static_assert(sizeof(ELFLinuxPrPsInfo) == 136,
Index: source/Plugins/Process/elf-core/ThreadElfCore.cpp
===
--- source/Plugins/Process/elf-core/ThreadElfCore.cpp
+++ source/Plugins/Process/elf-core/ThreadElfCore.cpp
@@ -259,7 +259,7 @@
   memset(this, 0, sizeof(ELFLinuxPrStatus));
 }
 
-size_t ELFLinuxPrStatus::GetSize(lldb_private::ArchSpec ) {
+size_t ELFLinuxPrStatus::GetSize(const lldb_private::ArchSpec ) {
   constexpr size_t mips_linux_pr_status_size_o32 = 96;
   constexpr size_t mips_linux_pr_status_size_n32 = 72;
   if (arch.IsMIPS()) {
@@ -285,7 +285,8 @@
   }
 }
 
-Status ELFLinuxPrStatus::Parse(DataExtractor , ArchSpec ) {
+Status ELFLinuxPrStatus::Parse(const DataExtractor ,
+   const ArchSpec ) {
   Status error;
   if (GetSize(arch) > data.GetByteSize()) {
 error.SetErrorStringWithFormat(
@@ -334,7 +335,7 @@
   memset(this, 0, sizeof(ELFLinuxPrPsInfo));
 }
 
-size_t ELFLinuxPrPsInfo::GetSize(lldb_private::ArchSpec ) {
+size_t ELFLinuxPrPsInfo::GetSize(const lldb_private::ArchSpec ) {
   constexpr size_t mips_linux_pr_psinfo_size_o32_n32 = 128;
   if (arch.IsMIPS()) {
 uint8_t address_byte_size = arch.GetAddressByteSize();
@@ -355,7 +356,8 @@
   }
 }
 
-Status ELFLinuxPrPsInfo::Parse(DataExtractor , ArchSpec ) {
+Status ELFLinuxPrPsInfo::Parse(const DataExtractor ,
+   const ArchSpec ) {
   Status error;
   ByteOrder byteorder = data.GetByteOrder();
   if (GetSize(arch) > data.GetByteSize()) {
@@ -424,7 +426,7 @@
   }
 }
 
-Status ELFLinuxSigInfo::Parse(DataExtractor , const ArchSpec ) {
+Status ELFLinuxSigInfo::Parse(const DataExtractor , const ArchSpec ) {
   Status error;
   if (GetSize(arch) > data.GetByteSize()) {
 error.SetErrorStringWithFormat(
Index: