public AD7StackFrame(AD7Engine engine, AD7Thread thread, string[] frameInfo)
{
m_engine = engine;
m_thread = thread;
m_dispatcher = m_engine.eDispatcher;
uint level = Convert.ToUInt32(frameInfo[0]);
string address = frameInfo[1];
m_functionName = frameInfo[2];
m_documentName = frameInfo[3];
try
{
m_lineNum = Convert.ToUInt32(frameInfo[4]);
}
catch (Exception e)
{
m_lineNum = 0;
}
_locals = new ArrayList();
_arguments = new ArrayList();
m_hasSource = (m_lineNum == 0) ? false : true;
ArrayList evaluatedVars = new ArrayList();
// Add the variable filter list to the evaluatedVars list.
// Causes named variables to be ignored.
evaluatedVars.AddRange(m_variableFilter);
if (address.StartsWith("0x"))
address = address.Remove(0, 2);
m_address = uint.Parse(address, System.Globalization.NumberStyles.AllowHexSpecifier);
// Query GDB for parameters and locals.
string variablesResponse = m_engine.eDispatcher.getVariablesForFrame(level, m_thread._id).Replace("#;;;", "");
if (variablesResponse == null || variablesResponse == "ERROR" || variablesResponse == "")
return;
variablesResponse = variablesResponse.Substring(3);
string[] variableStrings = variablesResponse.Split('#');
foreach (string variableString in variableStrings)
{
string name = null;
bool arg = false;
string type = null;
string value = null;
string[] variableProperties = variableString.Split(';');
if (variableProperties[0] != "")
{
if (!evaluatedVars.Contains(variableProperties[0]))
{
name = variableProperties[0];
evaluatedVars.Add(variableProperties[0]);
if (variableProperties[1] != "")
arg = true;
if (variableProperties[2] != "")
type = variableProperties[2];
if (variableProperties[3] != "")
value = variableProperties[3];
if (arg)
_arguments.Add(VariableInfo.create(name, type, value, m_engine.eDispatcher));
else
_locals.Add(VariableInfo.create(name, type, value, m_engine.eDispatcher));
}
}
}
}