Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to print disassembly registers in the Xcode console

Tags:

People also ask

How do I see variables in Xcode?

There is 2 ways to watch a variable and break at certain condition. Control-click a breakpoint indicator to display a command menu and choose Edit Breakpoint to open the breakpoint editor and set conditions, add actions, and so forth, as mentioned in Breakpoints. Use LLDB command line.

How do I print a variable in Xcode?

If the variable is an image or other type that isn't expressible as text, click the Quick Look button at the upper-right to see a preview of the variable. Click the Print Description button to print a description of the object in the console.

What is LLDB in Xcode?

LLDB is the system debugger on macOS, iPadOS, iOS, tvOS, and watchOS. It can also be used for Objective-C and Swift development for architectures: x86_64. i386, ARM and AArch64, and default debugger in Xcode on macOS. It supports debugging on desktop, in simulators and devices.

How do I print from Xcode?

In Swift with Xcode you can use either print() or NSLog() . print() just outputs your text. Nothing more.


I'm looking at some disassembly code and see something like 0x01c8f09b <+0015> mov 0x8(%edx),%edi and I am wondering what the value of %edx or %edi is.

Is there a way to print the value of %edx or other assembly variables? Is there a way to print the value at the memory address that %edx points at (I'm assuming edx is a register containing a pointer to ... something here).

For example, you can print an objet by typing po in the console, so is there a command or syntax for printing registers/variables in the assembly?

Background:

I'm getting EXC_BAD_ACCESS on this line and I would like to debug what is going on. I'm aware this error is related to memory management and I'm looking at figuring out where I may be missing/too-many retain/release/autorelease calls.

Additional Info:

This is on IOS, and my application is running in the iPhone simulator.