Mercurial > hg > graal-compiler
comparison src/os/windows/vm/os_windows.cpp @ 4872:aa3d708d67c4
7141200: log some interesting information in ring buffers for crashes
Reviewed-by: kvn, jrose, kevinw, brutisso, twisti, jmasa
author | never |
---|---|
date | Wed, 01 Feb 2012 07:59:01 -0800 |
parents | d7e3846464d0 |
children | 379b22e03c32 |
comparison
equal
deleted
inserted
replaced
4871:f067b4e0e04b | 4872:aa3d708d67c4 |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. | 2 * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * | 4 * |
5 * This code is free software; you can redistribute it and/or modify it | 5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as | 6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
2086 #ifdef _M_IA64 | 2086 #ifdef _M_IA64 |
2087 assert(0, "Fix Handle_IDiv_Exception"); | 2087 assert(0, "Fix Handle_IDiv_Exception"); |
2088 #elif _M_AMD64 | 2088 #elif _M_AMD64 |
2089 PCONTEXT ctx = exceptionInfo->ContextRecord; | 2089 PCONTEXT ctx = exceptionInfo->ContextRecord; |
2090 address pc = (address)ctx->Rip; | 2090 address pc = (address)ctx->Rip; |
2091 NOT_PRODUCT(Events::log("idiv overflow exception at " INTPTR_FORMAT , pc)); | |
2092 assert(pc[0] == 0xF7, "not an idiv opcode"); | 2091 assert(pc[0] == 0xF7, "not an idiv opcode"); |
2093 assert((pc[1] & ~0x7) == 0xF8, "cannot handle non-register operands"); | 2092 assert((pc[1] & ~0x7) == 0xF8, "cannot handle non-register operands"); |
2094 assert(ctx->Rax == min_jint, "unexpected idiv exception"); | 2093 assert(ctx->Rax == min_jint, "unexpected idiv exception"); |
2095 // set correct result values and continue after idiv instruction | 2094 // set correct result values and continue after idiv instruction |
2096 ctx->Rip = (DWORD)pc + 2; // idiv reg, reg is 2 bytes | 2095 ctx->Rip = (DWORD)pc + 2; // idiv reg, reg is 2 bytes |
2098 ctx->Rdx = (DWORD)0; // remainder | 2097 ctx->Rdx = (DWORD)0; // remainder |
2099 // Continue the execution | 2098 // Continue the execution |
2100 #else | 2099 #else |
2101 PCONTEXT ctx = exceptionInfo->ContextRecord; | 2100 PCONTEXT ctx = exceptionInfo->ContextRecord; |
2102 address pc = (address)ctx->Eip; | 2101 address pc = (address)ctx->Eip; |
2103 NOT_PRODUCT(Events::log("idiv overflow exception at " INTPTR_FORMAT , pc)); | |
2104 assert(pc[0] == 0xF7, "not an idiv opcode"); | 2102 assert(pc[0] == 0xF7, "not an idiv opcode"); |
2105 assert((pc[1] & ~0x7) == 0xF8, "cannot handle non-register operands"); | 2103 assert((pc[1] & ~0x7) == 0xF8, "cannot handle non-register operands"); |
2106 assert(ctx->Eax == min_jint, "unexpected idiv exception"); | 2104 assert(ctx->Eax == min_jint, "unexpected idiv exception"); |
2107 // set correct result values and continue after idiv instruction | 2105 // set correct result values and continue after idiv instruction |
2108 ctx->Eip = (DWORD)pc + 2; // idiv reg, reg is 2 bytes | 2106 ctx->Eip = (DWORD)pc + 2; // idiv reg, reg is 2 bytes |
5329 _OpenProcessToken != NULL && | 5327 _OpenProcessToken != NULL && |
5330 _LookupPrivilegeValue != NULL; | 5328 _LookupPrivilegeValue != NULL; |
5331 } | 5329 } |
5332 | 5330 |
5333 #endif | 5331 #endif |
5334 |