fpdebug.pas:

+ Add code to handle GDBRawBuf if GDB_RAW_OUTPUT macro is defined.
  + Use SelectFrameCommand method instead of Command('f '+...
  + Remove /x modifer from getValue for FreamNameKnown code inside TWatch.Get_new_value;

fpviews.pas:
  + Also use correct address size in AddDisassemblyLine
  * Replace 'set sym on' by 'set symbol on' to avoid mi error
  * Use /m modifier for disassembly to get also source code lines
  + Recognize '=> ' current pc indicator inside TDisassemblyWindow.ProcessPChar

git-svn-id: trunk@30089 -
This commit is contained in:
pierre 2015-03-03 21:44:07 +00:00
parent a0c6d55d10
commit 1c5be35315
2 changed files with 30 additions and 12 deletions

View File

@ -1106,6 +1106,14 @@ begin
gdberrorbuf.reset;
end;
{$ifdef GDB_RAW_OUTPUT}
If StrLen(GetRaw)>0 then
begin
GDBWindow^.WriteOutputText(GetRaw);
if in_command=0 then
gdbrawbuf.reset;
end;
{$endif GDB_RAW_OUTPUT}
If StrLen(GetOutput)>0 then
begin
GDBWindow^.WriteOutputText(GetOutput);
@ -1126,6 +1134,10 @@ begin
{ We should do something special for errors !! }
If StrLen(GetError)>0 then
GDBWindow^.WriteErrorText(GetError);
{$ifdef GDB_RAW_OUTPUT}
If StrLen(GetRaw)>0 then
GDBWindow^.WriteOutputText(GetRaw);
{$endif GDB_RAW_OUTPUT}
GDBWindow^.WriteOutputText(GetOutput);
GDBWindow^.Editor^.TextEnd;
end;
@ -1343,8 +1355,8 @@ begin
begin
if ExitAddr=address then
begin
Command('f '+IntToStr(i));
if assigned(file_name) then
if SelectFrameCommand(i) and
assigned(file_name) then
begin
s:=strpas(file_name);
line:=line_number;
@ -2925,9 +2937,9 @@ procedure TWatch.Get_new_value;
if not Debugger^.set_current_frame(curframe) then
loop_higher:=false;
{$ifdef FrameNameKnown}
s2:='/x '+FrameName;
s2:=FrameName;
{$else not FrameNameKnown}
s2:='/x $ebp';
s2:='$ebp';
{$endif FrameNameKnown}
if not getValue(s2) then
loop_higher:=false;
@ -3565,7 +3577,7 @@ end;
{ select frame for watches }
If not assigned(Debugger) then
exit;
Debugger^.Command('f '+IntToStr(Focused));
Debugger^.SelectFrameCommand(Focused);
{ for local vars }
Debugger^.RereadWatches;
{$endif NODEBUG}
@ -3579,7 +3591,7 @@ end;
{ select frame for watches }
If not assigned(Debugger) then
exit;
Debugger^.Command('f '+IntToStr(Focused));
Debugger^.SelectFrameCommand(Focused);
{ for local vars }
Debugger^.RereadWatches;
{$endif}

View File

@ -2696,7 +2696,7 @@ var
LI : PEditorLineInfo;
begin
if AAddress<>0 then
inherited AddLine('$'+hexstr(AAddress,sizeof(PtrUInt)*2)+S)
inherited AddLine('$'+hexstr(AAddress,sizeof(CORE_ADDR)*2)+S)
else
inherited AddLine(S);
PL:=DisasLines^.At(DisasLines^.count-1);
@ -2765,9 +2765,9 @@ var
begin
{$ifndef NODEBUG}
If not assigned(Debugger) then Exit;
Debugger^.SetCommand('print sym on');
Debugger^.SetCommand('print symbol on');
Debugger^.SetCommand('width 0xffffffff');
Debugger^.Command('disas '+FuncName);
Debugger^.Command('disas /m '+FuncName);
p:=StrNew(Debugger^.GetOutput);
ProcessPChar(p);
if (Debugger^.IsRunning) and (FuncName='') then
@ -2781,9 +2781,9 @@ var
begin
{$ifndef NODEBUG}
If not assigned(Debugger) then Exit;
Debugger^.SetCommand('print sym on');
Debugger^.SetCommand('print symbol on');
Debugger^.SetCommand('width 0xffffffff');
Debugger^.Command('disas 0x'+HexStr(Addr,8));
Debugger^.Command('disas /m 0x'+HexStr(Addr,sizeof(Addr)*2));
p:=StrNew(Debugger^.GetOutput);
ProcessPChar(p);
if Debugger^.IsRunning and
@ -2820,7 +2820,7 @@ begin
pline:=strscan(p,#10);
if assigned(pline) then
pline^:=#0;
line:=strpas(p);
line:=trim(strpas(p));
CurAddr:=0;
if assigned(pline) then
begin
@ -2830,6 +2830,12 @@ begin
else
p:=nil;
{ now process the line }
{ Remove current position marker }
if copy(line,1,3)='=> ' then
begin
system.delete(line,1,3);
end;
{ line is hexaddr <symbol+sym_offset at filename:line> assembly }
pos1:=pos('<',line);
if pos1>0 then