Breakpoints within MAXBLOCK

9 views
Skip to first unread message

Brendan Duddridge

unread,
Jun 16, 2016, 2:02:15 PM6/16/16
to Couchbase Mobile
Hi,

My breakpoints don't seem to stop inside of a MAPBLOCK on iOS in Xcode 7.

Is there a trick to getting them to work with Couchbase?

Thanks,

Brendan

Jens Alfke

unread,
Jun 16, 2016, 2:08:58 PM6/16/16
to mobile-c...@googlegroups.com

> On Jun 16, 2016, at 11:02 AM, Brendan Duddridge <bren...@gmail.com> wrote:
>
> Hi,
>
> My breakpoints don't seem to stop inside of a MAPBLOCK on iOS in Xcode 7.

In my experience, Xcode (LLDB) has trouble hitting breakpoints inside of blocks. It doesn’t consistently fail, but it’s not reliable.

This isn't specific to the mapBlock, or to Couchbase Lite. I don’t know of any workarounds, sorry.

—Jens

Brendan Duddridge

unread,
Jun 16, 2016, 2:22:24 PM6/16/16
to Couchbase Mobile
That's a bummer. Makes it difficult to debug view creation. I currently am somewhere trying to treat an NSString as an NSDictionary and it's crashing. So I'm trying to figure that out. My MAPBLOCK is quite complex. 

Jens Alfke

unread,
Jun 16, 2016, 3:05:46 PM6/16/16
to mobile-c...@googlegroups.com

On Jun 16, 2016, at 11:22 AM, Brendan Duddridge <bren...@gmail.com> wrote:

That's a bummer. Makes it difficult to debug view creation. I currently am somewhere trying to treat an NSString as an NSDictionary and it's crashing. So I'm trying to figure that out. My MAPBLOCK is quite complex. 

One weird trick I know of, that I haven’t used myself, is that you can simulate a breakpoint in code with the following:

    pthread_kill(pthread_self(), SIGINT);

I.e. insert that where you want to stop, and the debugger should stop at that line and then allow you to continue.

From my notes it looks like you’ll need to include these headers:
#include <sys/sysctl.h>
#include <unistd.h>
#include <pthread.h>


—Jens

Brendan Duddridge

unread,
Jun 16, 2016, 4:55:14 PM6/16/16
to Couchbase Mobile
I just found a workaround actually.

If I take the code that's within the MAPBLOCK and put it into a separate method and call it within the MAPBLOCK, then I can put breakpoints in that method and it works.

I didn't know about that simulating breakpoints thing, but that's cool too.

Thanks!

Brendan
Reply all
Reply to author
Forward
0 new messages