[all-commits] [llvm/llvm-project] 047c4b: [lldb/Target] Fix `frame recognizer list` crash wh...

Med Ismail Bennani via All-commits all-commits at lists.llvm.org
Fri Feb 7 08:36:22 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 047c4b0369f05ba2f96c79151641f07035bec954
      https://github.com/llvm/llvm-project/commit/047c4b0369f05ba2f96c79151641f07035bec954
  Author: Med Ismail Bennani <medismail.bennani at gmail.com>
  Date:   2020-02-07 (Fri, 07 Feb 2020)

  Changed paths:
    M lldb/source/Target/StackFrameRecognizer.cpp
    M lldb/unittests/Target/CMakeLists.txt
    A lldb/unittests/Target/StackFrameRecognizerTest.cpp

  Log Message:
  -----------
  [lldb/Target] Fix `frame recognizer list` crash when registered with nullptr

One way to register a recognizer is to use RegularExpressionSP for the
module and symbol.

In order to match a symbol regardless of the module, the recognizer can
be registered with a nullptr for the module. However, this cause the
frame recognizer list command to crash because it calls
RegularExpression::GetText without checking if the shared pointer is valid.

This patch adds checks for the symbol and module RegularExpressionSP.

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

Signed-off-by: Med Ismail Bennani <medismail.bennani at gmail.com>


  Commit: 96054a1857e597ec15c36b935ea076a550047f02
      https://github.com/llvm/llvm-project/commit/96054a1857e597ec15c36b935ea076a550047f02
  Author: Med Ismail Bennani <medismail.bennani at gmail.com>
  Date:   2020-02-07 (Fri, 07 Feb 2020)

  Changed paths:
    M lldb/packages/Python/lldbsuite/test/commands/frame/recognizer/TestFrameRecognizer.py

  Log Message:
  -----------
  [lldb/test] Prevent TestFrameRecognizer.py to fail because of internal recognizers (NFC)

By clearing the recognizers before starting the test, we ensure that the
recognizers that get initialized when lldb starts won't alter the
expected results of this test (i.e. recognizer index).

Signed-off-by: Med Ismail Bennani <medismail.bennani at gmail.com>


Compare: https://github.com/llvm/llvm-project/compare/380fe91fc6dd...96054a1857e5


More information about the All-commits mailing list