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

Unified Diff: src/debug.cc

Issue 10698116: Put additional information onto the stack when crashing in Debug::Break. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/debug.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/debug.cc
diff --git a/src/debug.cc b/src/debug.cc
index 777e23dac81a476d16ea77fbb4558be98ae98d43..40ddabb3cb1a37a85958a2b6799bdc3ba1330ba7 100644
--- a/src/debug.cc
+++ b/src/debug.cc
@@ -892,6 +892,7 @@ void Debug::Iterate(ObjectVisitor* v) {
}
+// TODO(131642): Remove this when fixed.
void Debug::PutValuesOnStackAndDie(int start,
Address c_entry_fp,
Address last_fp,
@@ -1009,6 +1010,7 @@ Object* Debug::Break(Arguments args) {
it.Advance();
}
+ // TODO(131642): Remove this when fixed.
// Catch the cases that would lead to crashes and capture
// - C entry FP at which to start stack crawl.
// - FP of the frame at which we plan to stop stepping out (last FP).
@@ -1017,18 +1019,23 @@ Object* Debug::Break(Arguments args) {
// - stack trace string.
if (it.done()) {
// We crawled the entire stack, never reaching last_fp_.
+ Handle<String> stack = isolate_->StackTraceString();
+ char buffer[8192];
+ int length = Min(8192, stack->length());
+ String::WriteToFlat(*stack, buffer, 0, length - 1);
PutValuesOnStackAndDie(0xBEEEEEEE,
frame->fp(),
thread_local_.last_fp_,
reinterpret_cast<Address>(0xDEADDEAD),
count,
- NULL,
+ buffer,
0xCEEEEEEE);
} else if (it.frame()->fp() != thread_local_.last_fp_) {
// We crawled over last_fp_, without getting a match.
Handle<String> stack = isolate_->StackTraceString();
char buffer[8192];
- String::WriteToFlat(*stack, buffer, 0, 8191);
+ int length = Min(8192, stack->length());
+ String::WriteToFlat(*stack, buffer, 0, length - 1);
PutValuesOnStackAndDie(0xDEEEEEEE,
frame->fp(),
thread_local_.last_fp_,
« 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