Explorar o código

Add function parameters with values in Call Stack window

git-svn-id: trunk@30091 -
pierre %!s(int64=10) %!d(string=hai) anos
pai
achega
93ca6267c8
Modificáronse 1 ficheiros con 25 adicións e 2 borrados
  1. 25 2
      ide/gdbmicon.pas

+ 25 - 2
ide/gdbmicon.pas

@@ -421,8 +421,9 @@ end;
 
 procedure TGDBController.Backtrace;
 var
-  FrameList: TGDBMI_ListValue;
-  I: LongInt;
+  FrameList,FrameArgList,ArgList: TGDBMI_ListValue;
+  I,J,arg_count: LongInt;
+  s : ansistring;
 begin
   { forget all old frames }
   clear_frames;
@@ -447,6 +448,28 @@ begin
     if Assigned(FrameList.ValueAt[I].AsTuple['fullname']) then
       frames[I]^.file_name := StrNew(PChar(FrameList.ValueAt[I].AsTuple['fullname'].AsString));
   end;
+  Command('-stack-list-arguments 1');
+  if not GDB.ResultRecord.Success then
+    exit;
+
+  FrameArgList := GDB.ResultRecord.Parameters['stack-args'].AsList;
+  arg_count:=FrameArgList.Count;
+  if arg_count>frame_count then
+    arg_count:=frame_count;
+  for I := 0 to arg_count - 1 do
+  begin
+    ArgList:=FrameArgList.ValueAt[I].AsTuple['args'].AsList;
+    s:='(';
+    for J:=0 to ArgList.Count-1 do
+      begin
+        if J>0 then s:=s+', ';
+        s:=s+ArgList.ValueAt[J].AsTuple['name'].AsString;
+        if Assigned(ArgList.ValueAt[J].AsTuple['value']) then
+          s:=s+':='+ArgList.ValueAt[J].AsTuple['value'].ASString;
+      end;
+    s:=s+')';
+    frames[I]^.args:=StrNew(pchar(s));
+  end;
 end;
 
 function TGDBController.SelectFrameCommand(level :longint) : boolean;