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

Side by Side Diff: src/gdb-jit.h

Issue 957673004: Rebase GDBJIT interface solely on JITCodeEvent (Closed) Base URL: https://chromium.googlesource.com/v8/v8@master
Patch Set: Address nits Created 5 years, 10 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 unified diff | Download patch
« no previous file with comments | « src/flag-definitions.h ('k') | src/gdb-jit.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_GDB_JIT_H_ 5 #ifndef V8_GDB_JIT_H_
6 #define V8_GDB_JIT_H_ 6 #define V8_GDB_JIT_H_
7 7
8 #include "src/allocation.h" 8 #include "src/v8.h"
9 9
10 // 10 //
11 // Basic implementation of GDB JIT Interface client. 11 // GDB has two ways of interacting with JIT code. With the "JIT compilation
12 // GBD JIT Interface is supported in GDB 7.0 and above. 12 // interface", V8 can tell GDB when it emits JIT code. Unfortunately to do so,
13 // Currently on x64 and ia32 architectures and Linux OS are supported. 13 // it has to create platform-native object files, possibly with platform-native
14 // debugging information. Currently only ELF and Mach-O are supported, which
15 // limits this interface to Linux and Mac OS. This JIT compilation interface
16 // was introduced in GDB 7.0. V8 support can be enabled with the --gdbjit flag.
14 // 17 //
15 18 // The other way that GDB can know about V8 code is via the "custom JIT reader"
16 #ifdef ENABLE_GDB_JIT_INTERFACE 19 // interface, in which a GDB extension parses V8's private data to determine the
17 #include "src/v8.h" 20 // function, file, and line of a JIT frame, and how to unwind those frames.
18 21 // This interface was introduced in GDB 7.6. This interface still relies on V8
19 #include "src/factory.h" 22 // to register its code via the JIT compilation interface, but doesn't require
23 // that V8 create ELF images. Support will be added for this interface in the
24 // future.
25 //
20 26
21 namespace v8 { 27 namespace v8 {
22 namespace internal { 28 namespace internal {
23 29 namespace GDBJITInterface {
24 class CompilationInfo; 30 #ifdef ENABLE_GDB_JIT_INTERFACE
25 31 // JitCodeEventHandler that creates ELF/Mach-O objects and registers them with
26 class GDBJITInterface: public AllStatic { 32 // GDB.
27 public: 33 void EventHandler(const v8::JitCodeEvent* event);
28 enum CodeTag { NON_FUNCTION, FUNCTION };
29
30 // Main entry point into GDB JIT realized as a JitCodeEventHandler.
31 static void EventHandler(const v8::JitCodeEvent* event);
32
33 static void AddCode(Handle<Name> name,
34 Handle<Script> script,
35 Handle<Code> code,
36 CompilationInfo* info);
37
38 static void RemoveCodeRange(Address start, Address end);
39
40 private:
41 static void AddCode(const char* name, Code* code, CodeTag tag, Script* script,
42 CompilationInfo* info);
43
44 static void RemoveCode(Code* code);
45 };
46
47 #define GDBJIT(action) GDBJITInterface::action
48
49 } } // namespace v8::internal
50 #else
51 #define GDBJIT(action) ((void) 0)
52 #endif 34 #endif
35 } // namespace GDBJITInterface
36 } // namespace internal
37 } // namespace v8
53 38
54 #endif 39 #endif
OLDNEW
« no previous file with comments | « src/flag-definitions.h ('k') | src/gdb-jit.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698