[Lazarus] how to debug from virtualbox

classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

[Lazarus] how to debug from virtualbox

FreeMan
Hello,
I have kubuntu 13.10 x64, fpc & lazarus last svn. My application work
without problem on linux but, crosscompiled to win and test in win8, one
form has a bug, application freezing without error, I need to debug it.
I dont wanna install all fpc lazarus and other component there too.
win8 on virtualbox, How to debug ? IDE and fpc in kubuntu, application
on w8, w8 in virtualbox
Thank you

--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] how to debug from virtualbox

Dave Coventry
On 28 April 2014 12:46, FreeMan <[hidden email]> wrote:
> Hello,
> I have kubuntu 13.10 x64, fpc & lazarus last svn. My application work
> without problem on linux but, crosscompiled to win and test in win8, one
> form has a bug, application freezing without error, I need to debug it. I
> dont wanna install all fpc lazarus and other component there too.
> win8 on virtualbox, How to debug ? IDE and fpc in kubuntu, application on
> w8, w8 in virtualbox
> Thank you

You have saved it? To your Virtualbox vdi?

I get these kind of errors if I compile the project from my shared
folders on the Linux file system.

--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] how to debug from virtualbox

FreeMan
Yes, I copied in vbox, and its run in win system. I mean exe file run in
win drive not from shared or  network. Problem on just one form, others
hasnt problem.

28-04-2014 13:53 tarihinde, Dave Coventry yazd─▒:

>
> You have saved it? To your Virtualbox vdi?
>
> I get these kind of errors if I compile the project from my shared
> folders on the Linux file system.
>
> --
> _______________________________________________
> Lazarus mailing list
> [hidden email]
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>


--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] how to debug from virtualbox

Martin Frb
In reply to this post by FreeMan
On 28/04/2014 11:46, FreeMan wrote:
> Hello,
> I have kubuntu 13.10 x64, fpc & lazarus last svn. My application work
> without problem on linux but, crosscompiled to win and test in win8,
> one form has a bug, application freezing without error, I need to
> debug it. I dont wanna install all fpc lazarus and other component
> there too.
> win8 on virtualbox, How to debug ? IDE and fpc in kubuntu, application
> on w8, w8 in virtualbox
> Thank you

The easy way, install Lazarus on win, in your vbox.

The more complex way, get gdbserver from mingw, install that on win. And
see the wiki on remote debug. May also need to google on using gdbserver.

--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] how to debug from virtualbox

Reinier Olislagers
In reply to this post by FreeMan
On 28/04/2014 12:46, FreeMan wrote:
> I have kubuntu 13.10 x64, fpc & lazarus last svn. My application work
> without problem on linux but, crosscompiled to win and test in win8, one
> form has a bug, application freezing without error, I need to debug it.
> I dont wanna install all fpc lazarus and other component there too.
> win8 on virtualbox, How to debug ? IDE and fpc in kubuntu, application
> on w8, w8 in virtualbox

I think it's easiest to install FPC+Lazarus on your Windows image even
though you said you didn't want to do that.
Alternatively, I suppose you could build with -g -gl and run the
application in your image using gdb.exe and manually try to debug things.

--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] how to debug from virtualbox

FreeMan
> I think it's easiest to install FPC+Lazarus on your Windows image even
> though you said you didn't want to do that.
> Alternatively, I suppose you could build with -g -gl and run the
> application in your image using gdb.exe and manually try to debug things.
I don't wanna install fpc or lazarus, 'cos system will change and not be
real test system. some dll maybe path maybe settings can be change when
install that, and I can not be sure real test.

Can Lazarus remote debug  from windows? my real question is this. sorry
for my english, I'm still using dictionary.

And my bug, I founded it a few seconds ago, my old classic and
"infallible" debug system :) ShowMessage('');when you saw last number,
next line has a bug :)

procedure TFRM_.GRD_Enter(Sender: TObject);
begin
   ShowMessage('1');
   GRD_.ColumnByFieldName('Name').Width :=
GRD_Detail.ColumnByFieldName('Name').Width -4;
   ShowMessage('2');
   GRD_.BorderStyle := bsSingle;//   BUG IS HERE, ON WINDOWS, TRIGGER IT
GRD_Exit and back self again , so endless LOOP starting and application
freezing. in linux work normally
   ShowMessage('3');
   GRD_.BorderSpacing.Around := 2;
   ShowMessage('4');
end;
procedure TFRM_.GRD_Exit(Sender: TObject);
begin
   GRD_.BorderStyle := bsNone;
   GRD_.BorderSpacing.Around := 0;
   GRD_.ColumnByFieldName('Name').Width :=
GRD_Detail.ColumnByFieldName('Name').Width +4;
end;

Please, can some test this in windows fpc & IDE?
Thanks for help


--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] how to debug from virtualbox

Martin Frb
On 28/04/2014 12:54, FreeMan wrote:

>> I think it's easiest to install FPC+Lazarus on your Windows image even
>> though you said you didn't want to do that.
>> Alternatively, I suppose you could build with -g -gl and run the
>> application in your image using gdb.exe and manually try to debug
>> things.
> I don't wanna install fpc or lazarus, 'cos system will change and not
> be real test system. some dll maybe path maybe settings can be change
> when install that, and I can not be sure real test.
>
> Can Lazarus remote debug  from windows? my real question is this.
> sorry for my english, I'm still using dictionary.

Yes. But we do not supply the tools. You must download them yourself.

I have never tried via SSH, so I do not know if that works.
GdbServer does work on windows.

Having said that, I only tested Window to other Windows.
If you do Linux to windows you need to test if your local gdb can open
the windows exe for symbols (afaik it needs a copy of the windows exe).
Theoretically this should work. Again this kind of gdb stuff, you need
to find gdb support / gdb mail list....


You must download it (e.g. from mingw), maybe also download any dll it
needs (some versions need dll / It will pop up a notice, if it does).

There are some notes here.
http://wiki.lazarus.freepascal.org/Remote_Debugging

All else google the docs for gdbserver.

Lazarus 1.2 supports this (but likely with some limitations), But 1.3
has improved support.



--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] how to debug from virtualbox

Reinier Olislagers
In reply to this post by FreeMan
On 28/04/2014 13:54, FreeMan wrote:
>> I think it's easiest to install FPC+Lazarus on your Windows image even
>> though you said you didn't want to do that.
>> Alternatively, I suppose you could build with -g -gl and run the
>> application in your image using gdb.exe and manually try to debug things.
> I don't wanna install fpc or lazarus, 'cos system will change and not be
> real test system. some dll maybe path maybe settings can be change when
> install that, and I can not be sure real test.

Then clone the image/use differencing hard disks etc.

Alternatively, add another virtual disk, copy over FPC/Lazarus install
from e.g. usb stick. Using fpcup also works. Installing from source also
works.
Running the installer and not selecting any file associations may also
work; I don't think the installer modifies the path but I'm not sure.


--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] how to debug from virtualbox

FreeMan
In reply to this post by Martin Frb
I understood Martin, I have no much time now for try this, importent for
me, find bug & fix it and next form convert from all project. I founded
it and I'll fix that by my way, my idea is dbgrid bug it, but need test
in windows IDE, I haven't it. so I can't report this is bug.
If I do remote debug from linux to windows, I'll write detail on mail list
Thank you for all answers


28-04-2014 15:21 tarihinde, Martin Frb yazd─▒:

>
> Yes. But we do not supply the tools. You must download them yourself.
>
> I have never tried via SSH, so I do not know if that works.
> GdbServer does work on windows.
>
> Having said that, I only tested Window to other Windows.
> If you do Linux to windows you need to test if your local gdb can open
> the windows exe for symbols (afaik it needs a copy of the windows
> exe). Theoretically this should work. Again this kind of gdb stuff,
> you need to find gdb support / gdb mail list....
>
>
> You must download it (e.g. from mingw), maybe also download any dll it
> needs (some versions need dll / It will pop up a notice, if it does).
>
> There are some notes here.
> http://wiki.lazarus.freepascal.org/Remote_Debugging
>
> All else google the docs for gdbserver.
>
> Lazarus 1.2 supports this (but likely with some limitations), But 1.3
> has improved support.
>
>
>
> --
> _______________________________________________
> Lazarus mailing list
> [hidden email]
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>


