Commit e063b711 authored by ishell's avatar ishell Committed by Commit bot

[gdb] Define print functions used by gdb macros in the top level namespace to...

[gdb] Define print functions used by gdb macros in the top level namespace to make them always be available.

This should fix the following errors that sometimes appear when using V8 gdb macros:
  Cannot evaluate function -- may be inlined
or
  No symbol "xxx" in namespace "v8::internal".

Review-Url: https://codereview.chromium.org/2186293002
Cr-Commit-Position: refs/heads/master@{#38145}
parent 70489a1b
......@@ -1469,3 +1469,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);
}
......@@ -4,7 +4,7 @@
# Print HeapObjects.
define job
print ((v8::internal::HeapObject*)($arg0))->Print()
call _v8_internal_Print_Object((void*)($arg0))
end
document job
Print a v8 JavaScript object
......@@ -13,7 +13,7 @@ end
# Print Code objects containing given PC.
define jco
job (v8::internal::Isolate::Current()->FindCodeObject((v8::internal::Address)$arg0))
call _v8_internal_Print_Code((void*)($arg0))
end
document jco
Print a v8 Code object from an internal code address
......@@ -22,7 +22,7 @@ end
# Print TypeFeedbackVector
define jfv
print ((v8::internal::TypeFeedbackVector*)($arg0))->Print()
call _v8_internal_Print_TypeFeedbackVector((void*)($arg0))
end
document jfv
Print a v8 TypeFeedbackVector object
......@@ -31,7 +31,7 @@ end
# Print DescriptorArray.
define jda
print ((v8::internal::DescriptorArray*)($arg0))->Print()
call _v8_internal_Print_DescriptorArray((void*)($arg0))
end
document jda
Print a v8 DescriptorArray object
......@@ -40,7 +40,7 @@ end
# Print TransitionArray.
define jta
print ((v8::internal::TransitionArray*)($arg0))->Print()
call _v8_internal_Print_TransitionArray((void*)($arg0))
end
document jta
Print a v8 TransitionArray object
......@@ -49,7 +49,7 @@ end
# Print JavaScript stack trace.
define jst
print v8::internal::Isolate::Current()->PrintStack((FILE*) stdout, 1)
call _v8_internal_Print_StackTrace()
end
document jst
Print the current JavaScript stack trace
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment