Skip to content

Commit 8dc16f1

Browse files
committed
[nativeaot] Log location of the actual p/invoke stub called
Context: 869b0e0 The `pinvoke_unreachable` function, when invoked, would log its own source location instead of that of the call site. That's a bit useless in diagnosing issues, so let's improve it by logging the call site location... :)
1 parent ce1717f commit 8dc16f1

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/native/nativeaot/host/internal-pinvoke-stubs.cc

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,14 @@ using namespace xamarin::android;
55

66
namespace {
77
[[gnu::noreturn]]
8-
void pinvoke_unreachable ()
8+
void pinvoke_unreachable (std::source_location sloc = std::source_location::current ())
99
{
10-
Helpers::abort_application (LOG_DEFAULT, "The method is not implemented. This is a stub and should not be called."sv);
10+
Helpers::abort_application (
11+
LOG_DEFAULT,
12+
"The p/invoke is not implemented. This is a stub and should not be called."sv,
13+
true, // log_location
14+
sloc
15+
);
1116
}
1217
}
1318

0 commit comments

Comments
 (0)