Commit 0a556c2f authored by Friedemann Kleint's avatar Friedemann Kleint Committed by hjk

Adapt Qt symbol resolution to library naming change.

Change-Id: Iaf3eaf2b98bba6f1796a59499136e92c4124ad0b
Reviewed-by: default avatarhjk <qthjk@ovi.com>
parent 6d83dda6
......@@ -629,8 +629,7 @@ std::string SymbolGroupValue::pointedToSymbolName(ULONG64 address, const std::st
* (due to the amiguities and artifacts that appear like 'QGuid4!qstrdup'). */
static inline std::string resolveQtSymbol(const char *symbolC,
const char *defaultModuleNameC,
const char *modulePatternC,
const char *moduleNameC,
const SymbolGroupValueContext &ctx)
{
enum { debugResolveQtSymbol = 0 };
......@@ -638,13 +637,20 @@ static inline std::string resolveQtSymbol(const char *symbolC,
typedef StringList::const_iterator StringListConstIt;
if (debugResolveQtSymbol)
DebugPrint() << ">resolveQtSymbol" << symbolC << " def=" << defaultModuleNameC << " defModName="
<< defaultModuleNameC << " modPattern=" << modulePatternC;
const SubStringPredicate modulePattern(modulePatternC);
// First try a match with the default module name 'QtCored4!qstrdup' for speed reasons
DebugPrint() << ">resolveQtSymbol" << symbolC << " def=" << moduleNameC << " defModName="
<< moduleNameC;
const SubStringPredicate modulePattern(moduleNameC);
// First try a match with the default module name 'QtCored4!qstrdup' or
// 'Qt5Cored!qstrdup' for speed reasons.
for (int qtVersion = 4; qtVersion < 6; qtVersion++) {
std::ostringstream str;
str << defaultModuleNameC << qtVersion << '!' << symbolC;
str << "Qt";
if (qtVersion >= 5)
str << qtVersion;
str << moduleNameC << 'd';
if (qtVersion == 4)
str << qtVersion;
str << '!' << symbolC;
const std::string defaultPattern = str.str();
const StringList defaultMatches = SymbolGroupValue::resolveSymbolName(defaultPattern.c_str(), ctx);
if (debugResolveQtSymbol)
......@@ -685,7 +691,7 @@ const QtInfo &QtInfo::get(const SymbolGroupValueContext &ctx)
do {
// Lookup qstrdup() to hopefully get module (potential libinfix) and namespace
// Typically, this resolves to 'QtGuid4!qstrdup' and 'QtCored4!qstrdup'...
const std::string qualifiedSymbol = resolveQtSymbol("qstrdup", "QtCored", "Core", ctx);
const std::string qualifiedSymbol = resolveQtSymbol("qstrdup", "Core", ctx);
const std::string::size_type libPos = qualifiedSymbol.find("Core");
const std::string::size_type exclPos = qualifiedSymbol.find('!'); // Resolved: 'QtCored4!qstrdup'
if (libPos == std::string::npos || exclPos == std::string::npos) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment