diff options
author | Ted Woodward <ted.woodward@codeaurora.org> | 2018-09-10 18:19:01 +0000 |
---|---|---|
committer | Ted Woodward <ted.woodward@codeaurora.org> | 2018-09-10 18:19:01 +0000 |
commit | 860bafa07d7be231a35472bfd71b5e5ca28ae5a2 (patch) | |
tree | 4f6f6c2b297e368df58a18ede1b466ce6a336168 /lldb/packages/Python/lldbsuite/test | |
parent | bef0941b6b4b01374f24d5d0d3155826e015c231 (diff) | |
download | bcm5719-llvm-860bafa07d7be231a35472bfd71b5e5ca28ae5a2.tar.gz bcm5719-llvm-860bafa07d7be231a35472bfd71b5e5ca28ae5a2.zip |
Fix raw address breakpoints not resolving
Summary: An address breakpoint of the form "b 0x1000" won't resolve if it's created while the process isn't running. This patch deletes Address::SectionWasDeleted, renames Address::SectionWasDeletedPrivate to SectionWasDeleted (and makes it public), and changes the section check in Breakpoint::ModulesChanged back to its original form
Reviewers: jingham, #lldb
Reviewed By: jingham
Subscribers: davide, lldb-commits
Differential Revision: https://reviews.llvm.org/D51816
llvm-svn: 341849
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test')
-rw-r--r-- | lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/address_breakpoints/TestAddressBreakpoints.py | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/address_breakpoints/TestAddressBreakpoints.py b/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/address_breakpoints/TestAddressBreakpoints.py index 46191d85296..5d778023748 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/address_breakpoints/TestAddressBreakpoints.py +++ b/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/address_breakpoints/TestAddressBreakpoints.py @@ -97,3 +97,40 @@ class AddressBreakpointTestCase(TestBase): # The hit count for the breakpoint should now be 2. self.assertTrue(breakpoint.GetHitCount() == 2) + + + + def test_address_breakpoint_set_before_launch(self): + """Test that an address bp set before the process is launched works correctly.""" + self.build() + + exe = self.getBuildArtifact("a.out") + + # Create a target by the debugger. + target = self.dbg.CreateTarget(exe) + self.assertTrue(target, VALID_TARGET) + + # get the address of the symbol "main" + sc_list = target.FindSymbols("main", lldb.eSymbolTypeCode) + symbol = sc_list.GetContextAtIndex(0).GetSymbol() + address = symbol.GetStartAddress().GetFileAddress() + + # BreakpointCreateBySBAddress will resolve the address, causing this + # test to always pass, so use runCmd + self.runCmd("break set -a " + str(address)) + + # Disable ASLR. This will allow us to actually test (on platforms that support this flag) + # that the breakpoint was able to track the module. + + launch_info = lldb.SBLaunchInfo(None) + flags = launch_info.GetLaunchFlags() + flags &= ~lldb.eLaunchFlagDisableASLR + launch_info.SetLaunchFlags(flags) + + error = lldb.SBError() + + process = target.Launch(launch_info, error) + self.assertTrue(process, PROCESS_IS_VALID) + self.expect("process status", STOPPED_DUE_TO_BREAKPOINT, + substrs=["stop reason = breakpoint 1.1"]) + |