 Chromium Code Reviews
 Chromium Code Reviews Issue 171107:
  X64: Implement debugger hooks.  (Closed)
    
  
    Issue 171107:
  X64: Implement debugger hooks.  (Closed) 
  | OLD | NEW | 
|---|---|
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without | 
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are | 
| 4 // met: | 4 // met: | 
| 5 // | 5 // | 
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright | 
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. | 
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above | 
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following | 
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided | 
| (...skipping 1441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1452 // Find the call address in the running code. This address holds the call to | 1452 // Find the call address in the running code. This address holds the call to | 
| 1453 // either a DebugBreakXXX or to the debug break return entry code if the | 1453 // either a DebugBreakXXX or to the debug break return entry code if the | 
| 1454 // break point is still active after processing the break point. | 1454 // break point is still active after processing the break point. | 
| 1455 Address addr = frame->pc() - Assembler::kTargetAddrToReturnAddrDist; | 1455 Address addr = frame->pc() - Assembler::kTargetAddrToReturnAddrDist; | 
| 1456 | 1456 | 
| 1457 // Check if the location is at JS exit. | 1457 // Check if the location is at JS exit. | 
| 1458 bool at_js_exit = false; | 1458 bool at_js_exit = false; | 
| 1459 RelocIterator it(debug_info->code()); | 1459 RelocIterator it(debug_info->code()); | 
| 1460 while (!it.done()) { | 1460 while (!it.done()) { | 
| 1461 if (RelocInfo::IsJSReturn(it.rinfo()->rmode())) { | 1461 if (RelocInfo::IsJSReturn(it.rinfo()->rmode())) { | 
| 1462 at_js_exit = it.rinfo()->pc() == addr - 1; | 1462 at_js_exit = | 
| 1463 (it.rinfo()->pc() == addr - Assembler::kReturnAddrPatchPrefixSize); | |
| 1463 } | 1464 } | 
| 1464 it.next(); | 1465 it.next(); | 
| 1465 } | 1466 } | 
| 1466 | 1467 | 
| 1467 // Handle the jump to continue execution after break point depending on the | 1468 // Handle the jump to continue execution after break point depending on the | 
| 1468 // break location. | 1469 // break location. | 
| 1469 if (at_js_exit) { | 1470 if (at_js_exit) { | 
| 1470 // First check if the call in the code is still the debug break return | 1471 // First check if the call in the code is still the debug break return | 
| 1471 // entry code. If it is the break point is still active. If not the break | 1472 // entry code. If it is the break point is still active. If not the break | 
| 1472 // point was removed during break point processing. | 1473 // point was removed during break point processing. | 
| 1473 if (Assembler::target_address_at(addr) == | 1474 if (Assembler::target_address_at(addr) == | 
| 1474 debug_break_return_entry()->entry()) { | 1475 debug_break_return_entry()->entry()) { | 
| 1475 // Break point still active. Jump to the corresponding place in the | 1476 // Break point still active. Jump to the corresponding place in the | 
| 1476 // original code. | 1477 // original code. | 
| 1477 addr += original_code->instruction_start() - code->instruction_start(); | 1478 addr += original_code->instruction_start() - code->instruction_start(); | 
| 1478 } | 1479 } | 
| 1479 | 1480 | 
| 1480 // Move one byte back to where the call instruction was placed. | 1481 // Move one byte back to where the call instruction was placed. | 
| 
Søren Thygesen Gjesse
2009/08/18 13:10:44
Comment out of sync with code.
 
Lasse Reichstein
2009/08/19 07:07:55
Fixed
 | |
| 1481 thread_local_.after_break_target_ = addr - 1; | 1482 thread_local_.after_break_target_ = | 
| 1483 addr - Assembler::kReturnAddrPatchPrefixSize; | |
| 1482 } else { | 1484 } else { | 
| 1483 // Check if there still is a debug break call at the target address. If the | 1485 // Check if there still is a debug break call at the target address. If the | 
| 1484 // break point has been removed it will have disappeared. If it have | 1486 // break point has been removed it will have disappeared. If it have | 
| 1485 // disappeared don't try to look in the original code as the running code | 1487 // disappeared don't try to look in the original code as the running code | 
| 1486 // will have the right address. This takes care of the case where the last | 1488 // will have the right address. This takes care of the case where the last | 
| 1487 // break point is removed from the function and therefore no "original code" | 1489 // break point is removed from the function and therefore no "original code" | 
| 1488 // is available. If the debug break call is still there find the address in | 1490 // is available. If the debug break call is still there find the address in | 
| 1489 // the original code. | 1491 // the original code. | 
| 1490 if (IsDebugBreak(Assembler::target_address_at(addr))) { | 1492 if (IsDebugBreak(Assembler::target_address_at(addr))) { | 
| 1491 // If the break point is still there find the call address which was | 1493 // If the break point is still there find the call address which was | 
| (...skipping 1071 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2563 | 2565 | 
| 2564 | 2566 | 
| 2565 void LockingCommandMessageQueue::Clear() { | 2567 void LockingCommandMessageQueue::Clear() { | 
| 2566 ScopedLock sl(lock_); | 2568 ScopedLock sl(lock_); | 
| 2567 queue_.Clear(); | 2569 queue_.Clear(); | 
| 2568 } | 2570 } | 
| 2569 | 2571 | 
| 2570 #endif // ENABLE_DEBUGGER_SUPPORT | 2572 #endif // ENABLE_DEBUGGER_SUPPORT | 
| 2571 | 2573 | 
| 2572 } } // namespace v8::internal | 2574 } } // namespace v8::internal | 
| OLD | NEW |