Developer forums (C::B DEVELOPMENT STRICTLY!) > Plugins development

GCC and CLang options*.xml enhancement/change

(1/1)

AndrewCot:
The existing GCC and CLANG options xml files do not include debugging optimizations for either GDB or LLDB and as such what do people think about changing the files to have debugging options below. This should hopefully make it easier to swap between GDB and DWARF debugging :

options_gcc.xml

--- Code: ---    <Category name="Debugging">
        <Option name="Produce debugging symbols"
                option="-g"
                checkAgainst="-O -O1 -O2 -O3 -Os"
                checkMessage="You have optimizations enabled. This is Not A Good Thing(tm) when producing debugging symbols..."
                supersedes="-s"/>
        <Option name="Optimize debugging executable (compile speed, execution speed and better debugging)"
                option="-Og"
                supersedes="-O -O1 -O2 -O3"/>
        <Option name="Tune Debugging for GDB"
                option="-ggdb"
                checkAgainst="-O1 -O2 -Os -O3 -O4 -gdwarf -gdwarf-4"
                checkMessage="You have other optimizations or debugging settings that are not good for GDB."
                supersedes="-s -gline-tables-only"/>
        <Option name="Tune Debugging for DWARF for GDB"
                option="-gdwarf"
                checkAgainst="-Os -O1 -O2 -O3 -O4 -ggdb -gdwarf-4"
                checkMessage="You have other optimizations or debugging settings that are not good for GDB."
                supersedes="-s -gline-tables-only"/>
        <Option name="Tune Debugging for DWARF for LLDB"
                option="-gdwarf-4"
                checkAgainst="-Os -O1 -O2 -O3 -O4 -ggdb -gdwarf"
                checkMessage="You have other optimizations or debugging settings that are not good for LLDB."
                supersedes="-s -gline-tables-only"/>
    </Category>

--- End code ---
options_clang.xml
--- Code: ---    <Category name="Debugging">
        <Option name="Produce minimal debugging symbols"
                option="-gline-tables-only"
                checkAgainst="-O1 -O2 -Os -O3 -O4"
                checkMessage="You have optimizations enabled. This is Not A Good Thing(tm) when producing debugging symbols..."
                supersedes="-s -g"/>
        <Option name="Tune Debugging for GDB"
                option="-ggdb"
                checkAgainst="-O1 -O2 -Os -O3 -O4"
                checkMessage="You have other optimizations or debugging settings that are not good for GDB."
                supersedes="-s -gline-tables-only"/>
        <Option name="Tune Debugging for DWARF-2 (LLDB)"
                option="-gdwarf-2"
                checkAgainst="-O1 -O2 -Os -O3 -O4"
                checkMessage="You have other optimizations or debugging settings that are not good for LLDB."
                supersedes="-s -gline-tables-only"/>
    </Category>

--- End code ---
Currently with MSYS2 the Mingw64 gcc produces debugging info that LLDb does not understand if you use -gdwarf as it uses dwarf-5 and the LLDB currently does not understand it, but it does understand dwarf4.
The MSYS2 mingw GDB understands dwarf and as such it does not need to fall back to dwarf-4.
The supersedes is copied and pasted, so may not be 100% right. If it is not please speak up.

BlueHazzard:
With this we introduce the category debbuging?

The target file is src\plugins\compilergcc\resources\compilers\options_gcc.xml is this right?

AndrewCot:
The category was there before, but it was an attribute of the option as per the following in the options_gcc.xml:

--- Code: ---    <Option name="Produce debugging symbols"
            option="-g"
            category="Debugging"
            checkAgainst="-O -O1 -O2 -O3 -Os"
            checkMessage="You have optimizations enabled. This is Not A Good Thing(tm) when producing debugging symbols..."
            supersedes="-s"/>
--- End code ---
In the options_clang.xml the category section was defined as key and the options were sub keys.

BlueHazzard:
Thank you for the description and work. Is in SVN now.

AndrewCot:
Thanks for making the SF changes.

Navigation

[0] Message Index

Go to full version