• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
c++ exceptions in objective c call stack
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

c++ exceptions in objective c call stack


  • Subject: c++ exceptions in objective c call stack
  • From: "Jim Crafton" <email@hidden>
  • Date: Fri, 4 Jul 2008 14:52:56 -0400

I have found stuff on the internet about issues with throwing C++
exceptions, and I've run into something which I think is what these
articles are talking about but I'm not 100% sure so I thought I'd ask.
I have some C+ code that is being called as a result of the AppKit
framework updating a view with the message drawRect:rect:
In the C++ code I throw an exception. Outside of this, several steps
down the stack frame, I have a C++ function that has a try catch, but
the catch doesn't ever seem to be called, instead the program just
exits. in Xcode the stack looks like:
#0	0x957a2b9e in __kill
#1	0x957a2b91 in kill$UNIX2003
#2	0x95819ec2 in raise
#3	0x9582947f in abort
#4	0x95123005 in __gnu_cxx::__verbose_terminate_handler
#5	0x9512110c in __gxx_personality_v0
#6	0x9512114b in std::terminate
#7	0x95121261 in __cxa_throw
#8	0x003786fe in VCF::FoundationKit::assertCondition at FoundationKit.cpp:205
#9	0x000067b4 in test1Window::paint at main.cpp:78
#10	0x009a9dfe in VCF::OSXWindow::internal_paint at OSXWindow.cpp:1029
#11	0x009a9eac in -[VCFWindowContentView drawRect:] at OSXWindow.cpp:147
#12	0x93c4b984 in -[NSView _drawRect:clip:]
//rest omitted for clarity
#22	0x93c08772 in -[NSWindow makeKeyAndOrderFront:]
#23	0x009a9614 in VCF::OSXWindow::setVisible at OSXWindow.cpp:371
#24	0x008d038f in VCF::Control::setVisible at Control.cpp:598
#25	0x0091eff9 in VCF::Frame::show at Frame.cpp:167
#26	0x00006f6d in test1Window::test1Window at main.cpp:70
#27	0x0000701d in test1Window::test1Window at main.cpp:71
#28	0x00007055 in test1Application::initRunningApplication at main.cpp:99
#29	0x0084ce97 in VCF::Application::internal_main at Application.cpp:162
#30	0x0084d9d9 in VCF::Application::main at Application.cpp:341
#31	0x00002237 in main at main.cpp:128

VCF::FoundationKit::assertCondition calls "throw".
VCF::Application::internal_main has a try/catch block, but I never end
up there. Is this the expected behaviour that people are talking about
when they refer to issues with ObjectiveC++ and C++ exceptions?

Thanks

Jim
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: c++ exceptions in objective c call stack
      • From: Scott Ribe <email@hidden>
    • Re: c++ exceptions in objective c call stack
      • From: Bill Bumgarner <email@hidden>
  • Prev by Date: Re: How to keep a window always in foreground?
  • Next by Date: Re: c++ exceptions in objective c call stack
  • Previous by thread: Re: CoreAnimation synchronous animations
  • Next by thread: Re: c++ exceptions in objective c call stack
  • Index(es):
    • Date
    • Thread