Skip to content

Commit

Permalink
Exception handling improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
alabuzhev committed Jan 13, 2025
1 parent e2a282d commit d380012
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
5 changes: 5 additions & 0 deletions far/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
--------------------------------------------------------------------------------
drkns 2025-01-13 22:03:15+00:00 - build 6414

1. Exception handling improvements.

--------------------------------------------------------------------------------
MZK 2025-01-12 18:20:23-05:00 - build 6413

Expand Down
8 changes: 3 additions & 5 deletions far/exception_handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1428,7 +1428,7 @@ static string exception_details(string_view const Module, EXCEPTION_RECORD const
string SymbolName;
tracer.get_symbols(Module, {{{ ExceptionRecord.ExceptionInformation[1], 0 }}}, [&](string&& Line)
{
SymbolName = std::move(Line);
SymbolName = trim_left(std::move(Line));
});

if (SymbolName.empty())
Expand All @@ -1437,7 +1437,7 @@ static string exception_details(string_view const Module, EXCEPTION_RECORD const
return SymbolName;
}();

auto Result = far::format(L"Memory at {} could not be {}"sv, Symbol, Mode);
auto Result = far::format(L"Memory at [{}] could not be {}"sv, Symbol, Mode);
if (NtStatus == EXCEPTION_IN_PAGE_ERROR && ExceptionRecord.NumberParameters >= 3)
append(Result, L": "sv, os::format_ntstatus(static_cast<NTSTATUS>(ExceptionRecord.ExceptionInformation[2])));

Expand Down Expand Up @@ -1570,10 +1570,8 @@ static string collect_information(
string Address, Name, Source;
tracer.get_symbol(ModuleName, Context.exception_record().ExceptionAddress, Address, Name, Source);

Address.insert(0, L"0x"sv);

if (!Name.empty())
append(Address, L" - "sv, Name);
append(Address, L' ', Name);

if (!Source.empty())
append(Address, L" ("sv, Source, L')');
Expand Down
2 changes: 1 addition & 1 deletion far/vbuild.m4
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6413
6414

0 comments on commit d380012

Please sign in to comment.