[Lazarus] gdb debug server class

Justin Smyth delphian at smythconsulting.net
Mon Jul 7 13:01:55 CEST 2014


Thanks

 

In the constructor I have 

 

  if FDebugger_OpenOCD_Config = nil then

    FDebugger_OpenOCD_Config := TStringList.Create;

 

I’ve added a destroy

 

destructor TGDBMIOpenOCDDebuggerProperties.Destroy;

begin

  if FDebugger_OpenOCD_Config <> nil then

  begin

    FreeandNil(FDebugger_OpenOCD_Config);

  end;

  inherited Destroy;

end;

 

and I’ve added    destructor Destroy; override; into the class itself

 

in the assign I’ve added

 

    FDebugger_OpenOCD_Config :=
TGDBMIOpenOCDDebuggerProperties(Source).FDebugger_OpenOCD_Config;

 

 

 

As for the setter I’ve not added that , is that not the same as what I’ve
already done ?

 

 

 

Kind Regards

 

 

Justin

 

PS I’ll get it added once my project is up and working 

From: Martin Frb [mailto:lazarus at mfriebe.de] 
Sent: Monday, 7 July 2014 8:24 PM
To: delphian at smythconsulting.net; Lazarus mailing list
Subject: Re: [Lazarus] gdb debug server class

 

On 07/07/2014 11:08, Justin Smyth wrote:

Hi folks , 

 

I’m trying to make a copy of GDBMiServerDebugger, to allow some extra gdb
commands to be saved and  parsed.

 

 

In the list of properties I want to add a list of strings to save, ie (
assuming i have changed the name of the class , I am just  copying out of
the original

 

I want to store 3 or 4 extra commands I want gdb to run when It executes my
arm file via open ocd gdb. 

 

TGDBMIServerDebuggerProperties = class(TGDBMIDebuggerPropertiesBase)

  private

    FDebugger_Remote_Hostname: string;

    FDebugger_Remote_Port: string;

-à FDebugger_Custom_List:TStringList ß

  public     

 

is this possible ? if I do this I need to add FDebugger_Custom_List =
TStringList.create; into the constructor listed below

 

constructor TGDBMIServerDebuggerProperties.Create;


Yes, the object needs to be present, so it can be used in the OI.

You probably also need a setter for the propert

procedure SetDebugger_Custom_List( New:TStringList );
   FDebugger_Custom_List.assign(New);


and a destructor to free it.Do not forget to add all of your fields to the
ASSIGN method too. 

And last note, I have not looked at how this is stringified when saved. So I
do not know if it works with TStrings (it should...)

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20140707/295ca3a8/attachment-0003.html>


More information about the Lazarus mailing list