| 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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 ASSERT(!RinfoDone()); | 87 ASSERT(!RinfoDone()); |
| 88 | 88 |
| 89 // Iterate through reloc info for code and original code stopping at each | 89 // Iterate through reloc info for code and original code stopping at each |
| 90 // breakable code target. | 90 // breakable code target. |
| 91 bool first = break_point_ == -1; | 91 bool first = break_point_ == -1; |
| 92 while (!RinfoDone()) { | 92 while (!RinfoDone()) { |
| 93 if (!first) RinfoNext(); | 93 if (!first) RinfoNext(); |
| 94 first = false; | 94 first = false; |
| 95 if (RinfoDone()) return; | 95 if (RinfoDone()) return; |
| 96 | 96 |
| 97 // Update the current source position each time a source position is | 97 // Whenever a statement position or (plain) position is passed update the |
| 98 // passed. | 98 // current value of these. |
| 99 if (is_position(rmode())) { | 99 if (is_position(rmode())) { |
| 100 position_ = rinfo()->data() - debug_info_->shared()->start_position(); | |
| 101 if (is_statement_position(rmode())) { | 100 if (is_statement_position(rmode())) { |
| 102 statement_position_ = | 101 statement_position_ = |
| 103 rinfo()->data() - debug_info_->shared()->start_position(); | 102 rinfo()->data() - debug_info_->shared()->start_position(); |
| 104 } | 103 } |
| 104 // Always update the position as we don't want that to be before the |
| 105 // statement position. |
| 106 position_ = rinfo()->data() - debug_info_->shared()->start_position(); |
| 105 ASSERT(position_ >= 0); | 107 ASSERT(position_ >= 0); |
| 106 ASSERT(statement_position_ >= 0); | 108 ASSERT(statement_position_ >= 0); |
| 107 } | 109 } |
| 108 | 110 |
| 109 // Check for breakable code target. Look in the original code as setting | 111 // Check for breakable code target. Look in the original code as setting |
| 110 // break points can cause the code targets in the running (debugged) code to | 112 // break points can cause the code targets in the running (debugged) code to |
| 111 // be of a different kind than in the original code. | 113 // be of a different kind than in the original code. |
| 112 if (is_code_target(rmode())) { | 114 if (is_code_target(rmode())) { |
| 113 Address target = original_rinfo()->target_address(); | 115 Address target = original_rinfo()->target_address(); |
| 114 Code* code = Debug::GetCodeTarget(target); | 116 Code* code = Debug::GetCodeTarget(target); |
| (...skipping 856 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 971 // statement is hit. | 973 // statement is hit. |
| 972 if (thread_local_.last_step_action_ == StepNext || | 974 if (thread_local_.last_step_action_ == StepNext || |
| 973 thread_local_.last_step_action_ == StepIn) { | 975 thread_local_.last_step_action_ == StepIn) { |
| 974 // Never continue if returning from function. | 976 // Never continue if returning from function. |
| 975 if (break_location_iterator->IsExit()) return false; | 977 if (break_location_iterator->IsExit()) return false; |
| 976 | 978 |
| 977 // Continue if we are still on the same frame and in the same statement. | 979 // Continue if we are still on the same frame and in the same statement. |
| 978 int current_statement_position = | 980 int current_statement_position = |
| 979 break_location_iterator->code()->SourceStatementPosition(frame->pc()); | 981 break_location_iterator->code()->SourceStatementPosition(frame->pc()); |
| 980 return thread_local_.last_fp_ == frame->fp() && | 982 return thread_local_.last_fp_ == frame->fp() && |
| 981 thread_local_.last_statement_position_ == current_statement_position; | 983 thread_local_.last_statement_position_ == current_statement_position; |
| 982 } | 984 } |
| 983 | 985 |
| 984 // No step next action - don't continue. | 986 // No step next action - don't continue. |
| 985 return false; | 987 return false; |
| 986 } | 988 } |
| 987 | 989 |
| 988 | 990 |
| 989 // Check whether the code object at the specified address is a debug break code | 991 // Check whether the code object at the specified address is a debug break code |
| 990 // object. | 992 // object. |
| 991 bool Debug::IsDebugBreak(Address addr) { | 993 bool Debug::IsDebugBreak(Address addr) { |
| (...skipping 977 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1969 } | 1971 } |
| 1970 | 1972 |
| 1971 | 1973 |
| 1972 void LockingMessageQueue::Clear() { | 1974 void LockingMessageQueue::Clear() { |
| 1973 ScopedLock sl(lock_); | 1975 ScopedLock sl(lock_); |
| 1974 queue_.Clear(); | 1976 queue_.Clear(); |
| 1975 } | 1977 } |
| 1976 | 1978 |
| 1977 | 1979 |
| 1978 } } // namespace v8::internal | 1980 } } // namespace v8::internal |
| OLD | NEW |