7#include <sonde/sonde_core_export.h>
9#include <QtCore/QJsonArray>
10#include <QtCore/QJsonObject>
11#include <QtCore/QString>
16namespace Sonde::Detail {
23 std::array<quintptr, kCapacity>
pcs{ };
49 static QString
capture(
RawStack &out, std::chrono::milliseconds timeout);
69 int moduleIndex(quintptr pc, quintptr &base);
77SONDE_CORE_EXPORT QString
formatSamples(
const QJsonArray &samples,
const QJsonArray &modules,
Names frames, and collects the modules they are in, for the samples of one event.
Definition stackcapture_p.h:58
QJsonArray m_modules
As modules() returns.
Definition stackcapture_p.h:71
QJsonArray frames(const RawStack &stack)
The frames of stack, as JSON objects: "module" (an index into modules()), "offset",...
Definition stackcapture.cpp:807
QList< quintptr > m_bases
Load address of each entry of m_modules.
Definition stackcapture_p.h:72
QJsonArray modules() const
The modules seen so far: "name", "path", "base" (hex) and "buildId".
Definition stackcapture_p.h:64
Taking samples of one thread's stack from another thread.
Definition stackcapture_p.h:38
static int signalNumber()
The signal used on Linux, or 0.
Definition stackcapture.cpp:433
static void release()
Stops targeting the thread; call it once no capture() can be running.
Definition stackcapture.cpp:431
static QString prepare()
Makes the calling thread the target.
Definition stackcapture.cpp:426
static QString capture(RawStack &out, std::chrono::milliseconds timeout)
Takes a sample of the target's stack into out, waiting at most timeout (Linux: for the signal handler...
Definition stackcapture.cpp:438
QString formatSamples(const QJsonArray &samples, const QJsonArray &modules, int topFrames)
The samples of one stall as text, one frame per line: identical samples folded, the top topFrames fra...
Definition stackcapture.cpp:918
A sample of a thread's stack: return addresses, innermost first.
Definition stackcapture_p.h:20
int count
How many of pcs are set.
Definition stackcapture_p.h:24
std::array< quintptr, kCapacity > pcs
Program counters; [0] is where the thread was.
Definition stackcapture_p.h:23
static constexpr int kCapacity
The most frames kept (design 0016: at most 64 per sample).
Definition stackcapture_p.h:22
int linkRegisterIndex
Index of a frame taken from the link register (arm64 macOS) rather than the stack,...
Definition stackcapture_p.h:28