Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 948289
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T23:13:14+00:00 2026-05-15T23:13:14+00:00

OK, so imagine that my breakpoint in objc_exception_throw has just triggered. I’m sitting at

  • 0

OK, so imagine that my breakpoint in objc_exception_throw has just triggered. I’m sitting at the debugger prompt, and I want to get some more information about the exception object. Where do I find it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T23:13:14+00:00Added an answer on May 15, 2026 at 11:13 pm

    The exception object is passed in as the first argument to objc_exception_throw. LLDB provides $arg1..$argn variables to refer to arguments in the correct calling convention, making it simple to print the exception details:

    (lldb) po $arg1
    (lldb) po [$arg1 name]
    (lldb) po [$arg1 reason]
    

    Make sure to select the objc_exception_throw frame in the call stack before executing these commands. See the “Advanced Debugging and the Address Sanitizer” in the WWDC15 session videos to see this performed on stage.

    Outdated Information

    If you’re on GDB, the syntax to refer to the first argument depends on the calling conventions of the architecture you’re running on. If you’re debugging on an actual iOS device, the pointer to the object is in register r0. To print it or send messages to it, use the following simple syntax:

    (gdb) po $r0
    (gdb) po [$r0 name]
    (gdb) po [$r0 reason]
    

    On the iPhone Simulator, all function arguments are passed on the stack, so the syntax is considerably more horrible. The shortest expression I could construct that gets to it is *(id *)($ebp + 8). To make things less painful, I suggest using a convenience variable:

    (gdb) set $exception = *(id *)($ebp + 8)
    (gdb) po $exception
    (gdb) po [$exception name]
    (gdb) po [$exception reason]
    

    You can also set $exception automatically whenever the breakpoint is triggered by adding a command list to the objc_exception_throw breakpoint.

    (Note that in all cases I tested, the exception object was also present in the eax and edx registers at the time the breakpoint hit. I’m not sure that’ll always be the case, though.)

    Added from comment below:

    In lldb, select the stack frame for objc_exception_throw and then enter this command:

    (lldb) po *(id *)($esp + 4)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Imagine that you have some text like this: Asdf I want the 'A' to
I imagine that there has to be some way to use reflection to do
Imagine that you want to develop a non-trivial end-user desktop (not web) application in
Imagine that I want to create an array from another array like this: $array
Imagine that I have url http://www.google.com/subdomain/blah-blah.../.. /.. So I want to extract 4 things
Imagine that I have a view with some UIKit object as its subview (for
Imagine that you want to design a tennis booking system. You have 5 tennis
Imagine that we have stuff we want done in the system and sometimes exceptions
Imagine that I have a matrix of 2x2 or 3x3 pictures and I want
Imagine that Byte[] refArchiveData is around 30-100 mbytes of size. I want to send

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.