# Advanced Apple Debugging

**URL:** https://forums.kodeco.com/c/books/advanced-apple-debugging/31.md?page=1

[Latest](https://forums.kodeco.com/latest.md) · [Categories](https://forums.kodeco.com/categories.md) · [Tags](https://forums.kodeco.com/tags.md)

**Page:** 2

---

## [Call method on address](https://forums.kodeco.com/t/call-method-on-address/133143)

<div class="topic-metadata">

**Author:** [@lateralus](https://forums.kodeco.com/u/lateralus)\
**Replies:** 0\
**Last updated:** [February 19, 2021, 2:18pm UTC](https://forums.kodeco.com/t/call-method-on-address/133143 "2021-02-19T14:18:56Z")

</div>

Hello, would you mind helping me out how should i call a method in script which receives a memory address of the object. For example, let’s say I want to call allTargets: on the object 0xabababab and get the result I wo…

---

## [Chapter 7 not producing books output](https://forums.kodeco.com/t/chapter-7-not-producing-books-output/124139)

<div class="topic-metadata">

**Author:** [@marvmax](https://forums.kodeco.com/u/marvmax)\
**Replies:** 1\
**Last updated:** [December 12, 2020, 9:05pm UTC](https://forums.kodeco.com/t/chapter-7-not-producing-books-output/124139 "2020-12-12T21:05:19Z")

</div>

The book says that when executing “frame variable” you will get (\_\_block\_literal\_5 \*) = 0x0000608000275e80 (int) sig = 23 (siginfo\_t \*) siginfo = 0x00007fff587525e8 (UnixSignalHandler \*) self = 0x000061800007d440 (Unix…

---

## [Challenge Solutions?](https://forums.kodeco.com/t/challenge-solutions/31442)

<div class="topic-metadata">

**Author:** [@perlguy](https://forums.kodeco.com/u/perlguy)\
**Replies:** 9\
**Last updated:** [December 12, 2020, 4:48pm UTC](https://forums.kodeco.com/t/challenge-solutions/31442 "2020-12-12T16:48:37Z")

</div>

I am currently on Chapter 7 and hit the “Where to go from here?” challenges, but need some help or hints. Can someone post hints and solutions to the challenges that are at the end of the chapters? Thanks!

---

## [Chapter 6.2 Examining the stacks frame](https://forums.kodeco.com/t/chapter-6-2-examining-the-stacks-frame/123840)

<div class="topic-metadata">

**Author:** [@marvmax](https://forums.kodeco.com/u/marvmax)\
**Replies:** 0\
**Last updated:** [October 31, 2020, 3:46am UTC](https://forums.kodeco.com/t/chapter-6-2-examining-the-stacks-frame/123840 "2020-10-31T03:46:00Z")

</div>

For some reason I cannot get the symbolic breakpoint to stop. Signals.MasterViewContoller.viewWillAppear(Swift.Bool) → () I was having the same problem with the breakpoint in Chapter 5, and it suddenly started working.…

---

## [Chapter 4 problem image lookup](https://forums.kodeco.com/t/chapter-4-problem-image-lookup/122869)

<div class="topic-metadata">

**Author:** [@marvmax](https://forums.kodeco.com/u/marvmax)\
**Replies:** 2\
**Last updated:** [October 22, 2020, 3:54pm UTC](https://forums.kodeco.com/t/chapter-4-problem-image-lookup/122869 "2020-10-22T15:54:12Z")

</div>

When I execute image lookup -n “-\[UIViewController viewDidLoad\]” I don’t get anything back like the example in the book. It doesn’t give an error it just returns nothing.

---

## [LLDB running commands after launch](https://forums.kodeco.com/t/lldb-running-commands-after-launch/122356)

<div class="topic-metadata">

**Author:** [@ivan\_zdane](https://forums.kodeco.com/u/ivan_zdane)\
**Replies:** 0\
**Last updated:** [October 11, 2020, 5:01pm UTC](https://forums.kodeco.com/t/lldb-running-commands-after-launch/122356 "2020-10-11T17:01:41Z")

</div>

I’m having trouble running any commands after launching Xcode in chapter 1. I am stuck in some stdin mode after running: (lldb) process launch -e /dev/ttys027 -- And I am unable to execute any other commands, without f…

---

## [Failed debugging in Swift](https://forums.kodeco.com/t/failed-debugging-in-swift/93726)

<div class="topic-metadata">

**Author:** [@justinlearnios](https://forums.kodeco.com/u/justinlearnios)\
**Replies:** 8\
**Last updated:** [July 6, 2020, 3:29am UTC](https://forums.kodeco.com/t/failed-debugging-in-swift/93726 "2020-07-06T03:29:01Z")

</div>

(lldb) ex -l swift -- import Foundation Shared Swift state for Xcode could not be initialized. The REPL and expressions are unavailable. in Chapter 1 “Swift vs Objective-C debugging”

---

## [Chapter 4 - (Error The file "Icon-1024.png" for the image set "AppIcon" does not exist.)](https://forums.kodeco.com/t/chapter-4-error-the-file-icon-1024-png-for-the-image-set-appicon-does-not-exist/105768)

<div class="topic-metadata">

**Author:** [@sasaga](https://forums.kodeco.com/u/sasaga)\
**Replies:** 1\
**Last updated:** [July 4, 2020, 7:18pm UTC](https://forums.kodeco.com/t/chapter-4-error-the-file-icon-1024-png-for-the-image-set-appicon-does-not-exist/105768 "2020-07-04T19:18:27Z")

</div>

Hello, good to everyone. I have the following problem, when I try to load the project signals from chapter 4 in my Xcode I get the error mentioned above and it doesn’t let me compile the application. I try to attach so…

---

## [Chapter 11 - Setting NSWindow background color](https://forums.kodeco.com/t/chapter-11-setting-nswindow-background-color/104640)

<div class="topic-metadata">

**Author:** [@gomes](https://forums.kodeco.com/u/gomes)\
**Replies:** 3\
**Last updated:** [July 4, 2020, 4:25pm UTC](https://forums.kodeco.com/t/chapter-11-setting-nswindow-background-color/104640 "2020-07-04T16:25:47Z")

</div>

I am following along the examples on the chapter 11. When I try to set up breakpoint in NSWindow with this command: breakpoint set -o true -S "-\[NSWindow mouseDown:\]" I get the following error from LLDB: Breakpoint 3…

---

## [LLDB - am I able to set breakpoint at a function if I did not set -g when compiling?](https://forums.kodeco.com/t/lldb-am-i-able-to-set-breakpoint-at-a-function-if-i-did-not-set-g-when-compiling/112534)

<div class="topic-metadata">

**Author:** [@junxiang99](https://forums.kodeco.com/u/junxiang99)\
**Replies:** 4\
**Last updated:** [June 27, 2020, 6:59am UTC](https://forums.kodeco.com/t/lldb-am-i-able-to-set-breakpoint-at-a-function-if-i-did-not-set-g-when-compiling/112534 "2020-06-27T06:59:57Z")

</div>

LLDB - am I able to set breakpoint at a function in a process, if the executable was not compiled with -g (ie no debugging info)?

---

## [LLDB - count the number of steps to execute a thread or to execute a function eg. main(), and skip to Xth step](https://forums.kodeco.com/t/lldb-count-the-number-of-steps-to-execute-a-thread-or-to-execute-a-function-eg-main-and-skip-to-xth-step/112533)

<div class="topic-metadata">

**Author:** [@junxiang99](https://forums.kodeco.com/u/junxiang99)\
**Replies:** 3\
**Last updated:** [June 20, 2020, 5:55am UTC](https://forums.kodeco.com/t/lldb-count-the-number-of-steps-to-execute-a-thread-or-to-execute-a-function-eg-main-and-skip-to-xth-step/112533 "2020-06-20T05:55:37Z")

</div>

(1) Is there a way to count the number of steps it takes to execute a function or a thread with LLDB? As an example, #include\<stdio.h\> int main() { printf("\\n\\n\\t\\tStudytonight - Best place to learn\\n\\n\\n"); //…

---

## [Xcode 11 hangs, project file appears faded in navigator, can't recover](https://forums.kodeco.com/t/xcode-11-hangs-project-file-appears-faded-in-navigator-cant-recover/104259)

<div class="topic-metadata">

**Author:** [@mayo](https://forums.kodeco.com/u/mayo)\
**Replies:** 1\
**Last updated:** [April 6, 2020, 2:35pm UTC](https://forums.kodeco.com/t/xcode-11-hangs-project-file-appears-faded-in-navigator-cant-recover/104259 "2020-04-06T14:35:27Z")

</div>

I’m working through Chapter 4 and for the second time Xcode 11 has just started hanging, claiming it’s no longer able to build the project even though command line builds with xcodebuild work fine. The project icon appea…

---

## [Chapter 21: LLDB is now on Python 3.X.Y](https://forums.kodeco.com/t/chapter-21-lldb-is-now-on-python-3-x-y/102477)

<div class="topic-metadata">

**Author:** [@sparklydust](https://forums.kodeco.com/u/sparklydust)\
**Replies:** 1\
**Last updated:** [April 6, 2020, 12:59am UTC](https://forums.kodeco.com/t/chapter-21-lldb-is-now-on-python-3-x-y/102477 "2020-04-06T00:59:29Z")

</div>

I came here to complain loudly that chapter 21 is not using Python 3.X.Y (I’m adding a comment as requested in the chapter). My question is: As the book hasn’t been updated since October 2018, are we going to have an up…

---

## [Chapter 24 - error: Multiple internal symbols found for 'context'](https://forums.kodeco.com/t/chapter-24-error-multiple-internal-symbols-found-for-context/38839)

<div class="topic-metadata">

**Author:** [@pauladdy](https://forums.kodeco.com/u/pauladdy)\
**Replies:** 4\
**Last updated:** [April 3, 2020, 9:15pm UTC](https://forums.kodeco.com/t/chapter-24-error-multiple-internal-symbols-found-for-context/38839 "2020-04-03T21:15:11Z")

</div>

Following along, I made all the way to chapter 24, where I started getting the below error, now most lldb command I try for this chapter go bonkers. Error - output from launch of scheme to errors: thread #1, queue = ‘…

---

## [Chapter 7: block literal not printing](https://forums.kodeco.com/t/chapter-7-block-literal-not-printing/93297)

<div class="topic-metadata">

**Author:** [@zinkspieler](https://forums.kodeco.com/u/zinkspieler)\
**Replies:** 3\
**Last updated:** [March 31, 2020, 1:50am UTC](https://forums.kodeco.com/t/chapter-7-block-literal-not-printing/93297 "2020-03-31T01:50:21Z")

</div>

I’m running into an issue in Chapter 7 in the Hunting for Code section. When I set up the breakpoint for the Objective-C block and execute frame variable I don’t see the object referencing the block itself. Here’s is wh…

---

## [methods/iVars commands are no longer accessible](https://forums.kodeco.com/t/methods-ivars-commands-are-no-longer-accessible/96745)

<div class="topic-metadata">

**Author:** [@gorloff](https://forums.kodeco.com/u/gorloff)\
**Replies:** 2\
**Last updated:** [February 4, 2020, 2:25am UTC](https://forums.kodeco.com/t/methods-ivars-commands-are-no-longer-accessible/96745 "2020-02-04T02:25:40Z")

</div>

macOS 10.15.2 | Xcode 11.3 The NSObject Private category used to implement these methods seems to no longer be visible. @interface NSObject (Private) -(id)\_ivarDescription; -(id)\_shortMethodDescription; -(id)…

---

## [Lldb on scanf function](https://forums.kodeco.com/t/lldb-on-scanf-function/92285)

<div class="topic-metadata">

**Author:** [@0x3c3e](https://forums.kodeco.com/u/0x3c3e)\
**Replies:** 1\
**Last updated:** [January 13, 2020, 7:13am UTC](https://forums.kodeco.com/t/lldb-on-scanf-function/92285 "2020-01-13T07:13:08Z")

</div>

Hi, Is it possible to debug a program which requires user input from stdin (scanf)? Especially during remote debugging with debugserver from iOS. Previously I have used gdb and I was able to pass an input through gdb t…

---

## [Heads up if you are on macOS Catalina -- bash is no longer the default](https://forums.kodeco.com/t/heads-up-if-you-are-on-macos-catalina-bash-is-no-longer-the-default/93701)

<div class="topic-metadata">

**Author:** [@cupofjoe](https://forums.kodeco.com/u/cupofjoe)\
**Replies:** 2\
**Last updated:** [January 12, 2020, 1:34am UTC](https://forums.kodeco.com/t/heads-up-if-you-are-on-macos-catalina-bash-is-no-longer-the-default/93701 "2020-01-12T01:34:23Z")

</div>

Not sure if this is my problem yet but when the author wrote this book, which is very good by the way, the default shell of OS X was forever and always ‘bash’. The default shell for any user account in macOS Catalina 10…

---

## [Chapter 7 image : page 95 Why is it different from the calling status in the book?](https://forums.kodeco.com/t/chapter-7-image-page-95-why-is-it-different-from-the-calling-status-in-the-book/85180)

<div class="topic-metadata">

**Author:** [@hyegon](https://forums.kodeco.com/u/hyegon)\
**Replies:** 1\
**Last updated:** [November 14, 2019, 7:08pm UTC](https://forums.kodeco.com/t/chapter-7-image-page-95-why-is-it-different-from-the-calling-status-in-the-book/85180 "2019-11-14T19:08:37Z")

</div>

Hi …! on page 94 It is shown in the call stack “\_\_38- \[UnixSignalHandler appendSignal: sig:\] \_ block\_invoke”. continue program execution "Go past this by continuing the debugger. Next you ’ll hit a breakpoint in: " …

---

## [Chapter 1, page 32, xocde 10.3, mojavi(10.14.6(18G95)](https://forums.kodeco.com/t/chapter-1-page-32-xocde-10-3-mojavi-10-14-6-18g95/80831)

<div class="topic-metadata">

**Author:** [@hyegon](https://forums.kodeco.com/u/hyegon)\
**Replies:** 2\
**Last updated:** [October 15, 2019, 2:16am UTC](https://forums.kodeco.com/t/chapter-1-page-32-xocde-10-3-mojavi-10-14-6-18g95/80831 "2019-10-15T02:16:25Z")

</div>

cmd run ? lldb) po \[$rdi setHidden:!(BOOL)\[$rdi isHidden\]\]; \[CATransaction flush\] error: Execution was interrupted, reason: EXC\_BAD\_ACCESS (code=1, address=0xc0000000020). Solution??

---

## [\[Question\] how ? Or where should I run it? "(lldb) sys echo" $ (dclass -t swift) "| grep -v \_ | grep" \\. "| cut -d. f1 | uniq | wc -l (Page 28 Line 16)](https://forums.kodeco.com/t/question-how-or-where-should-i-run-it-lldb-sys-echo-dclass-t-swift-grep-v-grep-cut-d-f1-uniq-wc-l-page-28-line-16/80678)

<div class="topic-metadata">

**Author:** [@hyegon](https://forums.kodeco.com/u/hyegon)\
**Replies:** 2\
**Last updated:** [October 14, 2019, 9:04pm UTC](https://forums.kodeco.com/t/question-how-or-where-should-i-run-it-lldb-sys-echo-dclass-t-swift-grep-v-grep-cut-d-f1-uniq-wc-l-page-28-line-16/80678 "2019-10-14T21:04:11Z")

</div>

hi …! The following is part of the book. Page 28 … Line 14 ~ … !! When run from the following command lldb There is no sys command. how ? Or where should I run it? “(lldb) sys echo” $ (dclass -t swift) “| grep -v \_…

---

## [ldb python script run?](https://forums.kodeco.com/t/ldb-python-script-run/80826)

<div class="topic-metadata">

**Author:** [@hyegon](https://forums.kodeco.com/u/hyegon)\
**Replies:** 2\
**Last updated:** [October 14, 2019, 9:03pm UTC](https://forums.kodeco.com/t/ldb-python-script-run/80826 "2019-10-14T21:03:08Z")

</div>

link: GitHub - DerekSelander/LLDB: A collection of LLDB aliases/regexes and Python scripts to aid in your debugging sessions Below is the execution result. (lldb) command script import ~ / Users / gimhyegon\_dev / lldb\_…

---

## [Question on Extending the Steps in Chapter 4 to \*Any\* Program/Command (Especially Those Where We Have No Source)](https://forums.kodeco.com/t/question-on-extending-the-steps-in-chapter-4-to-any-program-command-especially-those-where-we-have-no-source/70558)

<div class="topic-metadata">

**Author:** [@junxiang99](https://forums.kodeco.com/u/junxiang99)\
**Replies:** 2\
**Last updated:** [July 16, 2019, 10:17pm UTC](https://forums.kodeco.com/t/question-on-extending-the-steps-in-chapter-4-to-any-program-command-especially-those-where-we-have-no-source/70558 "2019-07-16T22:17:05Z")

</div>

Hi, I have read Chapter 4 of the book, and like to ask how would one know what symbols to search with the image command, if one didn’t have the source code and hence didn’t know what functions existed, and even what lang…

---

## [INDEX Term missing from normal book](https://forums.kodeco.com/t/index-term-missing-from-normal-book/70725)

<div class="topic-metadata">

**Author:** [@andrea85to](https://forums.kodeco.com/u/andrea85to)\
**Replies:** 4\
**Last updated:** [June 4, 2019, 12:49pm UTC](https://forums.kodeco.com/t/index-term-missing-from-normal-book/70725 "2019-06-04T12:49:10Z")

</div>

It is possible get the index term?

---

## [Lldb console command to "Run only this thread" (--run-mode or -m?)](https://forums.kodeco.com/t/lldb-console-command-to-run-only-this-thread-run-mode-or-m/31449)

<div class="topic-metadata">

**Author:** [@aurrak](https://forums.kodeco.com/u/aurrak)\
**Replies:** 3\
**Last updated:** [May 20, 2019, 8:39pm UTC](https://forums.kodeco.com/t/lldb-console-command-to-run-only-this-thread-run-mode-or-m/31449 "2019-05-20T20:39:12Z")

</div>

In chapter 6 “Stepping in the Xcode GUI” section, there’s mention of a LLDB console command equivalent to control the running mode (run only this thread, run all threads, while stepping, etc) by using --run-mode option, …

---

## [Chapter 1 problem: Unrecognized option \`-\[NSView'](https://forums.kodeco.com/t/chapter-1-problem-unrecognized-option-nsview/56781)

<div class="topic-metadata">

**Author:** [@metzopaino](https://forums.kodeco.com/u/metzopaino)\
**Replies:** 3\
**Last updated:** [May 10, 2019, 2:22pm UTC](https://forums.kodeco.com/t/chapter-1-problem-unrecognized-option-nsview/56781 "2019-05-10T14:22:51Z")

</div>

Just stated Advanced Apple Debugging, but hit a snag on in Chapter 1, “Finding a class with a click”. When I input the following into lldb: b -\[NSView hitTest:\] Breakpoint 1: where = AppKit\`-\[NSView hitTest:\], address…

---

## [Lldb fails to attach over SSH connection](https://forums.kodeco.com/t/lldb-fails-to-attach-over-ssh-connection/62905)

<div class="topic-metadata">

**Author:** [@mrbass21](https://forums.kodeco.com/u/mrbass21)\
**Replies:** 2\
**Last updated:** [February 23, 2019, 6:31pm UTC](https://forums.kodeco.com/t/lldb-fails-to-attach-over-ssh-connection/62905 "2019-02-23T18:31:36Z")

</div>

Is there some known issue with issuing LLDB commands over SSH? I’m on my windows machine and I used Powershell (with Windows 10) to remote into my iMac and issued the lldb -f /bin/ls command. When I do a ‘process launch’…

---

## [How in the world does DTrace work?](https://forums.kodeco.com/t/how-in-the-world-does-dtrace-work/62677)

<div class="topic-metadata">

**Author:** [@russ4](https://forums.kodeco.com/u/russ4)\
**Replies:** 1\
**Last updated:** [February 20, 2019, 7:20pm UTC](https://forums.kodeco.com/t/how-in-the-world-does-dtrace-work/62677 "2019-02-20T19:20:06Z")

</div>

I can’t believe how powerful DTrace is. Isn’t it remarkable that it can detect and handle every single userland function call (and even every CPU instruction)? sudo dtrace -ln ’objc$target:::’ -p PID This will create …

---

## [Problem with my purchase of "Advanced Apple Debugging & Reverse Engineering"](https://forums.kodeco.com/t/problem-with-my-purchase-of-advanced-apple-debugging-reverse-engineering/61977)

<div class="topic-metadata">

**Author:** [@oliverperez](https://forums.kodeco.com/u/oliverperez)\
**Replies:** 3\
**Last updated:** [February 12, 2019, 11:44am UTC](https://forums.kodeco.com/t/problem-with-my-purchase-of-advanced-apple-debugging-reverse-engineering/61977 "2019-02-12T11:44:01Z")

</div>

hi, I have used my credit card to buy the book and got below message. my login name is oliverperez.e@gmail.com Hi — there seems to have been a delay with the automatic processing of your order. Your product should be a…

---

## [Process stopped immediately after launch](https://forums.kodeco.com/t/process-stopped-immediately-after-launch/43326)

<div class="topic-metadata">

**Author:** [@teklehaimanot](https://forums.kodeco.com/u/teklehaimanot)\
**Replies:** 3\
**Last updated:** [July 12, 2018, 11:00pm UTC](https://forums.kodeco.com/t/process-stopped-immediately-after-launch/43326 "2018-07-12T23:00:14Z")

</div>

Not sure why process is stopped … I have both Xcode 9.2 and 9.3 installed (using 9.3 path).

[Previous page](https://forums.kodeco.com/c/books/advanced-apple-debugging/31.md)

[Next page](https://forums.kodeco.com/c/books/advanced-apple-debugging/31.md?page=2)
