summaryrefslogtreecommitdiff
path: root/lldb/test/API/python_api/sbmodule/TestSBModule.py
AgeCommit message (Collapse)Author
2025-08-19[LLDB] added getName method in SBModule (#150331)barsolo2000
added getName method in SBModule.h and .cpp in order to get the name of the module from m_object_name. --------- Co-authored-by: Bar Soloveychik <barsolo@fb.com>
2024-02-21[lldb][test] Modernize asserts (#82503)Jordan Rupprecht
This uses [teyit](https://pypi.org/project/teyit/) to modernize asserts, as recommended by the [unittest release notes](https://docs.python.org/3.12/whatsnew/3.12.html#id3). For example, `assertTrue(a == b)` is replaced with `assertEqual(a, b)`. This produces better error messages, e.g. `error: unexpectedly found 1 and 2 to be different` instead of `error: False`.
2023-05-25[NFC][Py Reformat] Reformat python files in lldbJonas Devlieghere
This is an ongoing series of commits that are reformatting our Python code. Reformatting is done with `black` (23.1.0). If you end up having problems merging this commit because you have made changes to a python file, the best way to handle that is to run `git checkout --ours <yourfile>` and then reformat it with black. RFC: https://discourse.llvm.org/t/rfc-document-and-standardize-python-code-style Differential revision: https://reviews.llvm.org/D151460
2022-09-12Reland "[lldb] Use just-built libcxx for tests when available"Felipe de Azevedo Piovezan
This commit improves upon cc0b5ebf7fc8, which added support for specifying which libcxx to use when testing LLDB. That patch honored requests by tests that had `USE_LIBCPP=1` defined in their makefiles. Now, we also use a non-default libcxx if all conditions below are true: 1. The test is not explicitly requesting the use of libstdcpp (USE_LIBSTDCPP=1). 2. The test is not explicitly requesting the use of the system's library (USE_SYSTEM_STDLIB=1). 3. A path to libcxx was either provided by the user through CMake flags or libcxx was built together with LLDB. Condition (2) is new and introduced in this patch in order to support tests that are either: * Cross-platform (such as API/macosx/macCatalyst and API/tools/lldb-server). The just-built libcxx is usually not built for platforms other than the host's. * Cross-language (such as API/lang/objc/exceptions). In this case, the Objective C runtime throws an exceptions that always goes through the system's libcxx, instead of the just built libcxx. Fixing this would require either changing the install-name of the just built libcxx in Mac systems, or tuning the DYLD_LIBRARY_PATH variable at runtime. Some other tests exposes limitations of LLDB when running with a debug standard library. TestDbgInfoContentForwardLists had an assertion removed, as it was checking for buggy LLDB behavior (which now crashes). TestFixIts had a variable renamed, as the old name clashes with a standard library name when debug info is present. This is a known issue: https://github.com/llvm/llvm-project/issues/34391. For `TestSBModule`, the way the "main" module is found was changed to look for the "a.out" module, instead of relying on the index being 0. In some systems, the index 0 is dyld when a custom standard library is used. Differential Revision: https://reviews.llvm.org/D132940
2022-09-08Revert "[lldb] Use just-built libcxx for tests when available"Felipe de Azevedo Piovezan
This reverts commit c38eeecbc7d929c9601f2189214a7a90d3982a47.
2022-09-08[lldb] Use just-built libcxx for tests when availableFelipe de Azevedo Piovezan
This commit improves upon cc0b5ebf7fc8, which added support for specifying which libcxx to use when testing LLDB. That patch honored requests by tests that had `USE_LIBCPP=1` defined in their makefiles. Now, we also use a non-default libcxx if all conditions below are true: 1. The test is not explicitly requesting the use of libstdcpp (USE_LIBSTDCPP=1). 2. The test is not explicitly requesting the use of the system's library (USE_SYSTEM_STDLIB=1). 3. A path to libcxx was either provided by the user through CMake flags or libcxx was built together with LLDB. Condition (2) is new and introduced in this patch in order to support tests that are either: * Cross-platform (such as API/macosx/macCatalyst and API/tools/lldb-server). The just-built libcxx is usually not built for platforms other than the host's. * Cross-language (such as API/lang/objc/exceptions). In this case, the Objective C runtime throws an exceptions that always goes through the system's libcxx, instead of the just built libcxx. Fixing this would require either changing the install-name of the just built libcxx in Mac systems, or tuning the DYLD_LIBRARY_PATH variable at runtime. Some other tests exposes limitations of LLDB when running with a debug standard library. TestDbgInfoContentForwardLists had an assertion removed, as it was checking for buggy LLDB behavior (which now crashes). TestFixIts had a variable renamed, as the old name clashes with a standard library name when debug info is present. This is a known issue: https://github.com/llvm/llvm-project/issues/34391. For `TestSBModule`, the way the "main" module is found was changed to look for the "a.out" module, instead of relying on the index being 0. In some systems, the index 0 is dyld when a custom standard library is used. Differential Revision: https://reviews.llvm.org/D132940
2022-06-17[lldb][tests] Automatically call compute_mydir (NFC)Dave Lee
Eliminate boilerplate of having each test manually assign to `mydir` by calling `compute_mydir` in lldbtest.py. Differential Revision: https://reviews.llvm.org/D128077
2022-04-08[lldb] Skip a bunch of tests that shouldn't run remotelyJonas Devlieghere
Skip a bunch of tests that don't really make sense to run remotely.
2022-02-14[lldb] Replace asserts on .Success() with assertSuccess()Dave Lee
Replace forms of `assertTrue(err.Success())` with `assertSuccess(err)` (added in D82759). * `assertSuccess` prints out the error's message * `assertSuccess` expresses explicit higher level semantics, both to the reader and for test failure output * `assertSuccess` seems not to be well known, using it where possible will help spread knowledge * `assertSuccess` statements are more succinct Differential Revision: https://reviews.llvm.org/D119616
2022-01-27[lldb/test] Skip TestSBModule unless darwinMed Ismail Bennani
Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2022-01-27Revert "[lldb/test] Try to fix TestSBModule failure"Med Ismail Bennani
This reverts commit 326516448c839d8f9cc515b20a34d0f3a6ee2374.
2022-01-27[lldb/test] Try to fix TestSBModule failureMed Ismail Bennani
This should fix https://lab.llvm.org/buildbot/#/builders/68/builds/25571 Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2022-01-26[lldb/API] Add ability to check if module is backed by a file on diskMed Ismail Bennani
This patch introduces a new SBAPI method: `SBModule::IsFileBacked` As the name suggests, it tells the user if the module's object file is on disk or in memory. rdar://68538278 Differential Revision: https://reviews.llvm.org/D118261 Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>