Skip to content

[lldb] Fix tagged-pointer info address parsing #134123

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 @@ -1047,7 +1047,7 @@ class CommandObjectMultiwordObjC_TaggedPointer_Info
continue;

Status error;
lldb::addr_t arg_addr = OptionArgParser::ToAddress(
lldb::addr_t arg_addr = OptionArgParser::ToRawAddress(
&exe_ctx, arg_str, LLDB_INVALID_ADDRESS, &error);
if (arg_addr == 0 || arg_addr == LLDB_INVALID_ADDRESS || error.Fail()) {
result.AppendErrorWithFormatv(
Expand Down
14 changes: 13 additions & 1 deletion lldb/test/API/lang/objc/tagged-pointer/TestTaggedPointerCmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,22 @@ class TestTaggedPointerCommand(TestBase):
@no_debug_info_test
def test(self):
self.build()
lldbutil.run_to_source_breakpoint(
_, _, thread, _ = lldbutil.run_to_source_breakpoint(
self, "// break here", lldb.SBFileSpec("main.m")
)

n1 = thread.GetSelectedFrame().FindVariable("n1")
self.expect(
f"lang objc tagged-pointer info {n1.addr}",
substrs=[
f"{n1.addr} is tagged",
"payload = 0x0000000000000012",
"value = 0x0000000000000001",
"info bits = 0x0000000000000002",
"class = __NSCFNumber",
],
)

self.expect(
"lang objc tagged-pointer info bogus",
error=True,
Expand Down