Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(864)

Side by Side Diff: src/debug.cc

Issue 10627015: Actually put debug information on stack when aborting. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/debug.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 878 matching lines...) Expand 10 before | Expand all | Expand 10 after
889 void Debug::Iterate(ObjectVisitor* v) { 889 void Debug::Iterate(ObjectVisitor* v) {
890 v->VisitPointer(BitCast<Object**>(&(debug_break_return_))); 890 v->VisitPointer(BitCast<Object**>(&(debug_break_return_)));
891 v->VisitPointer(BitCast<Object**>(&(debug_break_slot_))); 891 v->VisitPointer(BitCast<Object**>(&(debug_break_slot_)));
892 } 892 }
893 893
894 894
895 void Debug::PutValuesOnStackAndDie(int start, 895 void Debug::PutValuesOnStackAndDie(int start,
896 Address c_entry_fp, 896 Address c_entry_fp,
897 Address last_fp, 897 Address last_fp,
898 Address larger_fp, 898 Address larger_fp,
899 Address last_in_fp,
900 Address last_out_fp,
899 int count, 901 int count,
900 int end) { 902 int end) {
903 OS::PrintError("start: %d\n", start);
904 OS::PrintError("c_entry_fp: %p\n", static_cast<void*>(c_entry_fp));
905 OS::PrintError("last_fp: %p\n", static_cast<void*>(last_fp));
906 OS::PrintError("larger_fp: %p\n", static_cast<void*>(larger_fp));
907 OS::PrintError("last_in_fp: %p\n", static_cast<void*>(last_in_fp));
908 OS::PrintError("last_out_fp: %p\n", static_cast<void*>(last_out_fp));
909 OS::PrintError("count: %d\n", count);
910 OS::PrintError("end: %d\n", end);
901 OS::Abort(); 911 OS::Abort();
902 } 912 }
903 913
904 914
905 Object* Debug::Break(Arguments args) { 915 Object* Debug::Break(Arguments args) {
906 Heap* heap = isolate_->heap(); 916 Heap* heap = isolate_->heap();
907 HandleScope scope(isolate_); 917 HandleScope scope(isolate_);
908 ASSERT(args.length() == 0); 918 ASSERT(args.length() == 0);
909 919
910 thread_local_.frame_drop_mode_ = FRAMES_UNTOUCHED; 920 thread_local_.frame_drop_mode_ = FRAMES_UNTOUCHED;
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
1003 // - C entry FP at which to start stack crawl. 1013 // - C entry FP at which to start stack crawl.
1004 // - FP of the frame at which we plan to stop stepping out (last FP). 1014 // - FP of the frame at which we plan to stop stepping out (last FP).
1005 // - current FP that's larger than last FP. 1015 // - current FP that's larger than last FP.
1006 // - Counter for the number of steps to step out. 1016 // - Counter for the number of steps to step out.
1007 if (it.done()) { 1017 if (it.done()) {
1008 // We crawled the entire stack, never reaching last_fp_. 1018 // We crawled the entire stack, never reaching last_fp_.
1009 PutValuesOnStackAndDie(0xBEEEEEEE, 1019 PutValuesOnStackAndDie(0xBEEEEEEE,
1010 frame->fp(), 1020 frame->fp(),
1011 thread_local_.last_fp_, 1021 thread_local_.last_fp_,
1012 NULL, 1022 NULL,
1023 thread_local_.step_into_fp_,
1024 thread_local_.step_out_fp_,
1013 count, 1025 count,
1014 0xFEEEEEEE); 1026 0xFEEEEEEE);
1015 } else if (it.frame()->fp() != thread_local_.last_fp_) { 1027 } else if (it.frame()->fp() != thread_local_.last_fp_) {
1016 // We crawled over last_fp_, without getting a match. 1028 // We crawled over last_fp_, without getting a match.
1017 PutValuesOnStackAndDie(0xBEEEEEEE, 1029 PutValuesOnStackAndDie(0xBEEEEEEE,
1018 frame->fp(), 1030 frame->fp(),
1019 thread_local_.last_fp_, 1031 thread_local_.last_fp_,
1020 it.frame()->fp(), 1032 it.frame()->fp(),
1033 thread_local_.step_into_fp_,
1034 thread_local_.step_out_fp_,
1021 count, 1035 count,
1022 0xFEEEEEEE); 1036 0xFEEEEEEE);
1023 } 1037 }
1024 1038
1025 // If we found original frame 1039 // If we found original frame
1026 if (it.frame()->fp() == thread_local_.last_fp_) { 1040 if (it.frame()->fp() == thread_local_.last_fp_) {
1027 if (step_count > 1) { 1041 if (step_count > 1) {
1028 // Save old count and action to continue stepping after 1042 // Save old count and action to continue stepping after
1029 // StepOut 1043 // StepOut
1030 thread_local_.queued_step_count_ = step_count - 1; 1044 thread_local_.queued_step_count_ = step_count - 1;
(...skipping 2655 matching lines...) Expand 10 before | Expand all | Expand 10 after
3686 { 3700 {
3687 Locker locker; 3701 Locker locker;
3688 Isolate::Current()->debugger()->CallMessageDispatchHandler(); 3702 Isolate::Current()->debugger()->CallMessageDispatchHandler();
3689 } 3703 }
3690 } 3704 }
3691 } 3705 }
3692 3706
3693 #endif // ENABLE_DEBUGGER_SUPPORT 3707 #endif // ENABLE_DEBUGGER_SUPPORT
3694 3708
3695 } } // namespace v8::internal 3709 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/debug.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698