Skip to content

[lldb] Fix AppleObjCDeclVendor for classes which have no methods #145452

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -552,9 +552,8 @@ bool ClassDescriptorV2::Describe(
} else {
std::optional<method_list_t> base_method_list =
GetMethodList(process, class_ro->m_baseMethods_ptr);
if (!base_method_list)
return false;
if (!ProcessMethodList(instance_method_func, *base_method_list))
if (base_method_list &&
!ProcessMethodList(instance_method_func, *base_method_list))
return false;
}
}
Expand Down
5 changes: 5 additions & 0 deletions lldb/test/API/lang/objc/class-without-methods/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
OBJC_SOURCES := Point.m main.m
include Makefile.rules

# Only objc metadata, no debug info, for Point.m
Point.o: CFLAGS_EXTRAS += -g0
4 changes: 4 additions & 0 deletions lldb/test/API/lang/objc/class-without-methods/Point.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#import <objc/NSObject.h>

@interface Point : NSObject
@end
7 changes: 7 additions & 0 deletions lldb/test/API/lang/objc/class-without-methods/Point.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#import "Point.h"

@implementation Point {
float _x;
float _y;
}
@end
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil


class TestCase(TestBase):
def test(self):
self.build()
lldbutil.run_to_source_breakpoint(self, "break here", lldb.SBFileSpec("main.m"))
self.expect("frame var -P1 p", substrs=["_x = 0", "_y = 0"])
7 changes: 7 additions & 0 deletions lldb/test/API/lang/objc/class-without-methods/main.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#import "Point.h"

int main() {
Point *p = [Point new];
// break here
return 0;
}
Loading