Commit 9681eb5f authored by Mike Stanton's avatar Mike Stanton Committed by Commit Bot

[Builtins] Create DWARF debugging info for JavaScript builtins

Bug: v8:8418
Change-Id: I6d2efdf87bb4fc5454e5a4ee8e5a66463533615e
Reviewed-on: https://chromium-review.googlesource.com/c/1317810
Commit-Queue: Michael Stanton <mvstanton@chromium.org>
Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57273}
parent 4495cba3
......@@ -47,6 +47,34 @@
#define V8_ASM_BALIGN32 ".balign 32\n"
#define V8_ASM_LABEL(NAME) V8_ASM_MANGLE_LABEL NAME ":\n"
#if defined(V8_OS_WIN)
// The directives for inserting debugging information on Windows come
// from the PE (Portable Executable) and COFF (Common Object File Format)
// standards. Documented here:
// https://docs.microsoft.com/en-us/windows/desktop/debug/pe-format
#define V8_ASM_TYPE(NAME) \
/* .scl 2 means StorageClass external. */ \
/* .type 32 means Type Representation Function. */ \
".def " V8_ASM_MANGLE_LABEL NAME "; .scl 2; .type 32; .endef;\n"
#elif defined(V8_TARGET_ARCH_ARM) || defined(V8_TARGET_ARCH_ARM64)
// ELF format binaries on ARM use ".type <function name>, %function"
// to create a DWARF subprogram entry.
#define V8_ASM_TYPE(NAME) ".type " V8_ASM_MANGLE_LABEL NAME ", %function\n"
#else
// Other ELF Format binaries use ".type <function name>, @function"
// to create a DWARF subprogram entry.
#define V8_ASM_TYPE(NAME) ".type " V8_ASM_MANGLE_LABEL NAME ", @function\n"
#endif // !V8_OS_WIN
#define V8_ASM_DECLARE_FUNCTION(NAME) \
V8_ASM_LABEL(NAME) \
V8_ASM_TYPE(NAME)
// clang-format off
#if defined(V8_OS_AIX)
......
......@@ -190,10 +190,10 @@ class SnapshotWriter {
// stream.
if (is_default_variant) {
// Create nicer symbol names for the default mode.
fprintf(fp, "__asm__(V8_ASM_LABEL(\"Builtins_%s\"));\n",
fprintf(fp, "__asm__(V8_ASM_DECLARE_FUNCTION(\"Builtins_%s\"));\n",
i::Builtins::name(i));
} else {
fprintf(fp, "__asm__(V8_ASM_LABEL(\"%s_Builtins_%s\"));\n",
fprintf(fp, "__asm__(V8_ASM_DECLARE_FUNCTION(\"%s_Builtins_%s\"));\n",
embedded_variant, i::Builtins::name(i));
}
......
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