forked from qt-creator/qt-creator
ElfReader: Replace QSharedPointer with std::shared_ptr
According to https://wiki.qt.io/Things_To_Look_Out_For_In_Reviews QSharedPointer impl is poor and it's going to be removed from Qt 7. Change-Id: I2a4b1c31acdf2f05a952aba2b813d9f2dd8cb3c6 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -283,9 +283,9 @@ ElfReader::Result ElfReader::readIt()
|
|||||||
return Ok;
|
return Ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
QSharedPointer<ElfMapper> ElfReader::readSection(const QByteArray &name)
|
std::shared_ptr<ElfMapper> ElfReader::readSection(const QByteArray &name)
|
||||||
{
|
{
|
||||||
QSharedPointer<ElfMapper> mapper;
|
std::shared_ptr<ElfMapper> mapper;
|
||||||
readIt();
|
readIt();
|
||||||
int i = m_elfData.indexOf(name);
|
int i = m_elfData.indexOf(name);
|
||||||
if (i == -1)
|
if (i == -1)
|
||||||
|
@@ -11,7 +11,6 @@
|
|||||||
#include <QCoreApplication>
|
#include <QCoreApplication>
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QList>
|
#include <QList>
|
||||||
#include <QSharedPointer>
|
|
||||||
|
|
||||||
namespace Utils {
|
namespace Utils {
|
||||||
|
|
||||||
@@ -141,7 +140,7 @@ public:
|
|||||||
enum Result { Ok, NotElf, Corrupt };
|
enum Result { Ok, NotElf, Corrupt };
|
||||||
|
|
||||||
ElfData readHeaders();
|
ElfData readHeaders();
|
||||||
QSharedPointer<ElfMapper> readSection(const QByteArray §ionName);
|
std::shared_ptr<ElfMapper> readSection(const QByteArray §ionName);
|
||||||
QString errorString() const { return m_errorString; }
|
QString errorString() const { return m_errorString; }
|
||||||
QByteArray readCoreName(bool *isCore);
|
QByteArray readCoreName(bool *isCore);
|
||||||
|
|
||||||
|
@@ -2850,7 +2850,7 @@ void CppDebuggerEngine::validateRunParameters(DebuggerRunParameters &rp)
|
|||||||
}
|
}
|
||||||
if (globalRegExpSourceMap.isEmpty())
|
if (globalRegExpSourceMap.isEmpty())
|
||||||
return;
|
return;
|
||||||
if (QSharedPointer<Utils::ElfMapper> mapper = reader.readSection(".debug_str")) {
|
if (std::shared_ptr<ElfMapper> mapper = reader.readSection(".debug_str")) {
|
||||||
const char *str = mapper->start;
|
const char *str = mapper->start;
|
||||||
const char *limit = str + mapper->fdlen;
|
const char *limit = str + mapper->fdlen;
|
||||||
bool found = false;
|
bool found = false;
|
||||||
|
Reference in New Issue
Block a user