--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] how to debug from virtualbox

Bart
In reply to this post by FreeMan
On 4/28/14, FreeMan <[hidden email]> wrote:
> procedure TFRM_.GRD_Enter(Sender: TObject);
> begin
>    ShowMessage('1');
>    GRD_.ColumnByFieldName('Name').Width :=
> GRD_Detail.ColumnByFieldName('Name').Width -4;
>    ShowMessage('2');
>    GRD_.BorderStyle := bsSingle;//   BUG IS HERE, ON WINDOWS, TRIGGER IT
> GRD_Exit and back self again , so endless LOOP starting and application

> Please, can some test this in windows fpc & IDE?
> Thanks for help

How are we supposed to do that with only this little piece of code?
E.g. what is GRD_ ?

As others have pointed out: the easiest way is to simply install
Lazarus on the windows vm en debug it there.
I do so on my Linux VM without any problem whatsoever.

Bart

--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] how to debug from virtualbox

Graeme Geldenhuys-3
In reply to this post by FreeMan
On 2014-04-28 12:54, FreeMan wrote:
> I don't wanna install fpc or lazarus, 'cos system will change and not be
> real test system.

Take a VirtualBox snapshot of the VM. Install FPC & Lazarus. Debug your
app. Once done, restore to the snapshot - it's as if nothing has changed
in the VM. I do this all the time when testing installations or trying
out new software.

Alternatively, you can use tiOPF's tiLog unit (it can be used
stand-alone without using the rest of tiOPF). It gives you console, GUI,
debug server etc log output support. tiOPF can be found on SourceForge
(http://www.tiopf.com)

Regards,
  - Graeme -

--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] how to debug from virtualbox

FreeMan
In reply to this post by Bart
> How are we supposed to do that with only this little piece of code?
> E.g. what is GRD_ ?
Apologize, I was forget,

GRD_ is TRxDBGrid. TNotify event is OnEnter and OnExit events. This events not modified by rx, comes from TCustomDBGrid->....TWinControl
And not just onenter event

OnEnter
   GRD_.BorderStyle := bsSingle;
onExit
   GRD_.BorderStyle := bsNone;

On windows, trigger it self, when click on grid and onenter event triggered onexit then onenter?? this been start endless loop. In linux everythink is normal

> I do so on my Linux VM without any problem whatsoever.
Thank you Bart, I was wrote its work on linux. What is your linux info?
x64? kde gnome  etc
And I know can clone vdi from vbox, but I have not enough space on my
disk, If I can find free space my first job will backup my sistem and
upgrade my kubuntu 13.10 to 14.04 lts
I was looking for just maybe I didn't see can make remote debug :) just
try my chance. Martin message in my bookmark I'll try it, if I finish my
todo list :S
Than you for all answers



--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] how to debug from virtualbox

Marc Weustink-3
FreeMan wrote:

>> How are we supposed to do that with only this little piece of code?
>> E.g. what is GRD_ ?
> Apologize, I was forget,
>
> GRD_ is TRxDBGrid. TNotify event is OnEnter and OnExit events. This
> events not modified by rx, comes from TCustomDBGrid->....TWinControl
> And not just onenter event
>
> OnEnter
>    GRD_.BorderStyle := bsSingle;
> onExit
>    GRD_.BorderStyle := bsNone;
>
> On windows, trigger it self, when click on grid and onenter event
> triggered onexit then onenter?? this been start endless loop. In linux
> everythink is normal

Changing control layout within a control event is tricky since this may
trigger a control recreation. This may fire some events.

Marc



>
>> I do so on my Linux VM without any problem whatsoever.
> Thank you Bart, I was wrote its work on linux. What is your linux info?
> x64? kde gnome  etc
> And I know can clone vdi from vbox, but I have not enough space on my
> disk, If I can find free space my first job will backup my sistem and
> upgrade my kubuntu 13.10 to 14.04 lts
> I was looking for just maybe I didn't see can make remote debug :) just
> try my chance. Martin message in my bookmark I'll try it, if I finish my
> todo list :S
> Than you for all answers
>
>
>
> --
> _______________________________________________
> Lazarus mailing list
> [hidden email]
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus