diff --git a/src/xtd.core.native.macos/src/xtd/native/macos/stack_trace.mm b/src/xtd.core.native.macos/src/xtd/native/macos/stack_trace.mm index 07797698243..d7465d47c52 100644 --- a/src/xtd.core.native.macos/src/xtd/native/macos/stack_trace.mm +++ b/src/xtd.core.native.macos/src/xtd/native/macos/stack_trace.mm @@ -22,22 +22,22 @@ using frame = tuple; using frame_collection = vector; - tuple get_method_and_offset_from_address(address address) { + tuple get_method_and_offset(address address) { auto dl_info = Dl_info {}; if (!dladdr(address, &dl_info)) return make_tuple("", numeric_limits::max()); return make_tuple(__xtd_abi_demangle(dl_info.dli_sname ? dl_info.dli_sname : ""), reinterpret_cast(address) - reinterpret_cast(dl_info.dli_saddr)); } - frame_collection get_frames_without_file_info_from_addresses(const address_collection& addresses) { + frame_collection get_frames_without_file_info(const address_collection& addresses) { auto frames = ::frame_collection {}; for (const auto& address : addresses) { - auto [method, offset] = get_method_and_offset_from_address(address); + auto [method, offset] = get_method_and_offset(address); frames.emplace_back("", size_t {}, size_t {}, method, offset); } return frames; } - frame_collection get_frames_from_addresses(const address_collection& addresses) { + frame_collection get_frames(const address_collection& addresses) { auto ss = stringstream {}; ss << "atos -p " << getpid() << " "; for (const auto& address : addresses) @@ -63,7 +63,7 @@ frame_collection get_frames_from_addresses(const address_collection& addresses) } catch (...) { } } - auto [dummy, offset] = get_method_and_offset_from_address(addresses[index]); + auto [dummy, offset] = get_method_and_offset(addresses[index]); frames.emplace_back(file_name, line, size_t {}, method, offset); } return frames; @@ -81,7 +81,7 @@ frame_collection get_frames_from_addresses(const address_collection& addresses) addresses.erase(addresses.begin(), addresses.begin() + skip_frames + get_native_offset()); auto frames = frame_collection {}; - for (const auto& frame : need_file_info ? get_frames_from_addresses(addresses) : get_frames_without_file_info_from_addresses(addresses)) { + for (const auto& frame : need_file_info ? ::get_frames(addresses) : get_frames_without_file_info(addresses)) { if (get<3>(frame) == "start") break; frames.push_back(frame); }