Reviewers: Mads Ager,

Message:
Hi Mads,

This CL provides basic GDB JIT interface integration for the sake of V8
embedders who currently have to manually decode backtraces in gdb.

Here is an example of current backtrace:

-------------------------------------------
(gdb) bt
#0  Print (args=...) at samples/shell.cc:159
#1  0x0807eff9 in v8::internal::HandleApiCallHelper<false> (args=...) at
src/builtins.cc:1058
#2  0x0807c908 in v8::internal::Builtin_Impl_HandleApiCall (args=...) at
src/builtins.cc:1075
#3  0x0807c8ee in v8::internal::Builtin_HandleApiCall (args=...) at
src/builtins.cc:1074
#4  0xf5cae28e in ?? ()
#5  0xf5cc37a4 in ?? ()
#6  0xf5cafc1f in ?? ()
#7  0xf5cc3741 in ?? ()
#8  0xf5cc36df in ?? ()
#9  0xf5cc367b in ?? ()
#10 0xf5cbebd9 in ?? ()
#11 0xf5cb1e42 in ?? ()
-------------------------------------------

And here is an example of backtrace with gdbjit interface integration enabled:

-------------------------------------------
(gdb) bt
#0  Print (args=...) at samples/shell.cc:159
#1  0x0807eff9 in v8::internal::HandleApiCallHelper<false> (args=...) at
src/builtins.cc:1058
#2  0x0807c908 in v8::internal::Builtin_Impl_HandleApiCall (args=...) at
src/builtins.cc:1075
#3  0x0807c8ee in v8::internal::Builtin_HandleApiCall (args=...) at
src/builtins.cc:1074
#4  0xf5cae28e in ?? ()
#5  0xf5cc4724 in baz () at test.js:10
#6  0xf5cafc1f in ?? ()
#7  0xf5cc46c1 in bar () at test.js:6
#8  0xf5cc465f in foo () at test.js:2
#9  0xf5cc45fb in test.js () at test.js:13
#10 0xf5cbebd9 in ?? ()
#11 0xf5cb1e42 in ?? ()

(gdb) f 5
#5  0xf5cc4724 in baz () at test.js:10
10        print("inside baz");
(gdb) f 8
#8  0xf5cc465f in foo () at test.js:2
2         bar();
-------------------------------------------

This CL is as unobtrusive as possible. All tests in testsuite pass with full
integration enabled.

Current limitations:
- Only ia32 supported. Certain changes in ELF object generation should be made
to enable it on x64.
-  Information emitted in DWARF2 .line_info section is minimal and does not
cover all code, so setting breakpoints by line numbers and steping through
generated code with gdb is not possible.
- No stack unwinding information is emitted. Thus no information about locals
and function arguments will be available in gdb for generated code.
- If V8 is compiled with snapshot no in memory ELF objects will be generated for
code de-serialized from snapshot. Thus currently backtrace for V8 without
snapshot is more informative:

-------------------------------------------
#4  0xf5cae06e in STUB: CEntryStub ()
#5  0xf5cc3084 in baz () at test.js:10
#6  0xf5cae7ff in BUILTIN: ArgumentsAdaptorTrampoline ()
#7  0xf5cee6a9 in ?? ()
#8  0xf5cc3021 in bar () at test.js:6
#9  0xf5cc2fbf in foo () at test.js:2
#10 0xf5cc2f5b in test.js () at test.js:13
#11 0xf5caee99 in BUILTIN: JSEntryTrampoline ()
#12 0xf5cee6a9 in ?? ()
#13 0xf5cae2c2 in STUB: JSEntryStub ()
-------------------------------------------


Description:
Basic GDB JIT Interface integration.

It has certain overheads even when gdb is not attached so it is guarded by
ENABLE_GDBJIT_INTERFACE define and --gdbjit flag.

Please review this at http://codereview.chromium.org/5965011/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files:
  M SConstruct
  M src/SConscript
  M src/assembler.h
  M src/assembler.cc
  M src/bootstrapper.cc
  M src/builtins.cc
  M src/code-stubs.cc
  M src/compiler.cc
  M src/flag-definitions.h
  M src/full-codegen.cc
  A src/gdbjit.h
  A src/gdbjit.cc
  M src/mark-compact.cc
  M src/stub-cache.cc


--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to