6

I am trying to debug some concurrency code and when I log [NSThread callStackSymbols]; the console shows most of the symbols I am interested in as <redacted>.

Is there a way to get around this during runtime? I have deleted the device symbols folder but Xcode re-symbolication didn't seem to fix the issue.

There are a few other questions on here but they all seem to be trying to solve this on crash files.

How can I see the method names for framework symbols in the debug console?

I am running Xcode 5.

ipmcc
  • 29,581
  • 5
  • 84
  • 147
some_id
  • 29,466
  • 62
  • 182
  • 304
  • If you want to debug IPAs this way, I think the only way is to get a proper stack trace (there are examples online on how to do it with C) and then symbolicate them with the relevant dSYM. – Vladimir Gritsenko Nov 24 '13 at 13:04
  • Yes, I am aware of this thanks. I am trying to debug issues that are irregularly causing crashes. So I can't rely on crash reports or recreating the crash as the crash isn't always triggered but NSManagedObjects are being incorrectly accessed from different threads. – some_id Nov 24 '13 at 13:12
  • You don't have to wait for the crash, I think. IIRC, there are ways in good ol' C to get a stack trace with the addresses during runtime. Then you can manually (=write a script to) convert them into symbols. – Vladimir Gritsenko Nov 24 '13 at 13:29
  • @VladimirGritsenko Only having the addresses is not enough, please read my answer below! – Kerni Nov 24 '13 at 13:30
  • @VladimirGritsenko [NSThread callStackSymbols]; logs the address and symbols. – some_id Nov 24 '13 at 13:45

1 Answers1

12

You get all symbols showing up only:

  1. while debugging
  2. when generating a full crash report and symbolicate that.
  3. symbolicating the addresses manually using atos with the corresponding dSYM or system symbols on disk (you need to load address for each framework and binary to do that, also due to Address space layout randomization. Only having callStackSymbols doesn't reveal those). See iOS crash reports: atos not working as expected

The <redacted> symbols are a

Memory optimization. The <redacted> symbol names are stored on disk only, which saves some physical memory and lots of virtual address space in every process.

See https://devforums.apple.com/thread/171264

To sum up: you can NOT get all system symbols showing up using any calls during runtime. Instead you need to create a full crash report by letting the app crash and analyse the stack traces from those.

Community
  • 1
  • 1
Kerni
  • 15,241
  • 5
  • 36
  • 57
  • I get these redacted symbols during runtime. – some_id Nov 24 '13 at 13:12
  • As I described, this is expected for some system symbols, see the explanation I posted from the devForums. – Kerni Nov 24 '13 at 13:16
  • I already posted the relevant part in the answer. What you are trying to do is **NOT** possible! – Kerni Nov 24 '13 at 13:24
  • Ok thanks :) Its a little tricky when the issue does not always cause crashes. – some_id Nov 24 '13 at 13:29
  • My issue is similar (iOS 9.3.x), but i'm seeing not "", but just not-my-symbols, even though "archive" does an "ad-hoc" build and `Strip Debug Symbols During Copy` for ad-hoc is `NO`. (The app is delivered to beta tester, the `callStackSymbols` are NSLog()-ed to the console. Any ideas? Thanks! – Olie May 21 '16 at 06:00
  • Sorry, I should have mentioned: my callStack is full of entries similar to `0x000000010011e0bc worfc + 483516` (worfc is the name of the app) – Olie May 21 '16 at 18:43
  • The high offset value `483516` indicates that there are no specific symbols available for the actual memory address and it then takes the last found before this memory address. You most likely included code (your own or from a 3rd party static library) that doesn't come with symbols. – Kerni May 22 '16 at 17:29