software

You are currently browsing the archive for the software category.

Photoluna 1.1 is (almost) here

Good news for those of you waiting for the next version of Photoluna! We finished and submitted version 1.1 last week, and it is currently under review by Apple. If all goes well it should be available within the next week. We have our fingers crossed.

“But how much will the upgrade cost,” you ask? Nothing! This upgrade will be free to all current customers.

“What’s in the upgrade?” Ah, for that, you’ll have to wait a little longer…

October “Blahs” Sale

Photoluna, for iPhone and iPod Touch, is on sale right now for 50% off (on top of the every-day 20% discount from its release price). This sale will only last a few days, so act quickly!

Photoluna End-of-Summer Sale

Photoluna, for iPhone and iPod Touch, is on sale right now for 60% off. This sale will only last a few days, so act quickly!

Breaking into the debugger on ARM

From time to time, it’s useful to break into the debugger programmatically. The simplest way to accomplish this on Mac OS X and iPhone OS is with raise(SIGINT), to wit:

#define DebugBreak()    raise(SIGINT)

There is one problem with this technique, however: the debugger (gdb) will break well inside the raise call (actually inside __kill called by kill called by raise), and more often then not will be unable to display the contents of local variables in the function that called raise(SIGINT).

The secret, of course, is to define an entirely inline version of raise(SIGINT). The implementation for raise is simple enough; kill is an even simpler wrapper around __kill.

int raise(int signo)
{
    return kill(getpid(), signo);
}
int kill(pid_t pid, int signo)
{
    return __kill(pid, signo, 1);
}

The final pieces, getpid and __kill, simply call system routines through the syscall mechanism.

So now we can update Matt Gallagher’s article by adding support for ARM (iPhone and iPod Touch) like so:

#if __ppc64__ || __ppc__
    #define BSDebugBreak() \
        do { \
            __asm__("li r0, 20\nsc\nnop\nli r0, 37\nli r4, 2\nsc\nnop\n" \
              : : : "memory","r0","r3","r4" ); \
           } while (0)
#elif __i386__ || __x86_64__
    #define BSDebugBreak() \
        do {__asm__{"int $3\n" : : );} while (0)
#elif __arm__
    #define BSDebugBreak() \
        do { \
        __asm__("mov r0, #20\nmov ip, r0\nsvc 128\nmov r1, #37\nmov ip, r1\nmov r1, #2\nmov r2, #1\n svc 128\n" \
            : : : "memory","ip","r0","r1","r2"); \
        } while (0)
#else // unknown architecture
    #define BSDebugBreak() raise(SIGINT)
#endif

I have omitted Matt’s references to if(AmIBeingDebugged()) as I prefer to make that test optional and explicit in the client code rather than include it in the BSDebugBreak macro. I’ve also added a clause for unknown, future architectures (it is usually wise to assume another architecture is just over the horizon). My personal version of this macro definition has an #error directive in place of the raise(SIGINT) version.

Download BSDebugBreak.h

Photoluna updates

In late June, we released Photoluna 1.0.1 to the iTunes App Store. Since then, we have been working hard on the next version (“1.1”). This upcoming release will likely require OS 3.0. The reason is fairly simple: We no longer have any devices available for testing that are running earlier versions, and it is not possible to “downgrade” an iPhone or iPod Touch once it has been upgrade to 3.0.

Stay tuned for more information about version 1.1 in the coming weeks, or follow us on Twitter!

« Older entries § Newer entries »