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

Unified Diff: src/objects-printer.cc

Issue 2186293002: [gdb] Define print functions used by gdb macros in the top level namespace to make them always be a… (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 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 | « no previous file | tools/gdbinit » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
+}
« no previous file with comments | « no previous file | tools/gdbinit » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698