Column handling fixes

This commit is contained in:
Jeremy 2023-09-20 17:39:51 -04:00
parent 209ce45157
commit ddcfbe0a88
No known key found for this signature in database
GPG Key ID: 19AA8270105E8EB4
2 changed files with 4 additions and 4 deletions

View File

@ -38,7 +38,7 @@ namespace detail {
if(result[i].line == 0) {
result[i].line = trace[i].line;
}
if(result[i].column == 0) {
if(result[i].column == UINT_LEAST32_MAX) {
result[i].column = trace[i].column;
}
if(result[i].filename.empty()) {
@ -51,7 +51,7 @@ namespace detail {
}
std::vector<stacktrace_frame> resolve_frames(const std::vector<object_frame>& frames) {
std::vector<stacktrace_frame> trace(frames.size());
std::vector<stacktrace_frame> trace(frames.size(), stacktrace_frame { 0, 0, UINT_LEAST32_MAX, "", "" });
#if defined(CPPTRACE_GET_SYMBOLS_WITH_LIBDL) \
|| defined(CPPTRACE_GET_SYMBOLS_WITH_DBGHELP) \
|| defined(CPPTRACE_GET_SYMBOLS_WITH_LIBBACKTRACE)
@ -87,7 +87,7 @@ namespace detail {
|| defined(CPPTRACE_GET_SYMBOLS_WITH_ADDR2LINE)
auto dlframes = get_frames_object_info(frames);
#endif
std::vector<stacktrace_frame> trace(frames.size());
std::vector<stacktrace_frame> trace(frames.size(), stacktrace_frame { 0, 0, UINT_LEAST32_MAX, "", "" });
#ifdef CPPTRACE_GET_SYMBOLS_WITH_LIBDL
apply_trace(trace, libdl::resolve_frames(frames));
#endif

View File

@ -1014,7 +1014,7 @@ namespace libdwarf {
CPPTRACE_FORCE_NO_INLINE_FOR_PROFILING
stacktrace_frame resolve_frame(const object_frame& frame_info) {
stacktrace_frame frame{};
stacktrace_frame frame { 0, 0, UINT_LEAST32_MAX, "", "" };
frame.filename = frame_info.obj_path;
frame.symbol = frame_info.symbol;
frame.address = frame_info.raw_address;