[Lldb-commits] [PATCH] D59775: Minidump: Add support for reading/writing strings

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Mar 25 09:12:09 PDT 2019


labath created this revision.
labath added reviewers: jhenderson, zturner, clayborg.
Herald added a project: LLVM.
labath added a parent revision: D59634: Add minidump support to obj2yaml.

Strings in minidump files are stored as a 32-bit length field, giving
the length of the string in *bytes*, which is followed by the
appropriate number of UTF16 code units. The string is also supposed to
be null-terminated, and the null-terminator is not a part of the length
field. This patch:

- adds support for reading these strings out of the minidump file (this implementation does not depend on proper null-termination)
- adds support for writing them to a minidump file
- using the previous two pieces implements proper (de)serialization of the CSDVersion field of the SystemInfo stream. Previously, this was only read/written as hex, and no attempt was made to access the referenced string -- now this string is read and written correctly.

The changes are tested via yaml2obj|obj2yaml round-trip as well as a
unit test which checks the corner cases of the string deserialization
logic.


Repository:
  rL LLVM

https://reviews.llvm.org/D59775

Files:
  include/llvm/Object/Minidump.h
  include/llvm/ObjectYAML/MinidumpYAML.h
  lib/Object/Minidump.cpp
  lib/ObjectYAML/MinidumpYAML.cpp
  test/tools/obj2yaml/basic-minidump.yaml
  unittests/Object/MinidumpTest.cpp
  unittests/ObjectYAML/MinidumpYAMLTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D59775.192121.patch
Type: text/x-patch
Size: 10158 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20190325/d419ac75/attachment-0001.bin>


More information about the lldb-commits mailing list