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
|
|
|
|
2015-10-22 20:06:20 +00:00
|
|
|
|
2013-08-15 02:49:16 +00:00
|
|
|
import os, time
|
|
|
|
import lldb
|
2014-03-25 18:55:48 +00:00
|
|
|
import sys
|
2015-11-03 02:06:18 +00:00
|
|
|
from lldbsuite.test.lldbtest import *
|
2013-08-15 02:49:16 +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'
|
|
|
|
|
2015-09-30 10:12:40 +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."""
|
|
|
|
self.buildDsym(clean=True)
|
|
|
|
exe = os.path.join(os.getcwd(), "a.out")
|
|
|
|
|
|
|
|
self.target = self.dbg.CreateTarget(exe)
|
|
|
|
self.assertTrue(self.target, VALID_TARGET)
|
|
|
|
|
|
|
|
main_bp = self.target.BreakpointCreateByName ("main", "a.out")
|
|
|
|
self.assertTrue(main_bp, VALID_BREAKPOINT)
|
|
|
|
|
|
|
|
self.runCmd("settings set target.disable-aslr false")
|
2013-12-13 19:18:59 +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)
|
|
|
|
|
|
|
|
self.runCmd("add-dsym hide.app/Contents/a.out.dSYM")
|
|
|
|
|
|
|
|
self.expect("frame select",
|
|
|
|
substrs = ['a.out`main at main.c'])
|