MCPcopy Create free account
hub / github.com/Overload-Technologies/Overload / elf_try_debugfile

Function elf_try_debugfile

Dependencies/tracy/libbacktrace/elf.cpp:941–969  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

939 DEBUGLINK_NAME. Returns an open file descriptor, or -1. */
940
941static int
942elf_try_debugfile (struct backtrace_state *state, const char *prefix,
943 size_t prefix_len, const char *prefix2, size_t prefix2_len,
944 const char *debuglink_name,
945 backtrace_error_callback error_callback, void *data)
946{
947 size_t debuglink_len;
948 size_t try_len;
949 char *Try;
950 int does_not_exist;
951 int ret;
952
953 debuglink_len = strlen (debuglink_name);
954 try_len = prefix_len + prefix2_len + debuglink_len + 1;
955 Try = (char*)backtrace_alloc (state, try_len, error_callback, data);
956 if (Try == NULL)
957 return -1;
958
959 memcpy (Try, prefix, prefix_len);
960 memcpy (Try + prefix_len, prefix2, prefix2_len);
961 memcpy (Try + prefix_len + prefix2_len, debuglink_name, debuglink_len);
962 Try[prefix_len + prefix2_len + debuglink_len] = '\0';
963
964 ret = backtrace_open (Try, error_callback, data, &does_not_exist);
965
966 backtrace_free (state, Try, try_len, error_callback, data);
967
968 return ret;
969}
970
971/* Find a separate debug info file, using the debuglink section data
972 to find it. Returns an open file descriptor, or -1. */

Callers 1

Calls 3

backtrace_allocFunction · 0.85
backtrace_openFunction · 0.85
backtrace_freeFunction · 0.85

Tested by

no test coverage detected