anchor.diff:      for details about redistributing fpDebug.
   
       Description:
  -      .
  +      This unit defines some memory related commands.
   }
   unit cmdmemview;
   
  -{$ifdef fpc}{$mode delphi}{$H+}{$endif}
  +{$mode objfpc}{$H+}
   
   interface
   
  
positive.code: 
  type
  
    { TViewMemCommand }
  
    TViewMemCommand = class(TCommand)
      procedure Execute(CmdParams: TStrings; Env: TCommandEnvironment); override;
      function ResetParamsCache: Boolean; override;
      function ShortHelp: String; override;
    end;
  
    { TRegistersView }
  
    TRegistersView = class(TCommand)
      procedure Execute(CmdParams: TStrings; Env: TCommandEnvironment); override;
      function ShortHelp: String; override;
    end;
  
    { TStackView }
    TStackView  = class(TCommand)
      procedure Execute(CmdParams: TStrings; Env: TCommandEnvironment); override;
      function ShortHelp: String; override;
    end;
  
  procedure PrintI386Regs(list: TDbgDataList);
    
  implementation
  
  
  var
    LastReadOfs : TDbgPtr = 0;
  
  function BufToStr(const buf: array of byte; index, Count: Integer): string;
  var
    i : Integer;
    j : Integer;
  
negative.code:   regs  : TDbgDataBytesList;
    esp   : TDbgPtr;
    i     : Integer;
    addr  : LongWord;
    buf   : array [0..4] of byte;
  begin
  