| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 362 // Getters for the current exception break state. | 362 // Getters for the current exception break state. |
| 363 bool break_on_exception() { return break_on_exception_; } | 363 bool break_on_exception() { return break_on_exception_; } |
| 364 bool break_on_uncaught_exception() { | 364 bool break_on_uncaught_exception() { |
| 365 return break_on_uncaught_exception_; | 365 return break_on_uncaught_exception_; |
| 366 } | 366 } |
| 367 | 367 |
| 368 enum AddressId { | 368 enum AddressId { |
| 369 k_after_break_target_address, | 369 k_after_break_target_address, |
| 370 k_debug_break_return_address, | 370 k_debug_break_return_address, |
| 371 k_debug_break_slot_address, | 371 k_debug_break_slot_address, |
| 372 k_restarter_frame_function_pointer | 372 k_restarter_frame_function_pointer, |
| 373 k_c_entry_frame_to_ignore_exception |
| 373 }; | 374 }; |
| 374 | 375 |
| 375 // Support for setting the address to jump to when returning from break point. | 376 // Support for setting the address to jump to when returning from break point. |
| 376 Address* after_break_target_address() { | 377 Address* after_break_target_address() { |
| 377 return reinterpret_cast<Address*>(&thread_local_.after_break_target_); | 378 return reinterpret_cast<Address*>(&thread_local_.after_break_target_); |
| 378 } | 379 } |
| 379 Address* restarter_frame_function_pointer_address() { | 380 Address* restarter_frame_function_pointer_address() { |
| 380 Object*** address = &thread_local_.restarter_frame_function_pointer_; | 381 Object*** address = &thread_local_.restarter_frame_function_pointer_; |
| 381 return reinterpret_cast<Address*>(address); | 382 return reinterpret_cast<Address*>(address); |
| 382 } | 383 } |
| 383 | 384 |
| 385 void set_c_entry_frame_to_ignore_exception(Address fp) { |
| 386 thread_local_.c_entry_frame_to_ignore_exception_ = fp; |
| 387 } |
| 388 |
| 389 Address* c_entry_frame_to_ignore_exception_address() { |
| 390 return &thread_local_.c_entry_frame_to_ignore_exception_; |
| 391 } |
| 392 |
| 384 // Support for saving/restoring registers when handling debug break calls. | 393 // Support for saving/restoring registers when handling debug break calls. |
| 385 Object** register_address(int r) { | 394 Object** register_address(int r) { |
| 386 return ®isters_[r]; | 395 return ®isters_[r]; |
| 387 } | 396 } |
| 388 | 397 |
| 389 // Access to the debug break on return code. | 398 // Access to the debug break on return code. |
| 390 Code* debug_break_return() { return debug_break_return_; } | 399 Code* debug_break_return() { return debug_break_return_; } |
| 391 Code** debug_break_return_address() { | 400 Code** debug_break_return_address() { |
| 392 return &debug_break_return_; | 401 return &debug_break_return_; |
| 393 } | 402 } |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 609 // Top debugger entry. | 618 // Top debugger entry. |
| 610 EnterDebugger* debugger_entry_; | 619 EnterDebugger* debugger_entry_; |
| 611 | 620 |
| 612 // Pending interrupts scheduled while debugging. | 621 // Pending interrupts scheduled while debugging. |
| 613 int pending_interrupts_; | 622 int pending_interrupts_; |
| 614 | 623 |
| 615 // When restarter frame is on stack, stores the address | 624 // When restarter frame is on stack, stores the address |
| 616 // of the pointer to function being restarted. Otherwise (most of the time) | 625 // of the pointer to function being restarted. Otherwise (most of the time) |
| 617 // stores NULL. This pointer is used with 'step in' implementation. | 626 // stores NULL. This pointer is used with 'step in' implementation. |
| 618 Object** restarter_frame_function_pointer_; | 627 Object** restarter_frame_function_pointer_; |
| 628 |
| 629 // Store fp of CEntry frame, that should swallow exception and return |
| 630 // normally (because calling frame has already been patched). |
| 631 Address c_entry_frame_to_ignore_exception_; |
| 619 }; | 632 }; |
| 620 | 633 |
| 621 // Storage location for registers when handling debug break calls | 634 // Storage location for registers when handling debug break calls |
| 622 JSCallerSavedBuffer registers_; | 635 JSCallerSavedBuffer registers_; |
| 623 ThreadLocal thread_local_; | 636 ThreadLocal thread_local_; |
| 624 void ThreadInit(); | 637 void ThreadInit(); |
| 625 | 638 |
| 626 // Code to call for handling debug break on return. | 639 // Code to call for handling debug break on return. |
| 627 Code* debug_break_return_; | 640 Code* debug_break_return_; |
| 628 | 641 |
| (...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1015 } | 1028 } |
| 1016 | 1029 |
| 1017 static Debug_Address DebugBreakReturn() { | 1030 static Debug_Address DebugBreakReturn() { |
| 1018 return Debug_Address(Debug::k_debug_break_return_address); | 1031 return Debug_Address(Debug::k_debug_break_return_address); |
| 1019 } | 1032 } |
| 1020 | 1033 |
| 1021 static Debug_Address RestarterFrameFunctionPointer() { | 1034 static Debug_Address RestarterFrameFunctionPointer() { |
| 1022 return Debug_Address(Debug::k_restarter_frame_function_pointer); | 1035 return Debug_Address(Debug::k_restarter_frame_function_pointer); |
| 1023 } | 1036 } |
| 1024 | 1037 |
| 1038 static Debug_Address CEntryFrameToIgnoreException() { |
| 1039 return Debug_Address(Debug::k_c_entry_frame_to_ignore_exception); |
| 1040 } |
| 1041 |
| 1025 Address address(Isolate* isolate) const { | 1042 Address address(Isolate* isolate) const { |
| 1026 Debug* debug = isolate->debug(); | 1043 Debug* debug = isolate->debug(); |
| 1027 switch (id_) { | 1044 switch (id_) { |
| 1028 case Debug::k_after_break_target_address: | 1045 case Debug::k_after_break_target_address: |
| 1029 return reinterpret_cast<Address>(debug->after_break_target_address()); | 1046 return reinterpret_cast<Address>(debug->after_break_target_address()); |
| 1030 case Debug::k_debug_break_return_address: | 1047 case Debug::k_debug_break_return_address: |
| 1031 return reinterpret_cast<Address>(debug->debug_break_return_address()); | 1048 return reinterpret_cast<Address>(debug->debug_break_return_address()); |
| 1032 case Debug::k_debug_break_slot_address: | 1049 case Debug::k_debug_break_slot_address: |
| 1033 return reinterpret_cast<Address>(debug->debug_break_slot_address()); | 1050 return reinterpret_cast<Address>(debug->debug_break_slot_address()); |
| 1034 case Debug::k_restarter_frame_function_pointer: | 1051 case Debug::k_restarter_frame_function_pointer: |
| 1035 return reinterpret_cast<Address>( | 1052 return reinterpret_cast<Address>( |
| 1036 debug->restarter_frame_function_pointer_address()); | 1053 debug->restarter_frame_function_pointer_address()); |
| 1054 case Debug::k_c_entry_frame_to_ignore_exception: |
| 1055 return reinterpret_cast<Address>( |
| 1056 debug->c_entry_frame_to_ignore_exception_address()); |
| 1037 default: | 1057 default: |
| 1038 UNREACHABLE(); | 1058 UNREACHABLE(); |
| 1039 return NULL; | 1059 return NULL; |
| 1040 } | 1060 } |
| 1041 } | 1061 } |
| 1042 | 1062 |
| 1043 private: | 1063 private: |
| 1044 Debug::AddressId id_; | 1064 Debug::AddressId id_; |
| 1045 }; | 1065 }; |
| 1046 | 1066 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 1065 | 1085 |
| 1066 DISALLOW_COPY_AND_ASSIGN(MessageDispatchHelperThread); | 1086 DISALLOW_COPY_AND_ASSIGN(MessageDispatchHelperThread); |
| 1067 }; | 1087 }; |
| 1068 | 1088 |
| 1069 | 1089 |
| 1070 } } // namespace v8::internal | 1090 } } // namespace v8::internal |
| 1071 | 1091 |
| 1072 #endif // ENABLE_DEBUGGER_SUPPORT | 1092 #endif // ENABLE_DEBUGGER_SUPPORT |
| 1073 | 1093 |
| 1074 #endif // V8_DEBUG_H_ | 1094 #endif // V8_DEBUG_H_ |
| OLD | NEW |