Skip to content

Commit 2b30fc2

Browse files
committed
Fix two bugs with stack corefiles patch, restrict test built debugserver
These two tests, TestSkinnyCorefile.py and TestStackCorefile.py, require a new debugserver on darwin systems to run correctly; for now, skip them if the system debugserver is in use. There's no easy way to test if the debugserver being used supports either of these memory region info features. For end users, the fallback will be a full corefile and that's not the worst thing, but for the tests it is a problem.
1 parent 73056f2 commit 2b30fc2

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6616,6 +6616,7 @@ bool ObjectFileMachO::SaveCore(const lldb::ProcessSP &process_sp,
66166616
std::vector<page_object> combined_page_objects;
66176617
page_object last_obj;
66186618
last_obj.addr = LLDB_INVALID_ADDRESS;
6619+
last_obj.size = 0;
66196620
for (page_object obj : pages_to_copy) {
66206621
if (last_obj.addr == LLDB_INVALID_ADDRESS) {
66216622
last_obj = obj;
@@ -6629,12 +6630,10 @@ bool ObjectFileMachO::SaveCore(const lldb::ProcessSP &process_sp,
66296630
combined_page_objects.push_back(last_obj);
66306631
last_obj = obj;
66316632
}
6632-
6633-
// If we only ended up with one contiguous memory segment
6634-
if (combined_page_objects.size() == 0 &&
6635-
last_obj.addr != LLDB_INVALID_ADDRESS) {
6633+
// Add the last entry we were looking to combine
6634+
// on to the array.
6635+
if (last_obj.addr != LLDB_INVALID_ADDRESS && last_obj.size != 0)
66366636
combined_page_objects.push_back(last_obj);
6637-
}
66386637

66396638
for (page_object obj : combined_page_objects) {
66406639
uint32_t cmd_type = LC_SEGMENT_64;

lldb/test/API/macosx/skinny-corefile/TestSkinnyCorefile.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ class TestSkinnyCorefile(TestBase):
1616

1717
mydir = TestBase.compute_mydir(__file__)
1818

19+
@skipIfOutOfTreeDebugserver # newer debugserver required for these qMemoryRegionInfo types
1920
@skipIf(debug_info=no_match(["dsym"]), bugnumber="This test is looking explicitly for a dSYM")
2021
@skipUnlessDarwin
2122
def test_lc_note(self):

lldb/test/API/macosx/stack-corefile/TestStackCorefile.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ class TestStackCorefile(TestBase):
1313

1414
mydir = TestBase.compute_mydir(__file__)
1515

16+
@skipIfOutOfTreeDebugserver # newer debugserver required for these qMemoryRegionInfo types
1617
@no_debug_info_test
1718
@skipUnlessDarwin
1819
def test(self):

lldb/tools/debugserver/source/RNBRemote.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4311,6 +4311,7 @@ rnb_err_t RNBRemote::HandlePacket_MemoryRegionInfo(const char *p) {
43114311
}
43124312
ostrm << ";";
43134313
if (!region_info.vm_types.empty()) {
4314+
ostrm << "type:";
43144315
for (size_t i = 0; i < region_info.vm_types.size(); i++) {
43154316
if (i)
43164317
ostrm << ",";

0 commit comments

Comments
 (0)