Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2014-07

gdb debug server class

5 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Justin Smyth

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;

Kind Regards

Justin Smyth

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20140707/0540ae7a/attachment.html>

Reply by email

Martin Frb
to Justin Smyth
Justin Smyth wrote 30 lines
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.freepascal.org/pipermail/lazarus/attachments/20140707/d47b23fe/attachment.html>

Reply by email

Martin Frb
to Justin Smyth: I?m trying to make a copy of GDBMiServerDebugger, to allow some extra gdb commands to be…
Justin Smyth wrote 7 lines
Hi folks , I'm trying to make a copy of GDBMiServerDebugger, to allow some extra gdb commands to be saved and parsed.

Make sure you do that in trunk.

All the units moved to new places....
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20140707/9f53cd77/attachment.html>

Reply by email

Justin Smyth
to Martin Frb: Yes, the object needs to be present, so it can be used in the OI. You probably also need…

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

Earlier message 70 lines
From: Martin Frb [mailto:] Sent: Monday, 7 July 2014 8:24 PM To: ; 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.freepascal.org/pipermail/lazarus/attachments/20140707/295ca3a8/attachment-0001.html>

Reply by email