MCPcopy Create free account
hub / github.com/crownengine/crown / addr2line

Function addr2line

src/core/debug/callstack_linux.cpp:30–54  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28 static pid_t demangler;
29
30 static const char *addr2line(char *line, int len, const char *addr)
31 {
32 char process_exe[256];
33 stbsp_snprintf(process_exe, sizeof(process_exe), "/proc/%u/exe", getpid());
34
35 const char *argv[] =
36 {
37 "addr2line",
38 "-s",
39 "-e",
40 process_exe,
41 addr,
42 NULL
43 };
44
45 Process pr;
46 if (pr.spawn(argv, CROWN_PROCESS_STDOUT_PIPE | CROWN_PROCESS_STDERR_MERGE) == 0) {
47 u32 num_read;
48 pr.read(&num_read, line, len);
49 line[num_read - 1] = '\0';
50 pr.wait();
51 return line;
52 }
53 return "<addr2line missing>";
54 }
55
56 static int demangler_main()
57 {

Callers 1

demangler_mainFunction · 0.85

Calls 4

getpidFunction · 0.85
spawnMethod · 0.80
readMethod · 0.45
waitMethod · 0.45

Tested by

no test coverage detected