This is an archive of the discontinued LLVM Phabricator instance.

[lldb] Improve error reporting in `lang objc tagged-pointer info`
ClosedPublic

Authored by JDevlieghere on Nov 1 2021, 11:56 AM.

Details

Summary

Improve error handling for the lang objc tagged-pointer info. Rather than failing silently, report an error if we couldn't convert an argument to an address or resolve the class descriptor.

(lldb) lang objc tagged-pointer info 0xbb6404c47a587764
could not get class descriptor for 0xbb6404c47a587764
(lldb) lang objc tagged-pointer info n1
could not convert 'n1' to a valid address

Diff Detail

Event Timeline

JDevlieghere requested review of this revision.Nov 1 2021, 11:56 AM
JDevlieghere updated this revision to Diff 383851.
JDevlieghere created this revision.

Add test

This is great, thanks! (one question inline)

lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
984–1008

I don't think success really works. Shouldn't the function only return true if none of the arg_strs failed?

aprantl added inline comments.Nov 1 2021, 2:11 PM
lldb/test/Shell/ObjC/tagged_pointer_info.test
3 ↗(On Diff #383851)

personal opinion without through reasoning behind it: This feels more like an API test to me.

Address code review feedback

aprantl accepted this revision.Nov 2 2021, 1:16 PM

Excellent, thanks!

This revision is now accepted and ready to land.Nov 2 2021, 1:16 PM
Herald added a project: Restricted Project. · View Herald TranscriptNov 2 2021, 2:25 PM