Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions docs/source/initialsetup/compilingmame.rst
Original file line number Diff line number Diff line change
Expand Up @@ -656,6 +656,14 @@ SYMLEVEL
similar compilers, **1** includes line number tables and external variables,
**2** also includes local variables, and **3** also includes macro
definitions.
PDB_SYMBOLS
Set to **1** to generate CodeView format symbols in separate PDB files,
allowing source-level debugging using Microsoft Visual Studio or WinDbg.
It can also be used with other tools that can load symbols from PDB files,
e.g. the Intel VTune and AMD µProf performance analysis tools. This option
is only supported for MinGW builds using the clang compiler and the LLVM
linker (lld). This option only takes effect if the **SYMBOLS** option is
set to a non-zero value.
ARCHOPTS
Additional command-line options to pass to the compiler and linker. This is
useful for supplying code generation or ABI options, for example to enable
Expand Down
5 changes: 5 additions & 0 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
# OPTIMIZE = 3
# SYMBOLS = 1
# SYMLEVEL = 2
# PDB_SYMBOLS = 1
# MAP = 1
# PROFILE = 1
# ARCHOPTS =
Expand Down Expand Up @@ -627,6 +628,10 @@ ifdef SYMLEVEL
PARAMS += --SYMLEVEL='$(SYMLEVEL)'
endif

ifdef PDB_SYMBOLS
PARAMS += --PDB_SYMBOLS='$(PDB_SYMBOLS)'
endif

ifdef PROFILER
PARAMS += --PROFILER='$(PROFILER)'
endif
Expand Down
12 changes: 10 additions & 2 deletions scripts/genie.lua
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,11 @@ newoption {
description = "Symbols level.",
}

newoption {
trigger = "PDB_SYMBOLS",
description = "Generate CodeView PDB symbols.",
}

newoption {
trigger = "PROFILER",
description = "Include the internal profiler.",
Expand Down Expand Up @@ -718,9 +723,12 @@ local version = str_to_version(_OPTIONS["gcc_version"])
if _OPTIONS["SYMBOLS"]~=nil and _OPTIONS["SYMBOLS"]~="0" then
buildoptions {
"-g" .. _OPTIONS["SYMLEVEL"],
"-fno-omit-frame-pointer",
"-fno-optimize-sibling-calls",
}
if _OPTIONS["PDB_SYMBOLS"]~=nil and _OPTIONS["PDB_SYMBOLS"]~=0 then
buildoptions {
"-gcodeview",
}
end
end

--# we need to disable some additional implicit optimizations for profiling
Expand Down
2 changes: 1 addition & 1 deletion scripts/src/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ end
"Symbols", -- always include minimum symbols for executables
}

if _OPTIONS["SYMBOLS"] then
if _OPTIONS["SYMBOLS"]~=nil and _OPTIONS["SYMBOLS"]~=0 and (_OPTIONS["PDB_SYMBOLS"]==nil or _OPTIONS["PDB_SYMBOLS"]==0) then
local llvm_obdjump = false
local objdump_ver = backtick('objdump --version')
if string.match(objdump_ver, 'LLVM version ') then
Expand Down
6 changes: 6 additions & 0 deletions scripts/toolchain.lua
Original file line number Diff line number Diff line change
Expand Up @@ -604,6 +604,12 @@ function toolchain(_buildDir, _subDir)
end

function strip()
if _OPTIONS["PDB_SYMBOLS"]~=nil and _OPTIONS["PDB_SYMBOLS"]~=0 then
linkoptions {
"-Wl,--pdb=$(subst .exe,.pdb,$(TARGET))",
}
end

if _OPTIONS["STRIP_SYMBOLS"]~="1" then
return true
end
Expand Down
Loading