Skip to content

Commit

Permalink
Remove offset from to_string method,
Browse files Browse the repository at this point in the history
  • Loading branch information
gammasoft71 committed Oct 22, 2024
1 parent 3cd69a7 commit d354a73
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/xtd.core/src/xtd/diagnostics/stack_trace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ string stack_trace::to_string(size_t skip_frames, const stack_frame& stack_frame
for (auto index = skip_frames; index < data_->frames.size(); ++index) {
if (index > skip_frames) str += xtd::environment::new_line();
str += " at " + data_->frames[index].get_method();
if (index == skip_frames && stack_frame != stack_frame::empty()) str += string::format(" {}in {}:line {}", data_->frames[index].get_offset() != stack_frame::OFFSET_UNKNOWN ? string::format("[0x{:X8}] ", data_->frames[index].get_offset()) : string::empty_string, stack_frame.get_file_name(), stack_frame.get_file_line_number());
else if (!data_->frames[index].get_file_name().empty()) str += string::format(" {}in {}:line {}", data_->frames[index].get_offset() != stack_frame::OFFSET_UNKNOWN ? string::format("[0x{:X8}] ", data_->frames[index].get_offset()) : string::empty_string, data_->frames[index].get_file_name(), data_->frames[index].get_file_line_number());
if (index == skip_frames && stack_frame != stack_frame::empty()) str += string::format(" in {}:line {}", stack_frame.get_file_name(), stack_frame.get_file_line_number());
else if (!data_->frames[index].get_file_name().empty()) str += string::format(" in {}:line {}", data_->frames[index].get_file_name(), data_->frames[index].get_file_line_number());
}
return str;
}

0 comments on commit d354a73

Please sign in to comment.