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

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 ...@@ -629,8 +629,7 @@ std::string SymbolGroupValue::pointedToSymbolName(ULONG64 address, const std::st
* (due to the amiguities and artifacts that appear like 'QGuid4!qstrdup'). */ * (due to the amiguities and artifacts that appear like 'QGuid4!qstrdup'). */
static inline std::string resolveQtSymbol(const char *symbolC, static inline std::string resolveQtSymbol(const char *symbolC,
const char *defaultModuleNameC, const char *moduleNameC,
const char *modulePatternC,
const SymbolGroupValueContext &ctx) const SymbolGroupValueContext &ctx)
{ {
enum { debugResolveQtSymbol = 0 }; enum { debugResolveQtSymbol = 0 };
...@@ -638,13 +637,20 @@ static inline std::string resolveQtSymbol(const char *symbolC, ...@@ -638,13 +637,20 @@ static inline std::string resolveQtSymbol(const char *symbolC,
typedef StringList::const_iterator StringListConstIt; typedef StringList::const_iterator StringListConstIt;
if (debugResolveQtSymbol) if (debugResolveQtSymbol)
DebugPrint() << ">resolveQtSymbol" << symbolC << " def=" << defaultModuleNameC << " defModName=" DebugPrint() << ">resolveQtSymbol" << symbolC << " def=" << moduleNameC << " defModName="
<< defaultModuleNameC << " modPattern=" << modulePatternC; << moduleNameC;
const SubStringPredicate modulePattern(modulePatternC); const SubStringPredicate modulePattern(moduleNameC);
// First try a match with the default module name 'QtCored4!qstrdup' for speed reasons // First try a match with the default module name 'QtCored4!qstrdup' or
// 'Qt5Cored!qstrdup' for speed reasons.
for (int qtVersion = 4; qtVersion < 6; qtVersion++) { for (int qtVersion = 4; qtVersion < 6; qtVersion++) {
std::ostringstream str; 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 std::string defaultPattern = str.str();
const StringList defaultMatches = SymbolGroupValue::resolveSymbolName(defaultPattern.c_str(), ctx); const StringList defaultMatches = SymbolGroupValue::resolveSymbolName(defaultPattern.c_str(), ctx);
if (debugResolveQtSymbol) if (debugResolveQtSymbol)
...@@ -685,7 +691,7 @@ const QtInfo &QtInfo::get(const SymbolGroupValueContext &ctx) ...@@ -685,7 +691,7 @@ const QtInfo &QtInfo::get(const SymbolGroupValueContext &ctx)
do { do {
// Lookup qstrdup() to hopefully get module (potential libinfix) and namespace // Lookup qstrdup() to hopefully get module (potential libinfix) and namespace
// Typically, this resolves to 'QtGuid4!qstrdup' and 'QtCored4!qstrdup'... // 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 libPos = qualifiedSymbol.find("Core");
const std::string::size_type exclPos = qualifiedSymbol.find('!'); // Resolved: 'QtCored4!qstrdup' const std::string::size_type exclPos = qualifiedSymbol.find('!'); // Resolved: 'QtCored4!qstrdup'
if (libPos == std::string::npos || exclPos == std::string::npos) { 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