Add support for gnu debuglink
This commit is contained in:
parent
1689487978
commit
99230cb8fe
@ -7,6 +7,8 @@
|
||||
#if defined(_WIN32)
|
||||
#include <windows.h>
|
||||
|
||||
#define CPPTRACE_MAX_PATH MAX_PATH
|
||||
|
||||
namespace cpptrace {
|
||||
namespace detail {
|
||||
inline std::string program_name() {
|
||||
@ -35,6 +37,8 @@ namespace detail {
|
||||
#include <mach-o/dyld.h>
|
||||
#include <sys/syslimits.h>
|
||||
|
||||
#define CPPTRACE_MAX_PATH PATH_MAX
|
||||
|
||||
namespace cpptrace {
|
||||
namespace detail {
|
||||
inline const char* program_name() {
|
||||
@ -63,6 +67,8 @@ namespace detail {
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#define CPPTRACE_MAX_PATH PATH_MAX
|
||||
|
||||
namespace cpptrace {
|
||||
namespace detail {
|
||||
inline const char* program_name() {
|
||||
|
||||
@ -548,11 +548,14 @@ namespace libdwarf {
|
||||
}
|
||||
#endif
|
||||
|
||||
// Giving libdwarf a buffer for a true output path is needed for its automatic resolution of debuglink and
|
||||
// dSYM files. We don't utilize the dSYM logic here, we just care about debuglink.
|
||||
std::unique_ptr<char[]> buffer(new char[CPPTRACE_MAX_PATH]);
|
||||
Dwarf_Ptr errarg = 0;
|
||||
auto ret = dwarf_init_path(
|
||||
obj_path.c_str(),
|
||||
nullptr,
|
||||
0,
|
||||
buffer.get(),
|
||||
CPPTRACE_MAX_PATH,
|
||||
DW_GROUPNUMBER_ANY,
|
||||
err_handler,
|
||||
errarg,
|
||||
@ -563,7 +566,6 @@ namespace libdwarf {
|
||||
// fail, no debug info
|
||||
} else if(ret != DW_DLV_OK) {
|
||||
fprintf(stderr, "Error\n");
|
||||
} else {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user