mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 14:47:44 +00:00
Meta: Remove unused debug flags, add missing GENERATE_DEBUG
Commands that were helpful while investigating this: ``` grep -P '^set' Meta/CMake/all_the_debug_macros.cmake \ | sed -Ee 's,set\((.+) ON\)$,\1,' > macros.lst for i in $(cat macros.lst); do echo -n "$i "; git grep -Pn '\b'"$i"'\b' | wc -l done | tee matches.lst sort -k2 -n matches.lst ```
This commit is contained in:
parent
c56481e73f
commit
173f872cda
4 changed files with 15 additions and 106 deletions
|
@ -17,20 +17,14 @@ set(CMAKE_DEBUG ON)
|
|||
set(COMMIT_DEBUG ON)
|
||||
set(COMPOSE_DEBUG ON)
|
||||
set(CONTEXT_SWITCH_DEBUG ON)
|
||||
set(CONTIGUOUS_VMOBJECT_DEBUG ON)
|
||||
set(COPY_DEBUG ON)
|
||||
set(CPP_DEBUG ON)
|
||||
set(CPP_LANGUAGE_SERVER_DEBUG ON)
|
||||
set(CRYPTO_DEBUG ON)
|
||||
set(CSOCKET_DEBUG ON)
|
||||
set(CSS_LOADER_DEBUG ON)
|
||||
set(CSS_PARSER_DEBUG ON)
|
||||
set(CSS_TOKENIZER_DEBUG ON)
|
||||
set(CURSOR_TOOL_DEBUG ON)
|
||||
set(DDS_DEBUG ON)
|
||||
set(DEBUG_AUTOCOMPLETE ON)
|
||||
set(DEBUG_CPP_LANGUAGE_SERVER ON)
|
||||
set(DEFERRED_INVOKE_DEBUG ON)
|
||||
set(DHCPV4CLIENT_DEBUG ON)
|
||||
set(DHCPV4_DEBUG ON)
|
||||
set(DIFF_DEBUG ON)
|
||||
|
@ -41,37 +35,30 @@ set(DUMP_REGIONS_ON_CRASH ON)
|
|||
set(DWARF_DEBUG ON)
|
||||
set(DYNAMIC_LOAD_DEBUG ON)
|
||||
set(E1000_DEBUG ON)
|
||||
set(E1000E_DEBUG ON)
|
||||
set(EDITOR_DEBUG ON)
|
||||
set(ELF_IMAGE_DEBUG ON)
|
||||
set(EMOJI_DEBUG ON)
|
||||
set(ESCAPE_SEQUENCE_DEBUG ON)
|
||||
set(ETHERNET_DEBUG ON)
|
||||
set(ETHERNET_VERY_DEBUG ON)
|
||||
set(EVENT_DEBUG ON)
|
||||
set(EVENTLOOP_DEBUG ON)
|
||||
set(EXEC_DEBUG ON)
|
||||
set(EXT2_BLOCKLIST_DEBUG ON)
|
||||
set(EXT2_DEBUG ON)
|
||||
set(EXT2_VERY_DEBUG ON)
|
||||
set(FAT_DEBUG ON)
|
||||
set(FILE_CONTENT_DEBUG ON)
|
||||
set(FILEDESCRIPTION_DEBUG ON)
|
||||
set(FILE_WATCHER_DEBUG ON)
|
||||
set(FILL_PATH_DEBUG ON)
|
||||
set(FORK_DEBUG ON)
|
||||
set(FRAMEBUFFER_DEVICE_DEBUG ON)
|
||||
set(FUTEX_DEBUG ON)
|
||||
set(FUTEXQUEUE_DEBUG ON)
|
||||
set(GEMINI_DEBUG ON)
|
||||
set(GEMINIJOB_DEBUG ON)
|
||||
set(GENERATE_DEBUG_CODE ON)
|
||||
set(GENERATE_DEBUG ON)
|
||||
set(GHASH_PROCESS_DEBUG ON)
|
||||
set(GIF_DEBUG ON)
|
||||
set(GL_DEBUG ON)
|
||||
set(GLOBAL_DTORS_DEBUG ON)
|
||||
set(GPT_DEBUG ON)
|
||||
set(GZIP_DEBUG ON)
|
||||
set(HEAP_DEBUG ON)
|
||||
set(HEARTS_DEBUG ON)
|
||||
set(HEX_DEBUG ON)
|
||||
|
@ -80,7 +67,6 @@ set(HPET_COMPARATOR_DEBUG ON)
|
|||
set(HPET_DEBUG ON)
|
||||
set(HTML_SCRIPT_DEBUG ON)
|
||||
set(HTTPJOB_DEBUG ON)
|
||||
set(HTTPSJOB_DEBUG ON)
|
||||
set(HUNKS_DEBUG ON)
|
||||
set(ICMP_DEBUG ON)
|
||||
set(ICO_DEBUG ON)
|
||||
|
@ -125,8 +111,6 @@ set(MBR_DEBUG ON)
|
|||
set(MEMORY_DEVICE_DEBUG ON)
|
||||
set(MEMORY_DEBUG ON)
|
||||
set(MENU_DEBUG ON)
|
||||
set(MENUS_DEBUG ON)
|
||||
set(MINIMIZE_ANIMATION_DEBUG ON)
|
||||
set(MOUSE_DEBUG ON)
|
||||
set(MOVE_DEBUG ON)
|
||||
set(MULTIPROCESSOR_DEBUG ON)
|
||||
|
@ -161,8 +145,6 @@ set(RESOURCE_DEBUG ON)
|
|||
set(ROUTING_DEBUG ON)
|
||||
set(RSA_PARSE_DEBUG ON)
|
||||
set(RTL8168_DEBUG ON)
|
||||
set(SAFE_SYSCALL_DEBUG ON)
|
||||
set(SB16_DEBUG ON)
|
||||
set(SCHEDULER_DEBUG ON)
|
||||
set(SCHEDULER_RUNNABLE_DEBUG ON)
|
||||
set(SERVICE_DEBUG ON)
|
||||
|
@ -208,8 +190,6 @@ set(VFS_DEBUG ON)
|
|||
set(VIRTIO_DEBUG ON)
|
||||
set(VIRTUAL_CONSOLE_DEBUG ON)
|
||||
set(VMWARE_BACKDOOR_DEBUG ON)
|
||||
set(VOLATILE_PAGE_RANGES_DEBUG ON)
|
||||
set(VRA_DEBUG ON)
|
||||
set(WAITBLOCK_DEBUG ON)
|
||||
set(WAITQUEUE_DEBUG ON)
|
||||
set(WASI_DEBUG ON)
|
||||
|
@ -253,10 +233,14 @@ set(XML_PARSER_DEBUG ON)
|
|||
# Immediately finds violations during boot, shouldn't be discoverable by people who aren't working on fixing.
|
||||
# set(KMALLOC_VERIFY_NO_SPINLOCK_HELD ON)
|
||||
# False positive: CONSOLE_OUT_TO_BOCHS_DEBUG_PORT is a flag for ConsoleDevice, not a feature.
|
||||
# set(CONSOLE_OUT_TO_BOCHS_DEBUG_PORT)
|
||||
# set(CONSOLE_OUT_TO_BOCHS_DEBUG_PORT ON)
|
||||
# False positive: BOCHS_DEBUG_PORT represents an IO port constant
|
||||
# set(BOCHS_DEBUG_PORT)
|
||||
# set(BOCHS_DEBUG_PORT ON)
|
||||
# False positive: IFF_DEBUG is an ioctl flag
|
||||
# set(IFF_DEBUG)
|
||||
# set(IFF_DEBUG ON)
|
||||
# False positive: SO_DEBUG is a socket option
|
||||
# set(SO_DEBUG)
|
||||
# set(SO_DEBUG ON)
|
||||
# False positive: ELF_DEBUG is the section name for debug symbols, not a debug flag.
|
||||
# set(ELF_DEBUG ON)
|
||||
# False positive: A32_DEBUG_INTERFACE is the name of a CPU feature, not a debug flag.
|
||||
# set(IA32_DEBUG_INTERFACE ON)
|
||||
|
|
|
@ -7,16 +7,11 @@ cd "${script_path}/.."
|
|||
|
||||
MISSING_FLAGS=n
|
||||
|
||||
# Check whether all_the_debug_macros.cmake sets all the flags used in C++ code.
|
||||
while IFS= read -r FLAG; do
|
||||
# Ignore false positives that are not debug flags.
|
||||
if [ "$FLAG" = "ELF_DEBUG" ] || [ "$FLAG" = "IA32_DEBUG_INTERFACE" ]; then
|
||||
continue
|
||||
fi
|
||||
|
||||
# We simply search whether the CMakeLists.txt *ever* sets the flag.
|
||||
# There are (basically) no false positives, but there might be false negatives,
|
||||
# for example we intentionally don't check for commented-out lines here.
|
||||
if ! grep -qF "set(${FLAG}" Meta/CMake/all_the_debug_macros.cmake ; then
|
||||
# We intentionally don't check for commented-out lines,
|
||||
# in order to keep track of false positives.
|
||||
if ! grep -qF "set(${FLAG} ON)" Meta/CMake/all_the_debug_macros.cmake ; then
|
||||
echo "'all_the_debug_macros.cmake' is missing ${FLAG}"
|
||||
MISSING_FLAGS=y
|
||||
fi
|
||||
|
@ -49,5 +44,7 @@ if [ "n" != "${MISSING_FLAGS}" ] ; then
|
|||
echo "If you just added a new SOMETHING_DEBUG flag, that's great!"
|
||||
echo "We want to enable all of these in automated builds, so that the code doesn't rot."
|
||||
echo "Please add it to Meta/CMake/all_the_debug_macros.cmake"
|
||||
echo "Or perhaps it's not a debug flag?"
|
||||
echo "Please also add it to Meta/CMake/all_the_debug_macros.cmake"
|
||||
exit 1
|
||||
fi
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue