2013-08-15 02:49:16 +00:00
|
|
|
"""Test that the 'add-dsym', aka 'target symbols add', succeeds in the middle of debug session."""
|
|
|
|
|
2015-10-23 17:04:29 +00:00
|
|
|
from __future__ import print_function
|
|
|
|
|
2015-11-03 19:20:39 +00:00
|
|
|
|
2013-08-15 02:49:16 +00:00
|
|
|
import lldb
|
2016-02-04 23:04:17 +00:00
|
|
|
from lldbsuite.test.decorators import *
|
2015-11-03 02:06:18 +00:00
|
|
|
from lldbsuite.test.lldbtest import *
|
2016-02-04 23:04:17 +00:00
|
|
|
from lldbsuite.test import lldbutil
|
2013-08-15 02:49:16 +00:00
|
|
|
|
2016-09-06 20:57:50 +00:00
|
|
|
|
2015-03-30 14:12:17 +00:00
|
|
|
@skipUnlessDarwin
|
2013-08-15 02:49:16 +00:00
|
|
|
class AddDsymMidExecutionCommandCase(TestBase):
|
|
|
|
|
2013-12-10 23:19:29 +00:00
|
|
|
mydir = TestBase.compute_mydir(__file__)
|
2013-08-15 02:49:16 +00:00
|
|
|
|
|
|
|
def setUp(self):
|
|
|
|
# Call super's setUp().
|
|
|
|
TestBase.setUp(self)
|
|
|
|
self.source = 'main.c'
|
|
|
|
|
2016-09-06 20:57:50 +00:00
|
|
|
@no_debug_info_test # Prevent the genaration of the dwarf version of this test
|
2013-08-15 02:49:16 +00:00
|
|
|
def test_add_dsym_mid_execution(self):
|
|
|
|
"""Test that add-dsym mid-execution loads the symbols at the right place for a slid binary."""
|
[dotest] Clean up test folder clean-up
Summary:
This patch implements a unified way of cleaning the build folder of each
test. This is done by completely removing the build folder before each
test, in the respective setUp() method. Previously, we were using a
combination of several methods, each with it's own drawbacks:
- nuking the entire build tree before running dotest: the issue here is
that this did not take place if you ran dotest manually
- running "make clean" before the main "make" target: this relied on the
clean command being correctly implemented. This was usually true, but
not always.
- for files which were not produced by make, each python file was
responsible for ensuring their deleting, using a variety of methods.
With this approach, the previous methods become redundant. I remove the
first two, since they are centralized. For the other various bits of
clean-up code in python files, I indend to delete it when I come
across it.
Reviewers: aprantl
Subscribers: emaste, ki.stfu, mgorny, eraman, lldb-commits
Differential Revision: https://reviews.llvm.org/D44526
llvm-svn: 327703
2018-03-16 12:04:46 +00:00
|
|
|
self.buildDefault(dictionary={'MAKE_DSYM':'YES'})
|
2018-01-19 23:24:35 +00:00
|
|
|
exe = self.getBuildArtifact("a.out")
|
2013-08-15 02:49:16 +00:00
|
|
|
|
|
|
|
self.target = self.dbg.CreateTarget(exe)
|
|
|
|
self.assertTrue(self.target, VALID_TARGET)
|
|
|
|
|
2016-09-06 20:57:50 +00:00
|
|
|
main_bp = self.target.BreakpointCreateByName("main", "a.out")
|
2013-08-15 02:49:16 +00:00
|
|
|
self.assertTrue(main_bp, VALID_BREAKPOINT)
|
|
|
|
|
|
|
|
self.runCmd("settings set target.disable-aslr false")
|
2016-09-06 20:57:50 +00:00
|
|
|
self.process = self.target.LaunchSimple(
|
|
|
|
None, None, self.get_process_working_directory())
|
2013-08-15 02:49:16 +00:00
|
|
|
self.assertTrue(self.process, PROCESS_IS_VALID)
|
|
|
|
|
|
|
|
# The stop reason of the thread should be breakpoint.
|
|
|
|
self.assertTrue(self.process.GetState() == lldb.eStateStopped,
|
|
|
|
STOPPED_DUE_TO_BREAKPOINT)
|
|
|
|
|
2018-01-19 23:24:35 +00:00
|
|
|
self.runCmd("add-dsym " +
|
|
|
|
self.getBuildArtifact("hide.app/Contents/a.out.dSYM"))
|
2013-08-15 02:49:16 +00:00
|
|
|
|
|
|
|
self.expect("frame select",
|
2016-09-06 20:57:50 +00:00
|
|
|
substrs=['a.out`main at main.c'])
|