[Openmcl-devel] What's the minimal way to start using the ObjectiveC bridge?

Gary Byers gb at clozure.com
Mon Apr 28 18:48:06 UTC 2014


That (the "trace/bpt trap") is usually a symptom of Apple leaving a debugger
breakpoint in some shared library (CoreFoundation, IIRC) if that library's
initialization code discovers that it's running on something other than
the initial thread.  (Apple's a multibillion dollar company; they'd have
several K$ less in the bank if they bothered to think about this a bit more.)

CCL has worked around this for the last several years by forcing shared libraries
to be opened on the main thread.  It's apparently the case that (at least on 10.9
and whatever OSX version you're using) some library initialization code runs lazily,
e.g., when some ObjC method is first invoked.  I'm curious enough about this to
want to look at things under GDB, but not curious enough to build GDB from source
or learn lldb ...


On Tue, 29 Apr 2014, Leo Liu wrote:

> On 2014-04-28 10:04 -0500, Paul Krueger wrote:
>> It's not entirely clear to me what you are trying to do, but perhaps
>>
>> (require :objc-support)
>>
>> is what you are looking for. This will make most objective-c
>> functionality available to you in a command line listener. This will
>> let you create and initialize objective-C objects, but there is no
>> cocoa application started in such an environment unless you create one
>> yourself and doing that correctly can be complex. You would also need
>> to explicitly handle all memory management for any objective-c objects
>> you create in this environment.
>
> Thanks for this. My CCL 1.9 is from Mac Homebrew and I keep getting
> segfaults:
>
> Welcome to Clozure Common Lisp Version 1.9-r15759  (DarwinX8664)!
> ? (require :objc-support)
> :OBJC-SUPPORT
> ("OBJC-PACKAGE" "SEQUENCE-UTILS" "NAME-TRANSLATION" "OBJC-CLOS" "OBJC-RUNTIME" "BRIDGE" "OBJC-SUPPORT")
> ? (objc:@selector #/addObject:forKey:)
> Trace/BPT trap: 5
>
> Leo
>
> _______________________________________________
> Openmcl-devel mailing list
> Openmcl-devel at clozure.com
> http://lists.clozure.com/mailman/listinfo/openmcl-devel
>
>


More information about the Openmcl-devel mailing list