[Lldb-commits] [PATCH] D24919: Adding a RegisterContextMinidump_x86_64 converter

Zachary Turner via lldb-commits lldb-commits at lists.llvm.org
Mon Sep 26 10:36:39 PDT 2016


zturner added inline comments.

================
Comment at: source/Plugins/Process/minidump/RegisterContextMinidump_x86_64.cpp:49
@@ +48,3 @@
+    writeRegister(source_data, result_base, &reg_info[lldb_cs_x86_64], 2);
+  }
+
----------------
dvlahovski wrote:
> sizeof(uint16_t), sizeof(uint32_t), etc ?
I think my comments got out of line and this is no longer at the position I suggested it.  that said, I actually didn't notice all these constants being passed into `writeRegister`.  I would propose changing this.  Find the `RegisterInfo` class in `lldb-private-types.h` and add the following methods:

```
llvm::ArrayRef<uint8_t> data(const uint8_t *context_base) const { 
  return llvm::ArrayRef<uint8_t>(context_base + byte_offset, byte_size);
}

llvm::MutableArrayRef<uint8_t> mutable_data(uint8_t *context_base) const {
  return llvm::MutableArrayRef<uint8_t>(context_base + byte_offset, byte_size);
}
```

Then you can write:

```writeRegister(source_data, reg_info[lldb_cs_x86_64].mutable_data(result_base));```


https://reviews.llvm.org/D24919





More information about the lldb-commits mailing list