This is an archive of the discontinued LLVM Phabricator instance.

Add test that shows the problem with D118814
AbandonedPublic

Authored by emrekultursay on Aug 12 2022, 5:40 PM.

Details

Reviewers
JDevlieghere
Summary

The test is identical to API/lang/c/stepping/ except:

  1. It uses C++ and thus needs demangling support
  2. It uses dynamic library, and tries to step into a function that is defined in the library.

Test fails with:

  File "...llvm-project/lldb/test/API/lang/cpp/stepping/TestStepAndBreakpointsCpp.py", line 252, in test_and_python_api
    self.assertEqual(thread.GetFrameAtIndex(0).GetFunctionName(), "b(int)")
AssertionError: 'main' != 'b(int)'

...because it fails to step into the b(int) method and hits the next
breakpoint inside the main method.

Diff Detail

Event Timeline

emrekultursay created this revision.Aug 12 2022, 5:40 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 12 2022, 5:40 PM
emrekultursay requested review of this revision.Aug 12 2022, 5:40 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 12 2022, 5:40 PM
emrekultursay retitled this revision from Add test that shows the problem with aed965d5 to Add test that shows the problem with D118814.

I applied your patch and ran the test and for me it's passing:

lldb version 16.0.0git (git@github.com:llvm/llvm-project.git revision 0c90d5f7e967aee8ab6e5e971e25921e631a40ac)
  clang revision 0c90d5f7e967aee8ab6e5e971e25921e631a40ac
  llvm revision 0c90d5f7e967aee8ab6e5e971e25921e631a40ac
Skipping the following test categories: ['libstdcxx', 'dwo', 'llgs', 'fork']

--
Command Output (stderr):
--
PASS: LLDB (/Users/jonas/llvm/build-ra/bin/clang-arm64) :: test_and_python_api_dsym (TestStepAndBreakpointsCpp.TestCppStepping)
PASS: LLDB (/Users/jonas/llvm/build-ra/bin/clang-arm64) :: test_and_python_api_dwarf (TestStepAndBreakpointsCpp.TestCppStepping)
UNSUPPORTED: LLDB (/Users/jonas/llvm/build-ra/bin/clang-arm64) :: test_and_python_api_dwo (TestStepAndBreakpointsCpp.TestCppStepping) (test case does not fall in any category of interest for this run)
PASS: LLDB (/Users/jonas/llvm/build-ra/bin/clang-arm64) :: test_and_python_api_gmodules (TestStepAndBreakpointsCpp.TestCppStepping)
----------------------------------------------------------------------
Ran 4 tests in 5.234s

RESULT: PASSED (3 passes, 0 failures, 0 errors, 1 skipped, 0 expected failures, 0 unexpected successes)

I applied your patch and ran the test and for me it's passing:

Thanks Jonas, I believe https://reviews.llvm.org/D127999 (and follow-ups) fixed the bug I was observing. I was sync'ed to a version older than that patch, that's why I didn't notice it was fixed. I synced to head and I don't reproduce it either.

emrekultursay abandoned this revision.Aug 15 2022, 11:49 AM

Great. Thanks for closing the loop on this!