2011-01-18 16:11:01 +00:00
|
|
|
// Copyright 2010 the V8 project authors. All rights reserved.
|
2014-04-29 06:42:26 +00:00
|
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
|
|
// found in the LICENSE file.
|
2011-01-18 16:11:01 +00:00
|
|
|
|
|
|
|
#ifndef V8_GDB_JIT_H_
|
|
|
|
#define V8_GDB_JIT_H_
|
|
|
|
|
2015-08-11 07:34:10 +00:00
|
|
|
#include "include/v8.h"
|
2011-05-06 06:50:20 +00:00
|
|
|
|
2011-01-18 16:11:01 +00:00
|
|
|
//
|
2015-02-25 15:40:39 +00:00
|
|
|
// GDB has two ways of interacting with JIT code. With the "JIT compilation
|
|
|
|
// interface", V8 can tell GDB when it emits JIT code. Unfortunately to do so,
|
|
|
|
// it has to create platform-native object files, possibly with platform-native
|
|
|
|
// debugging information. Currently only ELF and Mach-O are supported, which
|
|
|
|
// limits this interface to Linux and Mac OS. This JIT compilation interface
|
|
|
|
// was introduced in GDB 7.0. V8 support can be enabled with the --gdbjit flag.
|
|
|
|
//
|
|
|
|
// The other way that GDB can know about V8 code is via the "custom JIT reader"
|
|
|
|
// interface, in which a GDB extension parses V8's private data to determine the
|
|
|
|
// function, file, and line of a JIT frame, and how to unwind those frames.
|
|
|
|
// This interface was introduced in GDB 7.6. This interface still relies on V8
|
|
|
|
// to register its code via the JIT compilation interface, but doesn't require
|
|
|
|
// that V8 create ELF images. Support will be added for this interface in the
|
|
|
|
// future.
|
2011-01-18 16:11:01 +00:00
|
|
|
//
|
2015-02-25 12:02:50 +00:00
|
|
|
|
2011-01-18 16:11:01 +00:00
|
|
|
namespace v8 {
|
|
|
|
namespace internal {
|
2015-02-25 15:40:39 +00:00
|
|
|
namespace GDBJITInterface {
|
|
|
|
#ifdef ENABLE_GDB_JIT_INTERFACE
|
|
|
|
// JitCodeEventHandler that creates ELF/Mach-O objects and registers them with
|
|
|
|
// GDB.
|
|
|
|
void EventHandler(const v8::JitCodeEvent* event);
|
2011-01-18 16:11:01 +00:00
|
|
|
#endif
|
2015-02-25 15:40:39 +00:00
|
|
|
} // namespace GDBJITInterface
|
|
|
|
} // namespace internal
|
|
|
|
} // namespace v8
|
2011-01-18 16:11:01 +00:00
|
|
|
|
2018-02-02 12:05:19 +00:00
|
|
|
#endif // V8_GDB_JIT_H_
|