Error connecting to SQLite from iPhone - objective-c

My application shows this error
asm CPSqliteConnectionStatementForSQL 0x30897lb3:10
and it stopped at this breakpoint in debugger
0x308971cb <+0024> mov 0x8(%edi),%eax
Does someone know about it?

The assembly code won't tell most of us anything at all, and your question is pretty light on detail about the context in which the problem occurs, such as what your app is trying to do when it crashes, whether this is always reproducible, etc. If you post more information we'll be able to help you more.
If you're debugging in Xcode, trace back up the call stack until you reach your code, then set a breakpoint there and debug your program again. When it stops at that point, try examining the related variables and see if they have the values you expect.
Edit: At the request of the asker, here is a slight clarification. When it stops at a breakpoint, the Xcode debugger window will look something like this: (from this section of Apple's Xcode Debugging Guide)
http://developer.apple.com/documentation/DeveloperTools/Conceptual/XcodeDebugging/art/debugger_disassembly.jpg
The stack frames are shown in the upper-left rectangle, and you can click on a row in the table to jump to that point in the code. Grayed-out lines are those that do not have viewable source code available. Scroll down until you see a line with black text and click on it. This will show you the point at which execution left your code and entered third-party code, and you can then examine variables to get a better idea about what the problem may be. If you have further questions, I highly recommend reading through the debugging guide linked above.

Related

Visual Studio Debugger's little blue arrow

What is this little blue arrow about?
It freezes execution of my ASP.NET program when I do not want it to (note the disabled breakpoint).
Any resources or clarification around what this little guy represents would be much appreciated.
You may have a Debugger.Break(); command on the function or code called on that line. Check this post for more info.
EDIT
Answer by #Thomas:
This line of code is currently executing, it calls something else,
e.g. native code or .NET internal code and an exception happens there.
You can see both arrows in the call stack window:
Perhaps you need to turn on "Show external code".
If you can't see the exception dialog, usually you can show it like
this:
Showing Exception in VS

Debugging - Finding where Error statement in log is coming from [duplicate]

I'm not sure if this is possible. Here is an example situation:
Something is printing to my console and I don't know where it is coming from in the code. I did a quick search using the Finder in Xcode on terms such as 'NSLog' and 'print'. Nothing relevant came up.
Is there any quick way that Xcode has of finding where the source of the output is coming from ?
Kind of like when you right click on a method and you have all the options of exploring different parts of the code associated with that method.
Also: are there other functions that print besides NSLog and print?
Thanks so much!
Try running in the debugger, with breakpoints set on printf, NSLog, etc. When you hit a breakpoint do a backtrace (bt) to see where it's being called from
There's a plugin LinkedLog for that. You replace all NSLogs with LLogs and then will be able to just tap on link in Xcode's console to get to the line caused it to appear.
Didn't try it myself, but definitely will.

The code flow jumps without getting into any of the if-block

I edited this question, as now it seems it's not a coding issue. Might be something with IDE or something else.
I am using Flash Develop 4.5.2 right now.
I added a small check in the class, to test equality. But it's showing strange result.
A 1 min video on Youtube about the problem => http://youtu.be/wHXs7nwyhow
![The flow jumps without getting any of the if-block][1]
[1]: http://i.stack.imgur.com/aD3YM.png
Might be some special characters issue. So, pasted it on notepad, and saved it back as ".as", but still that part is skipped by debugger. No matter, whatever i write there. ( See video )
Vishwas
Seems like a bug. I checked OFF "Omit trace actions" in Flash IDE ( So as to receive the trace statements in the trace window now ). And it's working fine now. ( It seems like Flash Develop debugger, tries ignoring those pieces of code, that are related with trace() in such case.

XCode 4 iOS - Debugger shows bytecode instead of telling me what line my app crashed

When my app crashes, instead of seeing what line caused, I see a window that prints all unreadable byte code. I used to be able to see what line it crashed on, but I must have changed something. Here's a screen shot:
What setting can I change to have XCode show me where my app crashed?
UNcheck the "Show Disassembly When Debugging" menu option:
The inverse of the above; if you want to show disassembly for the current debug location, you can use this drop-down menu:
The actual crash may not necessarily be in your code. The debugger is going to point you to the machine instruction that caused the crash. It may be in a cocoa-touch method or OS call which crashed because of a bad parameter you passed in (an invalid pointer is a common culprit).
Because the debugger does not have access to the source for the code that actually crashed, it will show you the disassembled machine code. What you need to do is follow the call stack backwards until you reach your code. That should point you to the line of code in your app which (indirectly) caused the crash.

need help with memory management

so i have a program i am developing and as im fairly new to objective-c and cocoa touch im not very familiar with the concepts of memory management in ipad app development. my problem is that my program keeps crashing without any warning and without telling me why, i turned on breakpoints and it shows an exc_bad_access signal. which leads me to believe that im not handling the memory properly. or its something else that i've over looked in my efforts. either way i need some help. if anyone can take a look at the app and tell me anything that may be causing it to act the way it is that would be great.
the point of the program is that it shows 20 mayan glyphs of the numbers 0-19, you drag the glyphs one at a time into the white 'drop zones' and it adds them and displays the result. however almost every time as soon as the second glyph is dropped in it quits, or it will display the answer and when you remove one of the glyphs to add another set it will quit then.
any help would be greatly appreciated. thanks stackoverflow :)
source files here
why don't you read Apple's documentation, which is reasonably excellent on this particular topic?
http://developer.apple.com/iphone/library/documentation/cocoa/conceptual/memorymgmt/memorymgmt.html
Get to know the debugger. At the point at which you see the EXC_BAD_ACCESS and the program halts, look at the call stack to actually see what the source of the signal was.
Also, in the case of an issue with accessing an object that has already been deallocated, it's useful to have NSZombieEnabled set to YES in your environment variables. To do that open the info panel for your executable (Groups & Files pane, expand 'Executables', and open the info panel for the executable your project builds) and in the "Arguments" add an environment variable named NSZombieEnabled with the value YES. With this enabled any objects which are deallocated are actually turned into an instance of a 'zombie' class which will allow you to catch any messages sent to those instances.