diff --git a/Userland/Libraries/LibJS/JIT/Compiler.cpp b/Userland/Libraries/LibJS/JIT/Compiler.cpp index d1d8b31e84..0d6f4a25f3 100644 --- a/Userland/Libraries/LibJS/JIT/Compiler.cpp +++ b/Userland/Libraries/LibJS/JIT/Compiler.cpp @@ -6,6 +6,7 @@ * SPDX-License-Identifier: BSD-2-Clause */ +#include #include #include #include @@ -3764,7 +3765,11 @@ OwnPtr Compiler::compile(Bytecode::Executable& bytecode_execut compiler.m_output.size(), }; - auto gdb_object = ::JIT::GDB::build_gdb_image(code, "LibJS JIT"sv, "LibJS JITted code"sv); + Optional> gdb_object {}; + + if (getenv("LIBJS_JIT_GDB")) { + gdb_object = ::JIT::GDB::build_gdb_image(code, "LibJS JIT"sv, "LibJS JITted code"sv); + } auto executable = make(executable_memory, compiler.m_output.size(), mapping, move(gdb_object)); if constexpr (DUMP_JIT_DISASSEMBLY)