[all-commits] [llvm/llvm-project] 9c81b7: [lldb] Improve EXC_RESOURCE exception reason

Jonas Devlieghere via All-commits all-commits at lists.llvm.org
Fri Aug 5 11:19:59 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9c81b743e31a7dca288b37b6cf6cca3213bfd923
      https://github.com/llvm/llvm-project/commit/9c81b743e31a7dca288b37b6cf6cca3213bfd923
  Author: Jonas Devlieghere <jonas at devlieghere.com>
  Date:   2022-08-05 (Fri, 05 Aug 2022)

  Changed paths:
    M lldb/source/Plugins/Process/Utility/StopInfoMachException.cpp

  Log Message:
  -----------
  [lldb] Improve EXC_RESOURCE exception reason

Jason noted that the stop message we print for a memory high water mark
notification (EXC_RESOURCE) could be clearer. Currently, the stop
reason looks like this:

  * thread #3, queue = 'com.apple.CFNetwork.LoaderQ', stop reason =
    EXC_RESOURCE RESOURCE_TYPE_MEMORY (limit=14 MB, unused=0x0)

It's hard to read the message because the exception and the type
(EXC_RESOURCE RESOURCE_TYPE_MEMORY) blend together. Additionally, the
"observed=0x0" should not be printed for memory limit exceptions.

I wanted to continue to include the resource type from
<kern/exc_resource.h> while also explaining what it actually is. I used
the wording from the comments in the header. With this path, the stop
reason now looks like this:

  * thread #5, stop reason = EXC_RESOURCE (RESOURCE_TYPE_MEMORY: high
    watermark memory limit exceeded) (limit=14 MB)

rdar://40466897

Differential revision: https://reviews.llvm.org/D131130




More information about the All-commits mailing list