Chapter 7: block literal not printing

Yea, I’m not sure why we are not seeing the block_literal.

if we print the $rdi:

<__NSMallocBlock__: some address>

Which is the same as what we should see on the instruction on the next page using the _block_literal_5

(lldb) po ((__block_literal_5 *)0x0000618000070200)

(Page 97). 

I’m not sure why it’s not showing on LLDB. But if you want the block address to work with and continue the examples, you can obtain it from the $rdi.

(lldb) po $rdi
<__NSMallocBlock__: 0x000061800007020A>
//Your address might change so I just wrote a random number

And now you can use that Address and continue:

(lldb) po ((__block_literal_5 *)0x000061800007020A)
(lldb) p/x ((__block_literal_5 *)0x000061800007020A)->__FuncPtr
//Etcetera

I would also like to know why the __block_literal_5 is not showing, but in the mean time I used that to continue the lesson.

I hope it helps.

1 Like