[all-commits] [llvm/llvm-project] aaa9f4: [lldb/test] Replace gnu-style-compression.cpp with...

Pavel Labath via All-commits all-commits at lists.llvm.org
Thu Jan 27 01:05:56 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: aaa9f40e3fd2dd081e965d39f10649bcd8bf1d21
      https://github.com/llvm/llvm-project/commit/aaa9f40e3fd2dd081e965d39f10649bcd8bf1d21
  Author: Pavel Labath <pavel at labath.sk>
  Date:   2022-01-27 (Thu, 27 Jan 2022)

  Changed paths:
    R lldb/test/Shell/SymbolFile/DWARF/x86/gnu-style-compression.cpp
    A lldb/test/Shell/SymbolFile/DWARF/x86/gnu-style-compression.yaml

  Log Message:
  -----------
  [lldb/test] Replace gnu-style-compression.cpp with a yaml file

In D117744, llvm removed writing support for this format, breaking the
test. We may eventually want to remove reading support as well, but for
now I have converted the test to a yaml file to maintain coverage.


  Commit: 7afd05211282c7516f0e9b3e7743b5dcc2605491
      https://github.com/llvm/llvm-project/commit/7afd05211282c7516f0e9b3e7743b5dcc2605491
  Author: Pavel Labath <pavel at labath.sk>
  Date:   2022-01-27 (Thu, 27 Jan 2022)

  Changed paths:
    M lldb/include/lldb/Core/UniqueCStringMap.h
    M lldb/source/Plugins/SymbolFile/DWARF/NameToDIE.cpp
    M lldb/unittests/Core/UniqueCStringMapTest.cpp

  Log Message:
  -----------
  [lldb/DWARF] Make manual dwarf index deterministic

Currently, running the test suite with LLVM_ENABLE_EXPENSIVE_CHECKS=On
causes a couple of tests to fail. This happens because they expect a
certain order of variables (all of them happen to use the "target
variable" command, but other lookup functions should suffer from the
same issues), all of which have the same name. Sort algorithms often
preserve the order of equivalent elements (in this case the entries in
the NameToDIE map), but that not guaranteed, and
LLVM_ENABLE_EXPENSIVE_CHECKS stresses that by pre-shuffling all inputs
before sorting.

While this could easily be fixed by relaxing the test expectations,
having a deterministic output seems like a worthwhile goal,
particularly, as this could have bigger consequences than just a
different print order -- in some cases we just pick the first entry that
we find, whatever that is. Therefore this patch makes the sort
deterministic by introducing another sort key -- UniqueCString::Sort
gets a value comparator functor, which can be used to sort elements with
the same name -- in the DWARF case we use DIERef::operator<, which
roughly equals the order in which the entries appear in the debug info,
and matches the current "accidental" order.

Using a extra functor seemed preferable to using stable_sort, as the
latter allocates extra O(n) of temporary memory.

I observed no difference in debug info parsing speed with this patch
applied.

Differential Revision: https://reviews.llvm.org/D118251


  Commit: 6730df4779cd2f6328fe8cb6dec1dced8cabe4c5
      https://github.com/llvm/llvm-project/commit/6730df4779cd2f6328fe8cb6dec1dced8cabe4c5
  Author: Pavel Labath <pavel at labath.sk>
  Date:   2022-01-27 (Thu, 27 Jan 2022)

  Changed paths:
    M lldb/source/Plugins/Process/Windows/Common/DebuggerThread.cpp
    M lldb/source/Plugins/Process/Windows/Common/NativeProcessWindows.cpp
    M lldb/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_WoW64.cpp
    M lldb/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_arm.cpp
    M lldb/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_arm64.cpp
    M lldb/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_i386.cpp
    M lldb/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_x86_64.cpp
    M lldb/source/Plugins/Process/Windows/Common/ProcessDebugger.cpp
    M lldb/source/Plugins/Process/Windows/Common/ProcessWindows.cpp
    M lldb/source/Plugins/Process/Windows/Common/ProcessWindowsLog.h
    M lldb/source/Plugins/Process/Windows/Common/RegisterContextWindows.cpp
    M lldb/source/Plugins/Process/Windows/Common/x86/RegisterContextWindows_x86.cpp

  Log Message:
  -----------
  [lldb] Convert ProcessWindowsLog to the new API


Compare: https://github.com/llvm/llvm-project/compare/52fddcdd9c90...6730df4779cd


More information about the All-commits mailing list