Index: src/objects-printer.cc |
diff --git a/src/objects-printer.cc b/src/objects-printer.cc |
index 3aeefa00ef7159d5d728f2bb3f6600d014ed82b3..26c9b4da1aa0e328523b23ae8501f2e64c6082d2 100644 |
--- a/src/objects-printer.cc |
+++ b/src/objects-printer.cc |
@@ -1427,3 +1427,44 @@ void JSObject::PrintTransitions(std::ostream& os) { // NOLINT |
#endif // defined(DEBUG) || defined(OBJECT_PRINT) |
} // namespace internal |
} // namespace v8 |
+ |
+// |
+// The following functions are used by our gdb macros. |
+// |
+extern void _v8_internal_Print_Object(void* object) { |
+ reinterpret_cast<i::Object*>(object)->Print(); |
+} |
+ |
+extern void _v8_internal_Print_Code(void* object) { |
+ i::Isolate* isolate = i::Isolate::Current(); |
+ isolate->FindCodeObject(reinterpret_cast<i::Address>(object))->Print(); |
+} |
+ |
+extern void _v8_internal_Print_TypeFeedbackVector(void* object) { |
+ if (reinterpret_cast<i::Object*>(object)->IsSmi()) { |
+ printf("Not a type feedback vector\n"); |
+ } else { |
+ reinterpret_cast<i::TypeFeedbackVector*>(object)->Print(); |
+ } |
+} |
+ |
+extern void _v8_internal_Print_DescriptorArray(void* object) { |
+ if (reinterpret_cast<i::Object*>(object)->IsSmi()) { |
+ printf("Not a descriptor array\n"); |
+ } else { |
+ reinterpret_cast<i::DescriptorArray*>(object)->Print(); |
+ } |
+} |
+ |
+extern void _v8_internal_Print_TransitionArray(void* object) { |
+ if (reinterpret_cast<i::Object*>(object)->IsSmi()) { |
+ printf("Not a transition array\n"); |
+ } else { |
+ reinterpret_cast<i::TransitionArray*>(object)->Print(); |
+ } |
+} |
+ |
+extern void _v8_internal_Print_StackTrace() { |
+ i::Isolate* isolate = i::Isolate::Current(); |
+ isolate->PrintStack(stdout); |
+} |