• 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
Re: gdb and mach exceptions
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gdb and mach exceptions


  • Subject: Re: gdb and mach exceptions
  • From: Jonas Maebe <email@hidden>
  • Date: Wed, 24 May 2006 08:33:06 +0200


On 23 mei 2006, at 22:33, Brendan Creane wrote:

Hello All, I have a simple but still unsolved problem
involving the interaction of the EXC_BAD_ACCESS
exception and gdb: I can't figure out how to get gdb
to pass the exception to my signal handler.

In theory, I think it should work by playing with the "inferior- handle-exceptions" setting (see "help obscure" and "show inferior- handle-exceptions" for slightly more info). It's not clear to me which kind of exceptions are deemed inferior though (mach or unix- style), since "show inferior-handle-exceptions" prints:


"If GDB should handle exceptions or pass them to the UNIX handler is on."

That's just as informative as "Are you running Mac OS X, Linux or Windows" - "Yes"

In practice, all I ever managed to do by changing that setting was to get gdb in an internal error state when a SIGSEGV occurs. Never got around to file a bug against it though.

The way I debugged my signal handling code was by

a) adding a print to my signal handlers (so I could see when a signal handler was entered) followed by a sleep(5)
b) keep a separate terminal window ready with "gdp -p <process id>" typed on the command line (but not yet executed)
c) when the signal handler was entered, press enter so gdb attaches


Not ideal, but it works.


Jonas _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >gdb and mach exceptions (From: Brendan Creane <email@hidden>)

  • Prev by Date: Re: StartupItems
  • Next by Date: Re: StartupItems
  • Previous by thread: gdb and mach exceptions
  • Next by thread: launchd and fork/exec?
  • Index(es):
    • Date
    • Thread