-
Notifications
You must be signed in to change notification settings - Fork 538
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace all exit()
calls with abort()
in native code
#7734
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -248,7 +248,7 @@ Debug::start_debugging_and_profiling () | |
DebuggerConnectionStatus res = start_connection (connect_args); | ||
if (res == DebuggerConnectionStatus::Error) { | ||
log_fatal (LOG_DEBUGGER, "Could not start a connection to the debugger with connection args '%s'.", connect_args); | ||
exit (FATAL_EXIT_DEBUGGER_CONNECT); | ||
Helpers::abort_application (); | ||
} else if (res == DebuggerConnectionStatus::Connected) { | ||
/* Wait for XS to configure debugging/profiling */ | ||
gettimeofday(&wait_tv, nullptr); | ||
|
@@ -474,7 +474,7 @@ Debug::process_cmd (int fd, char *cmd) | |
log_info (LOG_DEFAULT, "Debugger requested an exit, will exit immediately.\n"); | ||
fflush (stdout); | ||
fflush (stderr); | ||
exit (0); | ||
Helpers::abort_application (); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This gives me pause; the original As this is part of the debugging infrastructure, I think it may be safer to keep this as There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The problem here is that the intention is to terminate the application From the pov of the debugger the application dies anyway |
||
} | ||
|
||
bool use_fd = false; | ||
|
@@ -655,7 +655,7 @@ xamarin::android::conn_thread (void *arg) | |
res = instance->handle_server_connection (); | ||
if (res && res != 3) { | ||
log_fatal (LOG_DEBUGGER, "Error communicating with the IDE, exiting..."); | ||
exit (FATAL_EXIT_DEBUGGER_CONNECT); | ||
Helpers::abort_application (); | ||
} | ||
|
||
return nullptr; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#include "helpers.hh" | ||
|
||
using namespace xamarin::android; | ||
|
||
[[noreturn]] void | ||
Helpers::abort_application () noexcept | ||
{ | ||
std::abort (); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are all of these
FATAL_EXIT_*
constants somewhere, where we could delete those, too?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They're in JI, and one or two are used there and since JI runs on desktop, the use of
exit()
is fine I guess. @jonpryor?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the
FATAL_EXIT_*
constants are in xamarin/java.interop, some of which are used there.