Skip to content

Commit 76c6e9a

Browse files
committed
Removed numLinesToSkip as this probably won't work now it's been broken out in to functions
1 parent e2c9524 commit 76c6e9a

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

Source/CrashHandler.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ namespace
4949
const char* header = "\n*** FAILED: VALIDATION CRASHED\n";
5050
[[ maybe_unused]] auto r = write (STDERR_FILENO, header, strlen (header));
5151

52-
writeStackTrace (crashLogPath, 2); // Skip handleCrash and juce::handleCrash)
52+
writeStackTrace (crashLogPath);
5353

5454
// Terminate normally to work around a bug in juce::ChildProcess::ActiveProcess::getExitStatus()
5555
// which returns 0 (a "pass" in the host process) if the child process terminates abnormally.

Source/native/pluginval_native_posix.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ inline void writeAsyncSignalSafe (int fd, const char* fmt, ...)
4848

4949
/** Writes the current stack trace and images to a given filepath and stderr.
5050
*/
51-
inline void writeStackTrace (const char* filePath, const int numLinesToSkip = 0)
51+
inline void writeStackTrace (const char* filePath)
5252
{
5353
// On Linux & Mac this is a signal handler, and therefore only "async-signal-safe" functions should be used.
5454
// This means nothing that uses malloc (juce::File, juce::String, std::string, std::vector etc.) or buffered I/O.
@@ -67,15 +67,15 @@ inline void writeStackTrace (const char* filePath, const int numLinesToSkip = 0)
6767
const char *imageNames[maxNumImages]{};
6868
int imageCount = 0;
6969

70-
for (int i = numLinesToSkip; i < stackCount; ++i)
70+
for (int i = 0; i < stackCount; ++i)
7171
{
7272
Dl_info info{};
7373

7474
// Warning: dladdr can deadlock under rare conditions on macOS - if dyld
7575
// is adding an image to its list
7676
if (! dladdr (stacktrace[i], &info))
7777
{
78-
writeAsyncSignalSafe (fd, "%-3d %-35s %p\n", i - numLinesToSkip, "", stacktrace[i]);
78+
writeAsyncSignalSafe (fd, "%-3d %-35s %p\n", i, "", stacktrace[i]);
7979
continue;
8080
}
8181

@@ -98,12 +98,12 @@ inline void writeStackTrace (const char* filePath, const int numLinesToSkip = 0)
9898
if (info.dli_saddr)
9999
{
100100
ptrdiff_t offset = static_cast<char*> (stacktrace[i]) - static_cast<char*> (info.dli_saddr);
101-
writeAsyncSignalSafe (fd, "%-3d %-35s %p %s + %ld\n", i - numLinesToSkip, imageName, stacktrace[i], info.dli_sname,
101+
writeAsyncSignalSafe (fd, "%-3d %-35s %p %s + %ld\n", i, imageName, stacktrace[i], info.dli_sname,
102102
offset);
103103
}
104104
else
105105
{
106-
writeAsyncSignalSafe (fd, "%-3d %-35s %p\n", i - numLinesToSkip, imageName, stacktrace[i]);
106+
writeAsyncSignalSafe (fd, "%-3d %-35s %p\n", i, imageName, stacktrace[i]);
107107
}
108108
}
109109

0 commit comments

Comments
 (0)