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