Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Viewing the memory (bytes) from an address onwards in Xcode

Tags:

xcode

In visual studio I can set a breakpoint in my code and, when execution breaks, get the address of the memory I am interested in, and then put the address into the memory window to see all the memory bytes from the address onwards. Here's an example:

Visual Studio 2015 screenshot

You can see the breakpoint hit in the middle Visual Studio window, the watch on the variable I am interested in in the bottom window that gives me the address, and I typed the address into the top window to see the memory there.

After execution hits a breakpoint in Xcode how do I view the bytes in memory from a particular address onwards?

(N.B. I have tried to search online for this but my search results are dominated by Xcode's memory usage monitor, which is not what I am after.)

like image 403
dumbledad Avatar asked Nov 11 '15 12:11

dumbledad


1 Answers

As Martin R points out in his comment on my question, Eric covers exactly this in his answer to the question How to print memory in 0xb0987654 using lldb. Eric explains that Xcode has a Memory Browser window that displays the contents of a given memory addresses.

Eric's screenshot of Swift's memory browser

Eric mentions that we can access the memory browser by pressing ⌘⌥⇧M or through the Debug --> Debug Workflow --> View Memory menus.

He notes that there is a field in its bottom left corner where we can paste the memory address you want to inspect.

Lastly he provides a link to the documentation and to another related answer

like image 52
dumbledad Avatar answered Oct 08 '22 19:10

dumbledad