mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-22 10:30:29 +00:00
Overhaul process spawning
This commit is contained in:
parent
99dc1281f5
commit
26e254fb4d
96 changed files with 1848 additions and 1541 deletions
|
@ -18,22 +18,30 @@
|
|||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/intrin/describebacktrace.internal.h"
|
||||
#include "libc/intrin/kprintf.h"
|
||||
#include "libc/log/libfatal.internal.h"
|
||||
#include "libc/nexgen32e/stackframe.h"
|
||||
|
||||
#define N 64
|
||||
#define N 100
|
||||
|
||||
#define append(...) o += ksnprintf(buf + o, N - o, __VA_ARGS__)
|
||||
|
||||
const char *(DescribeBacktrace)(char buf[N], struct StackFrame *fr) {
|
||||
int o = 0;
|
||||
dontinstrument dontasan const char *(DescribeBacktrace)(char buf[N],
|
||||
struct StackFrame *fr) {
|
||||
bool gotsome = false;
|
||||
char *p = buf;
|
||||
char *pe = p + N;
|
||||
while (fr) {
|
||||
if (gotsome) {
|
||||
append(" ");
|
||||
if (p + 1 < pe) {
|
||||
*p++ = ' ';
|
||||
*p = 0;
|
||||
}
|
||||
} else {
|
||||
gotsome = true;
|
||||
}
|
||||
append("%x", fr->addr);
|
||||
if (p + 17 <= pe) {
|
||||
p = __hexcpy(p, fr->addr);
|
||||
}
|
||||
fr = fr->next;
|
||||
}
|
||||
return buf;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue