[all-commits] [llvm/llvm-project] cf3f10: [lldb][test] Prevent infinite loop while looking f...

Jordan Rupprecht via All-commits all-commits at lists.llvm.org
Wed Jul 15 09:58:09 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: cf3f100fcbf94af499501140590b322b4985c1a3
      https://github.com/llvm/llvm-project/commit/cf3f100fcbf94af499501140590b322b4985c1a3
  Author: Jordan Rupprecht <rupprecht at google.com>
  Date:   2020-07-15 (Wed, 15 Jul 2020)

  Changed paths:
    M lldb/packages/Python/lldbsuite/__init__.py
    M lldb/scripts/use_lldb_suite.py
    M lldb/test/API/use_lldb_suite.py

  Log Message:
  -----------
  [lldb][test] Prevent infinite loop while looking for use_lldb_suite_root.py.

Several scripts (two copies of use_lldb_suite.py, and an __init__.py) look for use_lldb_suite_root.py by checking parent directories. If for some reason it doesn't exist, it keeps checking parent directories until it finds it.

However, this only breaks when the parent directory is None, but at least on Linux, dirname('/') == '/', so this will never be None.

This changes the lookup to stop if the dirname(lldb_root) is unchanged. This was previously fixed in 67f6d842fab6d3ac8c949721be8e131cf6b17578, but only in one copy of this script.

Additionally, this makes the failure mode more visible -- if the root is not found, it complains loudly instead of silently failing, and having later modules that need lldb_root fail.

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




More information about the All-commits mailing list