On Oct 15, 2015, at 01:38, Roland King < email@hidden> wrote:
On 15 Oct 2015, at 11:38, Alex Hall <email@hidden> wrote:
For these stack traces, is there any way for it to point right at the offending line in context? That is, instead of a generic array.append call, could it say line 119 in MyModel.swift, or wherever the problem is?
It should - the stack trace should go all the way up to start() if you’re on the main thread, or all the way up to the start of the thread, if you’re on a work thread somewhere. Xcode may elide code with no debug symbols, you can tell if the numbers on each of the debug lines aren’t continuous (eg if it really does go from 5 to 0 as in your example, looks like it’s eliding, there’s a button at the bottom of the debug pane to ask it not to do that).
I don't know how much sense this will make, since VO groups things together, probably differently from what you see visually, but I'll give it a shot.
In the Navigator group, I have the debug navigator selected, and that shows the stack trace in a table with a filter field next to it. That table has continuous line numbers; the problem is, some rows are blank. For instance, rows 1 to 4 are completely empty, according to VoiceOver, which I took to be some kind of spacing or layout thing. Maybe it's not? Either way, I don't see a button here at all, just the table and the text field.
In the editor group, I have two items for debugging: the debug bar group and the debug group. The latter holds console output and a variables view table (I've never seen that table hold anything at all). The debug bar group holds breakpoint controls, as well as a "stack frames" list. That list includes all the frames as popup buttons, and it appears to have a more complete list, but there are no specific variable values, just variable types. Here's what it has for the same range as what is in the table in the (mostly empty) section in the debug navigator: 0 swift_slowAlloc 1 _swift_allocObject_(swift::HeapMetadata const*, unsigned long, unsigned long) 2 _ContiguousArrayBuffer.init<A>(count : Int, minimumCapacity : Int) -> _ContiguousArrayBuffer<A> 3 _forceCreateUniqueMutableBufferForceGrow<A where ...> (inout A, Int, Int) -> _ContiguousArrayBuffer<A.Element> 4 Array._copyToNewGrownBuffer<A>(Int) -> () 5 Array.append<A>(A) -> ()
Compare that to the debug table back in the navigator, which had only items 5 and 0. What this does I'm not sure, but it seems to at least be more complete, though it would be good to be able to look at what's going on and where the actual problem is in there. Or maybe you can, and I don't know how, or doing so wouldn't help me at all… I'm really not sure. I can say that I don't see anything change when I change the selection in this list.
One other note: I've just noticed an instruction pointer in my model file: thread 1: exc_breakpoint code = exc_i386_bpt, code = 0x0) referring to the line (Int(newTweetID)! < Int(mostRecentTweetID)! ? tweetsList.append(newTweet) : tweetsList.insert(newTweet, atIndex:0) ) But then, we already knew that adding to an array was the problem, and that the adding happened in the fetching of new tweets, so I suppose this doesn't help much.
Whether all this is down to my inexperience, lack of clarity/accessibility on Xcode's part, or both, I'm not sure. If I can do anything else to clarify what I'm seeing, just let me know what I need to do. Thanks for continuing to help. If you can get a stack trace all the way up to start() and post it perhaps it’ll make some sense.
|