# Xcode DBG( ) attach to process

**URL:** <https://forum.juce.com/t/xcode-dbg-attach-to-process/13383>\
**Category:** MacOSX and iOS\
**Created:** [August 18, 2014, 9:34am UTC](https://forum.juce.com/t/xcode-dbg-attach-to-process/13383 "2014-08-18T09:34:41Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![alatar](https://avatars.discourse-cdn.com/v4/letter/a/34f0e0/32.png) [@alatar](https://forum.juce.com/u/alatar)\
**Post date:** [August 18, 2014, 9:34am UTC](https://forum.juce.com/t/xcode-dbg-attach-to-process/13383/1 "2014-08-18T09:34:41Z")

</div>

Hello,

I have a question about debugging in XCode. When I run a stand-alone application, I can use the DBG macro, in order to show output on the XCode debug output console.&nbsp;

But that does not work, when I want to debug my audio plugin from inside Garage Band, by "attach to process". Nothing is showing up in the Xcode debug console. Can someone give me a hint, what I need to do?&nbsp;

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [August 18, 2014, 10:00am UTC](https://forum.juce.com/t/xcode-dbg-attach-to-process/13383/2 "2014-08-18T10:00:46Z")

</div>

I'm pretty sure I've used that in lots of hosts. Is it loading the release build, perhaps?

---

<div class="post-metadata">

**Author:** ![alatar](https://avatars.discourse-cdn.com/v4/letter/a/34f0e0/32.png) [@alatar](https://forum.juce.com/u/alatar)\
**Post date:** [August 18, 2014, 10:38am UTC](https://forum.juce.com/t/xcode-dbg-attach-to-process/13383/3 "2014-08-18T10:38:00Z")

</div>

Its in Debug Mode.&nbsp;

I use the following construct to check:

```
#if JUCE_DEBUG

    Logger::writeToLog("Debug Mode");

#else

    Logger::writeToLog("Release Mode");

#endif
```

And it says "Debug" (redirected the otput to a file).&nbsp;

PS: I am using XCode 5.1.1, in case that should make any difference.

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [August 18, 2014, 10:40am UTC](https://forum.juce.com/t/xcode-dbg-attach-to-process/13383/4 "2014-08-18T10:40:31Z")

</div>

Dunno. Try another host, it could be garageband messing with the console streams.

---

<div class="post-metadata">

**Author:** ![alatar](https://avatars.discourse-cdn.com/v4/letter/a/34f0e0/32.png) [@alatar](https://forum.juce.com/u/alatar)\
**Post date:** [August 18, 2014, 12:56pm UTC](https://forum.juce.com/t/xcode-dbg-attach-to-process/13383/5 "2014-08-18T12:56:00Z")

</div>

Actually it is the same from within the Juce plugin host demo.

I guess the next step would be to test with a non-Juce plugin, to see if this is Juce related or not.&nbsp;But I don't know how to do that.&nbsp;Maybe this is a general XCode lldb problem. Byt most probably just an option, I am missing somewhere... :-)

&nbsp;

&nbsp;

&nbsp;

---

<div class="post-metadata">

**Author:** ![dave96](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/dave96/32/8487_2.png) [@dave96](https://forum.juce.com/u/dave96)\
**Post date:** [August 18, 2014, 1:08pm UTC](https://forum.juce.com/t/xcode-dbg-attach-to-process/13383/6 "2014-08-18T13:08:24Z")

</div>

Why don't you just launch the host as a custom executable, DBG statements will work this way. I'm not quite sure why they fail if you attach a process afterwards but if you find out let me know!
