Redo compression indexing to be more accurate
This commit is contained in:
parent
f6c53bda52
commit
8b2a602ba7
1 changed files with 52 additions and 27 deletions
|
@ -90,7 +90,7 @@ namespace Ryujinx.Core.OsHle.Diagnostics
|
||||||
}
|
}
|
||||||
else if (compression.StartsWith("S_"))
|
else if (compression.StartsWith("S_"))
|
||||||
{
|
{
|
||||||
pos = 2;
|
pos = 1;
|
||||||
res = compressionData[0];
|
res = compressionData[0];
|
||||||
canHaveUnqualifiedName = true;
|
canHaveUnqualifiedName = true;
|
||||||
compression = compression.Substring(2);
|
compression = compression.Substring(2);
|
||||||
|
@ -224,10 +224,6 @@ namespace Ryujinx.Core.OsHle.Diagnostics
|
||||||
return "volatile";
|
return "volatile";
|
||||||
else if (qualifier == 'K')
|
else if (qualifier == 'K')
|
||||||
return "const";
|
return "const";
|
||||||
else if (qualifier == 'R')
|
|
||||||
return "&";
|
|
||||||
else if (qualifier == 'O')
|
|
||||||
return "&&";
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -254,13 +250,44 @@ namespace Ryujinx.Core.OsHle.Diagnostics
|
||||||
private static List<string> ReadParameters(string mangledParams, List<string> compressionData, out int pos)
|
private static List<string> ReadParameters(string mangledParams, List<string> compressionData, out int pos)
|
||||||
{
|
{
|
||||||
List<string> res = new List<string>();
|
List<string> res = new List<string>();
|
||||||
|
List<string> refQualifiers = new List<string>();
|
||||||
|
string parsedTypePart = null;
|
||||||
|
string currentRefQualifiers = null;
|
||||||
|
string currentBuiltinType = null;
|
||||||
|
string currentSpecialQualifiers = null;
|
||||||
|
string currentCompressedValue = null;
|
||||||
int i = 0;
|
int i = 0;
|
||||||
pos = -1;
|
pos = -1;
|
||||||
|
|
||||||
string typeBuffer = null;
|
|
||||||
string parsedTypePart = null;
|
|
||||||
for (i = 0; i < mangledParams.Length; i++)
|
for (i = 0; i < mangledParams.Length; i++)
|
||||||
{
|
{
|
||||||
|
if (currentBuiltinType != null)
|
||||||
|
{
|
||||||
|
string currentCVQualifier = String.Join(" ", refQualifiers);
|
||||||
|
// Try to mimic the compression indexing
|
||||||
|
if (currentRefQualifiers != null)
|
||||||
|
{
|
||||||
|
compressionData.Add(currentBuiltinType + currentRefQualifiers);
|
||||||
|
}
|
||||||
|
if (refQualifiers.Count != 0)
|
||||||
|
{
|
||||||
|
compressionData.Add(currentBuiltinType + " " + currentCVQualifier + currentRefQualifiers);
|
||||||
|
}
|
||||||
|
if (currentSpecialQualifiers != null)
|
||||||
|
{
|
||||||
|
compressionData.Add(currentBuiltinType + " " + currentCVQualifier + currentRefQualifiers + currentSpecialQualifiers);
|
||||||
|
}
|
||||||
|
if (currentRefQualifiers == null && currentCVQualifier == null && currentSpecialQualifiers == null)
|
||||||
|
{
|
||||||
|
compressionData.Add(currentBuiltinType);
|
||||||
|
}
|
||||||
|
currentBuiltinType = null;
|
||||||
|
currentCompressedValue = null;
|
||||||
|
currentCVQualifier = null;
|
||||||
|
currentRefQualifiers = null;
|
||||||
|
refQualifiers.Clear();
|
||||||
|
currentSpecialQualifiers = null;
|
||||||
|
}
|
||||||
char chr = mangledParams[i];
|
char chr = mangledParams[i];
|
||||||
string part = mangledParams.Substring(i);
|
string part = mangledParams.Substring(i);
|
||||||
|
|
||||||
|
@ -268,8 +295,7 @@ namespace Ryujinx.Core.OsHle.Diagnostics
|
||||||
parsedTypePart = ReadCVQualifiers(chr);
|
parsedTypePart = ReadCVQualifiers(chr);
|
||||||
if (parsedTypePart != null)
|
if (parsedTypePart != null)
|
||||||
{
|
{
|
||||||
typeBuffer = parsedTypePart + " " + typeBuffer;
|
refQualifiers.Add(parsedTypePart);
|
||||||
compressionData.Add(typeBuffer);
|
|
||||||
|
|
||||||
// need more data
|
// need more data
|
||||||
continue;
|
continue;
|
||||||
|
@ -278,8 +304,7 @@ namespace Ryujinx.Core.OsHle.Diagnostics
|
||||||
parsedTypePart = ReadRefQualifiers(chr);
|
parsedTypePart = ReadRefQualifiers(chr);
|
||||||
if (parsedTypePart != null)
|
if (parsedTypePart != null)
|
||||||
{
|
{
|
||||||
typeBuffer = typeBuffer + parsedTypePart;
|
currentRefQualifiers = parsedTypePart;
|
||||||
compressionData.Add(typeBuffer);
|
|
||||||
|
|
||||||
// need more data
|
// need more data
|
||||||
continue;
|
continue;
|
||||||
|
@ -288,7 +313,7 @@ namespace Ryujinx.Core.OsHle.Diagnostics
|
||||||
parsedTypePart = ReadSpecialQualifiers(chr);
|
parsedTypePart = ReadSpecialQualifiers(chr);
|
||||||
if (parsedTypePart != null)
|
if (parsedTypePart != null)
|
||||||
{
|
{
|
||||||
typeBuffer = typeBuffer + parsedTypePart;
|
currentSpecialQualifiers = parsedTypePart;
|
||||||
|
|
||||||
// need more data
|
// need more data
|
||||||
continue;
|
continue;
|
||||||
|
@ -301,11 +326,14 @@ namespace Ryujinx.Core.OsHle.Diagnostics
|
||||||
parsedTypePart = GetCompressedValue(part, compressionData, out pos);
|
parsedTypePart = GetCompressedValue(part, compressionData, out pos);
|
||||||
if (pos != -1 && parsedTypePart != null)
|
if (pos != -1 && parsedTypePart != null)
|
||||||
{
|
{
|
||||||
|
currentCompressedValue = parsedTypePart;
|
||||||
i += pos;
|
i += pos;
|
||||||
typeBuffer = parsedTypePart + typeBuffer;
|
res.Add(currentCompressedValue + " " + String.Join(" ", refQualifiers) + currentRefQualifiers + currentSpecialQualifiers);
|
||||||
res.Add(typeBuffer);
|
currentBuiltinType = null;
|
||||||
compressionData.Add(typeBuffer);
|
currentCompressedValue = null;
|
||||||
typeBuffer = null;
|
currentRefQualifiers = null;
|
||||||
|
refQualifiers.Clear();
|
||||||
|
currentSpecialQualifiers = null;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
pos = -1;
|
pos = -1;
|
||||||
|
@ -318,10 +346,12 @@ namespace Ryujinx.Core.OsHle.Diagnostics
|
||||||
if (pos != -1 && name != null)
|
if (pos != -1 && name != null)
|
||||||
{
|
{
|
||||||
i += pos + 1;
|
i += pos + 1;
|
||||||
typeBuffer = name[name.Count - 1] + " " + typeBuffer;
|
res.Add(name[name.Count - 1] + " " + String.Join(" ", refQualifiers) + currentRefQualifiers + currentSpecialQualifiers);
|
||||||
res.Add(typeBuffer);
|
currentBuiltinType = null;
|
||||||
compressionData.Add(typeBuffer);
|
currentCompressedValue = null;
|
||||||
typeBuffer = null;
|
currentRefQualifiers = null;
|
||||||
|
refQualifiers.Clear();
|
||||||
|
currentSpecialQualifiers = null;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -332,13 +362,8 @@ namespace Ryujinx.Core.OsHle.Diagnostics
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
if (typeBuffer != null)
|
currentBuiltinType = parsedTypePart;
|
||||||
typeBuffer = parsedTypePart + " " + typeBuffer;
|
res.Add(currentBuiltinType + " " + String.Join(" ", refQualifiers) + currentRefQualifiers + currentSpecialQualifiers);
|
||||||
else
|
|
||||||
typeBuffer = parsedTypePart;
|
|
||||||
res.Add(typeBuffer);
|
|
||||||
compressionData.Add(typeBuffer);
|
|
||||||
typeBuffer = null;
|
|
||||||
i = i + pos -1;
|
i = i + pos -1;
|
||||||
}
|
}
|
||||||
pos = i;
|
pos = i;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue