ElfReader: Suppress a coverity message

Add two neutral enum values mimicing what llvm/BinaryFormat/ELF.h has.

*** CID 1518686:  Uninitialized variables  (UNINIT)
/qt-creator/src/plugins/debugger/gdb/gdbengine.cpp: 3940 in Debugger::Internal::GdbEngine::handleGdbStarted()()
3934         // Addint executable to modules list.
3935         Module module;
3936         module.startAddress = 0;
3937         module.endAddress = 0;
3938         module.modulePath = rp.inferior.command.executable().toString();
3939         module.moduleName = "<executable>";
>>>    CID 1518686:  Uninitialized variables  (UNINIT)
>>>    Using uninitialized value "module.elfData.endian" when calling "updateModule".

Looks like a false positive, module.elfData.endian is not used
in updateModule() and surroundings.

Change-Id: Ic8071add87b1df894819d49ea55dfa705b81c3ce
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This commit is contained in:
hjk
2022-06-27 09:34:12 +02:00
parent 06715441d6
commit e1d2cbde24

View File

@@ -83,6 +83,7 @@ enum ElfEndian
enum ElfClass
{
Elf_ELFCLASSNONE = 0,
Elf_ELFCLASS32 = 1,
Elf_ELFCLASS64 = 2
};
@@ -98,6 +99,7 @@ enum ElfType
enum ElfMachine
{
Elf_EM_NONE = 0,
Elf_EM_386 = 3,
Elf_EM_ARM = 40,
Elf_EM_X86_64 = 62
@@ -142,10 +144,10 @@ public:
int indexOf(const QByteArray &name) const;
public:
ElfEndian endian;
ElfType elftype;
ElfMachine elfmachine;
ElfClass elfclass;
ElfEndian endian = Elf_ELFDATANONE;
ElfType elftype = Elf_ET_NONE;
ElfMachine elfmachine = Elf_EM_NONE;
ElfClass elfclass = Elf_ELFCLASSNONE;
quint64 entryPoint = 0;
QByteArray debugLink;
QByteArray buildId;