debugger: fix setting breakpoints for internal fpc functions when rtl has the debug info (fixes exception handling problems) made by instructions of Marc

git-svn-id: trunk@22529 -
This commit is contained in:
paul 2009-11-11 13:06:17 +00:00
parent 7fe5b967f1
commit a19fadb902

View File

@ -3368,10 +3368,27 @@ function TGDBMIDebugger.StartDebugging(const AContinueCommand: String): Boolean;
function InsertBreakPoint(const AName: String): Integer;
var
R: TGDBMIExecResult;
S: String;
ResultList: TGDBMINameValueList;
begin
// Try to retrieve the address of the procedure
if ExecuteCommand('info address ' + AName, [cfNoMICommand, cfIgnoreError], R)
and (R.State <> dsError)
then begin
S := GetPart(['at address ', ' at '], ['.', ' '], R.Values);
if S <> ''
then begin
ExecuteCommand('-break-insert *%u', [StrToIntDef(S, 0)], [cfIgnoreError], R);
if R.State = dsError then Exit(-1);
ResultList := TGDBMINameValueList.Create(R, ['bkpt']);
Result := StrToIntDef(ResultList.Values['number'], -1);
ResultList.Free;
Exit;
end;
end;
ExecuteCommand('-break-insert %s', [AName], [cfIgnoreError], R);
if R.State = dsError then Exit;
if R.State = dsError then Exit(-1);
ResultList := TGDBMINameValueList.Create(R, ['bkpt']);
Result := StrToIntDef(ResultList.Values['number'], -1);