public override GDBResponseHandler.HandleResponseEnum HandleResponse(GDBSubProcess subProcess, string[] responseLines, bool allowRequestLine)
{
Regex rStaticSymbol = new Regex("Symbol \"(?<symbol_name>\\S*)\"\\s*is\\s*(?<type>[\\S*\\s*]*) at address 0x(?<at>\\S*).", RegexOptions.IgnoreCase | RegexOptions.Compiled);
Regex rVariableSymbol = new Regex("Symbol \"(?<symbol_name>\\S*)\"\\s*is\\s*(?<type>[\\S*\\s*]*) at (?<reg_desc>[\\s*\\S*]*) \\$(?<reg_name>\\S*) offset (?<offset>[\\S*\\s*]*).", RegexOptions.IgnoreCase | RegexOptions.Compiled);
Regex rNoSymbol = new Regex("No\\s*symbol\\s*\"(?<symbol_name>\\S*)\"\\s*in\\s*current\\s*context.", RegexOptions.IgnoreCase | RegexOptions.Compiled);
for(int i = 0; i<responseLines.Length ; i++)
{
string line = responseLines[i];
Match mStatic = rStaticSymbol.Match(line);
if(mStatic.Success)
{
_resolvedCallback(_symbol, new StaticAddress(UInt64.Parse(mStatic.Result("${at}"), NumberStyles.HexNumber)));
return GDBResponseHandler.HandleResponseEnum.Handled;
}
Match mVariable = rVariableSymbol.Match(line);
if(mVariable.Success)
{
_resolvedCallback(_symbol,
new GDBRegisterBasedAddressSpecifier(mVariable.Result("${reg_name}"),
mVariable.Result("${offset}"),
_gdbProc));
return GDBResponseHandler.HandleResponseEnum.Handled;
}
Match mNoSymbol = rNoSymbol.Match(line);
if(mNoSymbol.Success)
{
_resolvedCallback(_symbol, null);
return GDBResponseHandler.HandleResponseEnum.Handled;
}
}
return GDBResponseHandler.HandleResponseEnum.Handled;
}