Use correct calling frame for QMacAutoReleasePool debug tracker

Using [NSAutoreleasePool showPools] to debug auto release pools
should now show the call site that allocated QMacAutoReleasePool,
instead of the QMacAutoReleasePool constructor, i.e.:

 ################  POOL 0x7f844c80c050
   0x600003644190    ^-- allocated in function: QCoreApplicationPrivate::init()
   0x600003a41080  __NSArrayM
   0x60000345cca0  __NSCFString
   0x600003a410e0  NSPathStore2
   0x600002141680  NSPathStore2
   0x6000036441b0  __NSSingleObjectArrayI

Change-Id: I52d22503c1d3de5a9dbae9939569d0836cc1a840
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
bb10
Tor Arne Vestbø 2022-09-04 16:45:55 +02:00
parent fc78059934
commit 778dcaa50d
1 changed files with 3 additions and 3 deletions

View File

@ -255,9 +255,9 @@ QMacAutoReleasePool::QMacAutoReleasePool()
#ifdef QT_DEBUG
void *poolFrame = nullptr;
void *frame;
if (backtrace_from_fp(__builtin_frame_address(0), &frame, 1))
poolFrame = frame;
void *frames[2];
if (backtrace_from_fp(__builtin_frame_address(0), frames, 2))
poolFrame = frames[1];
if (poolFrame) {
Dl_info info;