8143291: Remove redundant coding around os::exception_name

Reviewed-by: dholmes, coleenp
This commit is contained in:
Thomas Stuefe 2015-12-01 21:30:34 -05:00
parent 40f65439e2
commit 9e9eac05ae
14 changed files with 167 additions and 480 deletions

View file

@ -6033,3 +6033,36 @@ void TestReserveMemorySpecial_test() {
UseNUMAInterleaving = old_use_numa_interleaving;
}
#endif // PRODUCT
/*
All the defined signal names for Windows.
NOTE that not all of these names are accepted by FindSignal!
For various reasons some of these may be rejected at runtime.
Here are the names currently accepted by a user of sun.misc.Signal with
1.4.1 (ignoring potential interaction with use of chaining, etc):
(LIST TBD)
*/
int os::get_signal_number(const char* name) {
static const struct {
char* name;
int number;
} siglabels [] =
// derived from version 6.0 VC98/include/signal.h
{"ABRT", SIGABRT, // abnormal termination triggered by abort cl
"FPE", SIGFPE, // floating point exception
"SEGV", SIGSEGV, // segment violation
"INT", SIGINT, // interrupt
"TERM", SIGTERM, // software term signal from kill
"BREAK", SIGBREAK, // Ctrl-Break sequence
"ILL", SIGILL}; // illegal instruction
for(int i=0;i<sizeof(siglabels)/sizeof(struct siglabel);i++)
if(!strcmp(name, siglabels[i].name))
return siglabels[i].number;
return -1;
}