[webkit-changes] [WebKit/WebKit] 314032: Backtrace print methods should be able to change s...

Abrar Rahman Protyasha noreply at github.com
Mon Feb 5 12:36:30 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 314032f5abcd40ed3f6e2178ded683ae2706a5ce
      https://github.com/WebKit/WebKit/commit/314032f5abcd40ed3f6e2178ded683ae2706a5ce
  Author: Abrar Rahman Protyasha <a_protyasha at apple.com>
  Date:   2024-02-05 (Mon, 05 Feb 2024)

  Changed paths:
    M Source/WTF/wtf/Assertions.cpp
    M Source/WTF/wtf/Assertions.h

  Log Message:
  -----------
  Backtrace print methods should be able to change stack depth at runtime
https://bugs.webkit.org/show_bug.cgi?id=268686
rdar://122229849

Reviewed by Tim Horton.

Currently, developers can change the stack depth printed by the
WTFReportBacktrace family of functions statically, but this also causes
a lot of rebuilding, which can be time consuming.

Instead, this patch provides two variants to the backtrace reporter
methods that take the desired stack depth as an argument, allowing
developers to reflect these changes at runtime (and not take compile
time hits). Namely, these functions are WTFReportBacktraceWithStackDepth
and WTFReportBacktraceWithPrefixAndStackDepth.

This patch also takes the liberty to pull out the framesToShow and
framesToSkip variables into translation unit constants within
Assertions.cpp, promoting better variable hygiene.

* Source/WTF/wtf/Assertions.cpp:
* Source/WTF/wtf/Assertions.h:

Canonical link: https://commits.webkit.org/274110@main




More information about the webkit-changes mailing list