Debugger: Dumper test GCC version determination

When determining the GCC version we did not use the same environment
that the tests actually use.

As a bonus: an attempt to narrow down UnboundLocalError that occurs
in the QXmlAttributes test in the Win 10 + MinGW + Qt5 test plan
and which I cannot reproduce locally.

Change-Id: Ib12b66091eed7b27871c0bed59d8de019ee2285b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
Andrii Semkiv
2024-12-03 11:09:21 +01:00
parent bea44886fb
commit 31023a7a4e
2 changed files with 3 additions and 0 deletions

View File

@@ -1179,6 +1179,8 @@ class Dumper(DumperBase):
return self.qtNamespace() + 'Qt::' + enumValue return self.qtNamespace() + 'Qt::' + enumValue
def lookupNativeType(self, type_name): def lookupNativeType(self, type_name):
typeobj = None
if type_name == 'void': if type_name == 'void':
typeobj = gdb.lookup_type(type_name) typeobj = gdb.lookup_type(type_name)
self.typesToReport[type_name] = typeobj self.typesToReport[type_name] = typeobj

View File

@@ -1428,6 +1428,7 @@ void tst_Dumpers::dumper()
if (data.neededGccVersion.isRestricted && m_debuggerEngine == GdbEngine) { if (data.neededGccVersion.isRestricted && m_debuggerEngine == GdbEngine) {
QProcess gcc; QProcess gcc;
gcc.setWorkingDirectory(t->buildPath); gcc.setWorkingDirectory(t->buildPath);
gcc.setProcessEnvironment(m_env);
gcc.start("gcc", {"--version"}); gcc.start("gcc", {"--version"});
QVERIFY(gcc.waitForFinished()); QVERIFY(gcc.waitForFinished());
output = gcc.readAllStandardOutput(); output = gcc.readAllStandardOutput();