forked from qt-creator/qt-creator
Debugger: Use QStringDecoder instead of (deprecated) QTextCodec
Fixes: QTCREATORBUG-33063 Change-Id: I0ea186ab0d2f1a149813c752d0953628c84ee8b4 Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -131,8 +131,6 @@ GdbEngine::GdbEngine()
|
|||||||
setObjectName("GdbEngine");
|
setObjectName("GdbEngine");
|
||||||
setDebuggerName("GDB");
|
setDebuggerName("GDB");
|
||||||
|
|
||||||
m_inferiorOutputCodec = TextCodec::codecForLocale();
|
|
||||||
|
|
||||||
m_commandTimer.setSingleShot(true);
|
m_commandTimer.setSingleShot(true);
|
||||||
connect(&m_commandTimer, &QTimer::timeout,
|
connect(&m_commandTimer, &QTimer::timeout,
|
||||||
this, &GdbEngine::commandTimeout);
|
this, &GdbEngine::commandTimeout);
|
||||||
@@ -617,9 +615,7 @@ void GdbEngine::readGdbStandardError()
|
|||||||
|
|
||||||
void GdbEngine::readDebuggeeOutput(const QByteArray &ba)
|
void GdbEngine::readDebuggeeOutput(const QByteArray &ba)
|
||||||
{
|
{
|
||||||
const QString msg = m_inferiorOutputCodec.toUnicode(ba.constData(), ba.size(),
|
const QString msg = m_inferiorOutputDecoder.decode(ba);
|
||||||
&m_inferiorOutputCodecState);
|
|
||||||
|
|
||||||
if (msg.startsWith("&\"") && isMostlyHarmlessMessage(QStringView{msg}.mid(2, msg.size() - 4)))
|
if (msg.startsWith("&\"") && isMostlyHarmlessMessage(QStringView{msg}.mid(2, msg.size() - 4)))
|
||||||
showMessage("Mostly harmless terminal warning suppressed.", LogWarning);
|
showMessage("Mostly harmless terminal warning suppressed.", LogWarning);
|
||||||
else
|
else
|
||||||
|
@@ -91,8 +91,7 @@ private: ////////// General Interface //////////
|
|||||||
void readGdbStandardError();
|
void readGdbStandardError();
|
||||||
void readDebuggeeOutput(const QByteArray &ba);
|
void readDebuggeeOutput(const QByteArray &ba);
|
||||||
|
|
||||||
Utils::TextCodec m_inferiorOutputCodec;
|
QStringDecoder m_inferiorOutputDecoder{Utils::TextCodec::encodingForLocale().name()};
|
||||||
Utils::TextCodec::ConverterState m_inferiorOutputCodecState;
|
|
||||||
|
|
||||||
QString m_inbuffer;
|
QString m_inbuffer;
|
||||||
bool m_busy = false;
|
bool m_busy = false;
|
||||||
|
Reference in New Issue
Block a user