[all-commits] [llvm/llvm-project] 58c4fa: [lldb/Reproducers] Use LLDB_RECORD_DUMMY for GetSt...

Jonas Devlieghere via All-commits all-commits at lists.llvm.org
Thu Jan 30 15:52:57 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 58c4fa2c538a73527aeeb4c7535016d9b9a1df18
      https://github.com/llvm/llvm-project/commit/58c4fa2c538a73527aeeb4c7535016d9b9a1df18
  Author: Jonas Devlieghere <jonas at devlieghere.com>
  Date:   2020-01-30 (Thu, 30 Jan 2020)

  Changed paths:
    M lldb/source/API/SBThread.cpp

  Log Message:
  -----------
  [lldb/Reproducers] Use LLDB_RECORD_DUMMY for GetStopDescription

GetStopDescription writes to a const char* with a given length. However,
the reproducer instrumentation serialized the char pointer and length
separately.

To serialize the string, we naively look for the first null byte to
determine its length. This can lead to the method overwriting the input
buffer when the assumed string length is smaller than the actual number
of bytes written by GetStopDescription.

The real solution is to have a custom serializer that takes both
arguments into account. However, given that these are output parameters,
they don't affect replay. If the string is passed as input later, it's
is recorded as such. Therefore I've replaced the instrumentation macro
with LLDB_RECORD_DUMMY which skips the serialization.


  Commit: 457a6d49d565075ae99f0e5a931bbed6512dce2f
      https://github.com/llvm/llvm-project/commit/457a6d49d565075ae99f0e5a931bbed6512dce2f
  Author: Jonas Devlieghere <jonas at devlieghere.com>
  Date:   2020-01-30 (Thu, 30 Jan 2020)

  Changed paths:
    M lldb/test/Shell/CMakeLists.txt
    M lldb/test/Shell/SymbolFile/DWARF/debug_loc.s
    M lldb/utils/lldb-repro/lldb-repro.py

  Log Message:
  -----------
  [lldb/Reproducers] Fix typo in CMake so we actually replay.

The CMakeLists.txt had a typo which meant that check-lldb-repro was
capturing twice instead of capturing and then replaying. This also
uncovered a missing import in lldb-repro.py. This patch fixes both
issues.


Compare: https://github.com/llvm/llvm-project/compare/6a4acb9d809a...457a6d49d565


More information about the All-commits mailing list