Help with debug!

Discussion in 'iOS Programming' started by mrl72, Jan 13, 2011.

  1. macrumors regular

    Apr 20, 2008
    Hi all

    Well I'm not too familiar with debug just yet, which is unfortunate because I'm now getting the famous exc_bad_access error somewhere in my code. Well, I've picked up enough info to enable zombies but from here I'm at a loss. I've been trying to track it back to the offending line of code but I'm stuck. I did backtrace, which didn't reveal much then I looked at the stack and that looked like it gave me some hints but when I used a bunch of breakpoints in the methods I thought it was telling had the offending code, it didn't help. I even tried Enable Guard Malloc and using the info <instance> but that didn't reveal much either. On the debugger window it stops at:

    0x00ea5057 <+0183> call 0xf6e48e <dyld_stub_getpid>

    Whatever that means. Coming from a procedural language this is quite frustrating trying to identify the bad code.

    Any more tips?

  2. macrumors 6502

    Aug 29, 2010
    Why didn't it help? Using breakpoints is probably the easiest way to figure out where this problem is coming from. Were you able to isolate even the specific class or method where the problem is occurring?

    Since your problem is likely a memory management issue, you need to use breakpoints to find the line where the bad access error occurs. Once you have that you should know which object you're trying to access that is having issues. Once you know how that object is declared, passed, released, retained, etc. and we should be able to help you. Most likely you've either released something you shouldn't have and tried to access it again, or failed to retain something that ended up getting released later.

Share This Page