[Lldb-commits] [PATCH] D26676: Patch for lldb bug 26322 “core load hangs”

Greg Clayton via lldb-commits lldb-commits at lists.llvm.org
Tue Nov 15 09:05:48 PST 2016


clayborg requested changes to this revision.
clayborg added a comment.
This revision now requires changes to proceed.

Just a few quick changes.



================
Comment at: source/Plugins/Process/elf-core/ProcessElfCore.cpp:208-209
+  // Check we found a signal in a SIGINFO note.
+  for (std::vector<ThreadData>::iterator it = m_thread_data.begin();
+      it != m_thread_data.end(); ++it) {
+    if (it->signo != 0)
----------------
If you are just iterating (not also wanting indexes, or keeping any iterators in the for loop) then use:

```
for (const auto &thread_data: m_thread_data) {
  if (thread_data.signo != 0)
    siginfo_signal_found = true;
  if (thread_data.prstatus_sig != 0)
    prstatus_signal_found = true;
}
```


================
Comment at: source/Plugins/Process/elf-core/ProcessElfCore.cpp:219-220
+    if( prstatus_signal_found == true) {
+      for (std::vector<ThreadData>::iterator it = m_thread_data.begin();
+          it != m_thread_data.end(); ++it)
+        it->signo = it->prstatus_sig;
----------------
```
for (const auto &thread_data: m_thread_data) {
```


================
Comment at: source/Plugins/Process/elf-core/ThreadElfCore.h:93
+  lldb_private::Error Parse(lldb_private::DataExtractor &data,
+                            lldb_private::ArchSpec &arch);
+
----------------
add const to "arch":
```
const lldb_private::ArchSpec &arch
```


================
Comment at: source/Plugins/Process/elf-core/ThreadElfCore.h:100
+  // so the layout is not the same
+  static size_t GetSize(lldb_private::ArchSpec &arch) {
+    switch (arch.GetCore()) {
----------------
Add const:

```const lldb_private::ArchSpec &arch```


https://reviews.llvm.org/D26676





More information about the lldb-commits mailing list