Re: [Lazarus] Get SQL before TSQLQuery execute
On 2015-06-23 20:40, aradeonas wrote: MySQL and ant its interseting to know what query, application will pass to server. Indeed. I've been using Firebird for years, but only recently did they add decent tracing support for the server. tiOPF (what I use for all database access and more) already had a very good logging framework, so years ago I added an option to log all generated SQL. It was very useful to have, but I guess you are not using tiOPF. ;-) Regards, - Graeme - -- fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Thread based timer vs TTimer
On 06/23/2015 04:36 PM, Graeme Geldenhuys wrote: I don't use TCustomApplication anywhere in fpGUI or my applications. I've also never had the need for QueueAsyncCall(), sorry. ;-) My easy way to do (embedded) application for headless devices (hence obviously NopGUI) is to do the application first on a (Linux) PC including a GUI for monitoring states and introducing stimulus events, using a set of dedicated units for GUI stuff and another set of dedicated units for the business logic. In the end, the GUI units can be replaced by noGUI workalikes with stripped-off debugging functionality, leaving the business logic units untouched. So if you face any problems with the running task, for debugging you easily can use the GUI enabled application, again. As such embedded application often need to communicate with multiple partners via TCP/IP, serial interfaces etc, and need to do complex timing, it does make sense to use threads and TTimers. Of course a complete cross-development with cross compiling and remote debugging (PC - headless device) would be another decent option here. But I have not been able to make this work. (For C based project I use an Eclipse IDE for cross compiling and remote debugging every day.) So IMHO, an activeNoGUI Widget Type that automates the process of porting would be nice to have. In fact all this has become less priority during the last few years, as you rather easily at rather low additional cost you can plan your embedded device to be GUI enable (e.g. with a BeagleBone or an Odroid). But I e.g. needed to do software for a NAS device and here, no Graphic was available at all. Nonetheless I hope to be able to publish the activeNoGUI Widget Type for Lazarus one day soon. -Michael -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Thread based timer vs TTimer
On 06/24/2015 03:57 AM, Michael Schnell wrote: On 06/23/2015 04:36 PM, Graeme Geldenhuys wrote: I don't use TCustomApplication anywhere in fpGUI or my applications. I've also never had the need for QueueAsyncCall(), sorry. ;-) My easy way to do (embedded) application for headless devices (hence obviously NopGUI) is to do the application first on a (Linux) PC including a GUI for monitoring states and introducing stimulus events, using a set of dedicated units for GUI stuff and another set of dedicated units for the business logic. In the end, the GUI units can be replaced by noGUI workalikes with stripped-off debugging functionality, leaving the business logic units untouched. So if you face any problems with the running task, for debugging you easily can use the GUI enabled application, again. As such embedded application often need to communicate with multiple partners via TCP/IP, serial interfaces etc, and need to do complex timing, it does make sense to use threads and TTimers. Of course a complete cross-development with cross compiling and remote debugging (PC - headless device) would be another decent option here. But I have not been able to make this work. (For C based project I use an Eclipse IDE for cross compiling and remote debugging every day.) So IMHO, an activeNoGUI Widget Type that automates the process of porting would be nice to have. In fact all this has become less priority during the last few years, as you rather easily at rather low additional cost you can plan your embedded device to be GUI enable (e.g. with a BeagleBone or an Odroid). But I e.g. needed to do software for a NAS device and here, no Graphic was available at all. Nonetheless I hope to be able to publish the activeNoGUI Widget Type for Lazarus one day soon. -Michael As you know Michael I've been *very* interested for years with what you are doing. I hope to get more going with FPC and Teensy in the next few weeks: http://forum.lazarus.freepascal.org/index.php/topic,28561.0.html Then I hope to post more projects in the Wiki and also on this page: http://ControlPascal.com/ I look forward to working together with you and others... -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Newbie, porting class to FPC but get procedure assignment error
El 19/06/2015 a las 9:38, Luca Olivetti escribió: El 19/06/15 a les 09:25, Bo Berglund ha escrit: constructor TSentinel.Create; begin FTimer := TTimer.Create(Application); FTimer.Enabled := false; FTimer.Interval := 0; FTimer.OnTimer := OnCheckTimer(Self); //= Error here ... Why is this difference Delphi/FPC appearing and what can I do? Either you use {$MODE DELPHI} or you prepend the method with @, i.e. FTimer.OnTimer := @OnCheckTimer I think that Luca's code doesn't work on delphi either. He should write FTimer.OnTimer := OnCheckTimer; Without the self parameter self. If you add the parameter self, delphi would think you call method function called OnChecktimer. As OnCheckTimer is a procedure, not a function, rises error. If OnTimer wouldn't had parameters, there could a confusion, that IMHO FPC with @ solves in an elegant way. With a parameter there is no ambiguity, that's an error: Assigning to variable the result of procedure. -- Santiago A. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Thread based timer vs TTimer
On 06/24/2015 12:50 PM, Paul Breneman wrote: As you know Michael I've been *very* interested for years with what you are doing. I hope to get more going with FPC and Teensy in the next few weeks: http://forum.lazarus.freepascal.org/index.php/topic,28561.0.html Then I hope to post more projects in the Wiki and also on this page: http://ControlPascal.com/ I look forward to working together with you and others... Great to see you back on this issue ! Thanks a lot. Unfortunately, for me, right now Lazarus is just a hobby task, as I don't have any real application for it at the moment. But I still am lurking, and eager to finish the work in progress I have been starting, before we (company) decided not to use Lazarus in the way that I have been suggesting. An hence I am very busy with other (ANSI C based embedded) stuff. If you want to help with activeNoGUI the first thing that is needed to be done is verify if a current standard distribution of Lazarus will install an fpc version that provides TThread.Queue. If this is given I will re-test the code I did for the activeNoGUI interface unit (that provides TApplication etc). Then I could send you the code to do more testing and provide suggestions. If we are happy with the results we could investigate how it is possible to have it integrated in the Lazarus IDE as an additional selectable Widget Type. Thanks again, -Michael -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Newbie, porting class to FPC but get procedure assignment error
On 23/06/15 23:06, luiz americo pereira camara wrote: Take a look at https://msdn.microsoft.com/pl-pl/library/vstudio/7dz62kfh(v=vs.110).aspx https://msdn.microsoft.com/pl-pl/library/vstudio/7dz62kfh%28v=vs.110%29.aspx (it suggests a cvtres.exe tool) Ask to fpc guru if is possible to use manually an different linker like http://www.digitalmars.com/ctg/optlink.html In the end, i would try to compile a delphi dll and access it in fpc. Another try (don't know if is possible) is to use delphi to compile spromeps.pas as a obj in COFF I have discovered potential bugs in the 3rd party tool objconv.exe that converts from omf to coff, and most importantly in fpc's internal linker. I provided Bo Berglund with a workaround for objconv that seems to work, and advised him to use the external linker (-Xe switch). The exception has vanished and basic tests have succeeded. I will file a bug report against fpc's internal linker soon. Stephano -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Newbie, porting class to FPC but get procedure assignment error
On 23/06/15 23:06, luiz americo pereira camara wrote: Take a look at https://msdn.microsoft.com/pl-pl/library/vstudio/7dz62kfh(v=vs.110).aspx https://msdn.microsoft.com/pl-pl/library/vstudio/7dz62kfh%28v=vs.110%29.aspx (it suggests a cvtres.exe tool) Ask to fpc guru if is possible to use manually an different linker like http://www.digitalmars.com/ctg/optlink.html In the end, i would try to compile a delphi dll and access it in fpc. Another try (don't know if is possible) is to use delphi to compile spromeps.pas as a obj in COFF I have discovered potential bugs in the 3rd party tool objconv.exe that converts from omf to coff, and most importantly in fpc's internal linker. I provided Bo Berglund with a workaround for objconv that seems to work, and advised him to use the external linker (-Xe switch). The exception has vanished and basic tests have succeeded. I will file a bug report against fpc's internal linker soon. Stephano -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Invisible Breakpoint
On 24/06/2015 19:28, aradeonas wrote: But code is in exe and line works,I put a log in that line and it works. No I havent and options are as wiki : Link smart= False; (wiki screenshot seems outdated) Can it be that the lines are inlined? Please check, if those dots are missing right away, when you start debugging and have not (since compiling) edited the file. or open the exe in gdb, and check if there is debug info for this line gdb -mi yourexe.exe info line yourunit.pas:291 Should return something like: Line 291 of \include/control.inc\ starts at address 0x543105 SETTEXT+325 and ends at 0x5433d1 SETTEXT+1041 info line yourunit.pas:292 If both line have code then the address should go up, if it does not, the fpc did not put debug info for that line, and the debugger can not find it. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Get SQL before TSQLQuery execute
I tried to add log in the mysqlconn.inc but after clean buld project and all files still my new code wont run. How can I get the value of FStatement for now? Ara -- http://www.fastmail.com - Access your email from home and the web -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Invisible Breakpoint
Please check, if those dots are missing right away, when you start debugging and have not (since compiling) edited the file. Yes they missed when I start right away after opening Lazarus. or open the exe in gdb, and check if there is debug info for this line gdb -mi yourexe.exe How? If you mean in command line it says there isnt any -mi. Also I changed the lines but still if I set breakpoint in that line (now its 280) it still wait at the next procedure's begin. Regards, Ara -- http://www.fastmail.com - Choose from over 50 domains or use your own -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Newbie, porting class to FPC but get procedure assignment error
ALMOST SOLVED (workaround found) As patspiper has posted there has been a potential bug discovered in the fpc linker while tracing my problems with porting the Sentinel SuperPro dongle handler class from Delphi to Lazarus/FPC. In order to port it we had to convert an OBJ file from the dongle maker to a format FPC accepts (coff) using a 3rd party tool, which also has some bug in it. Patspiper will handle the bug reports. The solution to the actual problem for me was: 1) Convert the OBJ file to COFF and alias the internal identifiers such that FPC can find them. This uses the 3rd party tool objconv. Then replace the include directive for the OBJ file with the COFF file. 2)Use the compiler switch -Xe in order to link externally. Much slower but results in a working application. Many thanks to patspiper who has spent a lot of time helping me to track down the cause of the problems! -- Bo Berglund Developer in Sweden -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Invisible Breakpoint
On 23/06/2015 19:07, aradeonas wrote: Its almost first condition but I removed breakpoint but it debugger think it still there. I will try to to reproduce it,its hard becuse it finds out suddenly but as I understand it mostly happen in other packages not the project. 1) Most Important: - OS? (Version?) - CPU? - Lazarus 1.4 ? - fpc 2.6.4? - gdb version (on windows 32 bit, it is 7.2 if you use the normal installer) 2) So it is also gone from the list in the breakpoint window? (Menu View Debug Windows) 3) Do you remove the breakpoint, while the program is - running - paused - debugger stopped - dgb starting up / pressed F9, but not yet seeing your app on screen - dbg stopping 4) This is all in a single debug run? Or do you debug, end debug, start a new debug, and in the new debug a breakpoint still exists, that you removed? 5) Does the code contains any threads? On Windows: Does it happen shortly after (up to a minute) after using a file open/save (or other file/print/system) dialog? Many of them create threads. If you can keep the thread window open, so you see if there are any threads. (On Windows, hitting pause, creates ONE extra thread) 6) Try running Lazarus creating a logfile: http://wiki.lazarus.freepascal.org/GDB_Debugger_Tips#Log_info_for_debug_session When you exit/ restart the IDE, delete the log, or it keeps growing. When the issue happens again, send the log (if to big for the mail list, you can sent directly to me, or attach to a bug created) When it happens, notice filename and line where the debugger stopped., then stop the debugger, without doing any further debugging, and exit the ide, so the log will be correctly finished. - Alternatively, if the above is too much / taking to long, then you can try to: - in tools option reset debugger after each run£ - on Windows 32: use the gdb 7.7.1 (alternative gdb) from the Lazarus SourceForge site -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Lazbuild and project macros
On Wed, 24 Jun 2015 15:30:47 +0100 Graeme Geldenhuys mailingli...@geldenhuys.co.uk wrote: Hi, Out of interest, can lazbuild set new values for IDE Macros defined in the project (.lpi) file? There is no option yet. A patch is welcome. You could create a build mode where the IDE Macro is set by $Env(YourEnvVar). Mattias -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Invisible Breakpoint
On 24/06/2015 23:30, aradeonas wrote: How? If you mean in command line it says there isnt any -mi. sorry it is gdb -i mi project.exe probably a simple gdb project.exe will also do Also I changed the lines but still if I set breakpoint in that line (now its 280) it still wait at the next procedure's begin. Breakpoint normally only work on lines with blue dots. So if there is no blue dot then that means there is no line of code there. Well of course in your case there is. But it is unknown to the debugger. - Either FPC did not generate the info when compiling - gdb has a bug reading the issue - the IDE does display incorrect In the last case the breakpoint would actually work. For the IDE does not check for the blue dot. IT just displays it, but does not use it for any check when setting the breakpoint. You can try explicitly setting debug info to dwarf2 (with sets) or stabs. Btw. The above case likely has a different cause than the breakpoint at line 0. So there may be 2 issues. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Invisible Breakpoint
1) Windows 8.1 64 bit but it also happened in 7 64bit. CPU's are Intel core 2 (recent) and A new AMD model that I couldnt remember. fpc yes 2.6.4 and Lazarus 1.4 32bit and gdb is default.all are default and was default.this problem is here for last 3 released version. 2) No they are in the breakpoints list but when you dbl click or want to go to the line,Lazarus cant find the line. 3) I have doubt about it but as I remember yes I changed code and breakpoint in the middle of debugging but not always I think. 4) Single debug ,also many times it will be there after closing and opening the project again and again until suddenly it be removed or sometimes I made breakpoint in the line and propitious and next lines and remove them. 5) No. 6) OK I will. Is gdb 7.2 used for last 3 Lazarus release?because I have this problem from the first time I met Lazarus and I think it 3 or 4 version ago. Regards, Ara -- http://www.fastmail.com - Faster than the air-speed velocity of an unladen european swallow -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Get SQL before TSQLQuery execute
I will read about tiOPF (Thank you) but I want to ask is TSQLQuery fill parameters in SQL and then send it to MySQL or not?And if yes where so I cal log it after fill? Regards, Ara -- http://www.fastmail.com - Access your email from home and the web -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Lazbuild and project macros
On 2015-06-24 15:54, Mattias Gaertner wrote: There is no option yet. A patch is welcome. Thanks for confirming... I'll try and get a patch ready for you to review. Regards, - Graeme - -- fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
[Lazarus] Lazbuild and project macros
Hi, Out of interest, can lazbuild set new values for IDE Macros defined in the project (.lpi) file? Regards, - Graeme - -- fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Get SQL before TSQLQuery execute
On 2015-06-24 16:16, aradeonas wrote: I will read about tiOPF (Thank you) tiOPF makes database development very easy, and a big plus is that you will not be tied to one specific database backend, and you can simply recompile to enable 3-tier support too (without application changes). but I want to ask is TSQLQuery fill parameters in SQL and then send it to MySQL or not? Yes of course, otherwise your queries wouldn't work. ;-) In tiOPF I first log the SQL statement, then output the query parameter list/values. Regards, - Graeme - -- fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Thread based timer vs TTimer
On 2015-06-24 12:03, Michael Schnell wrote: Then I could send you the code to do more testing and provide suggestions. Why not simply fork the Lazarus repository on Github. Create your own branch and do all your changes in there. Publish your branch to your own Github repository (or some other public location) where others could view and pull from. $ git clone https://github.com/graemeg/lazarus.git $ cd lazarus $ git checkout -b activenogui origin/upstream // you will now be in a new 'activenogui' branch based off Laz Trunk Regards, - Graeme - -- fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Get SQL before TSQLQuery execute
On Wed, 24 Jun 2015, aradeonas wrote: I will read about tiOPF (Thank you) but I want to ask is TSQLQuery fill parameters in SQL and then send it to MySQL or not? Yes. And if yes where so I cal log it after fill? Currently, I think it is not accessible for you, I need to create an extra log type. Michael. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Invisible Breakpoint
On 24/06/2015 16:12, aradeonas wrote: 2) No they are in the breakpoints list but when you dbl click or want to go to the line,Lazarus cant find the line. Have you compared the Path in the filename? (You can see the path, by opening the properties of a breakpoint) The line does exist in the file, I assume? Have you edited the file after F9 (Answer 3 suggests you may have?)? If so are the blue dots correctly aligned with the code? Is there any error, when the IDE does not jump to the line for a hidden breakpoint. (messages window) If there is not, then use the log (below) and see, if any error is in the log (or mail it) 6) OK I will. Is gdb 7.2 used for last 3 Lazarus release?because I have this problem from the first time I met Lazarus and I think it 3 or 4 version ago. After your answer above (2), the gdb version is very unlikely to affect this. This was in case the IDE tried to delete it, but gdb refused. But the IDE still has it, so gdb is not at fault. But yes 7.2 has been used a long time. As for the log. Reduce it to: --debug-log=LOG_FILE --debug-enable=DBG_STATE,DBGMI_QUEUE_DEBUG -- unrelated. There is a common win7/8 issue (but absolutely not related): http://wiki.lazarus.freepascal.org/GDB_Debugger_Tips#On_Windows_Open.2FSave.2FFile_or_System_Dialog_cause_gdb_to_crash -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Get SQL before TSQLQuery execute
Currently, I think it is not accessible for you, I need to create an extra log type. Thanks,Can you point me to the address for now? Regards, Ara -- http://www.fastmail.com - Access all of your messages and folders wherever you are -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Get SQL before TSQLQuery execute
On 2015-06-24 17:16, aradeonas wrote: Can you point me to the address for now? Website: http://tiopf.sourceforge.net API Class documentation: http://geldenhuys.co.uk/tiopf/ Support Newsgroups: Server: geldenhuys.co.uk Port:119 Minimalist web interface: http://geldenhuys.co.uk/webnews/ Source code: $ git clone git://git.code.sf.net/p/tiopf/code tiopf $ cd tiopf $ git checkout tiopf2 Regards, - Graeme - -- fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Get SQL before TSQLQuery execute
Sure its interesting because its two days Im thinking check Thunderbird :) Regards, Ara -- http://www.fastmail.com - The way an email service should be -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Get SQL before TSQLQuery execute
Thank you VERY MUCH Graeme for your helps but Im not that lazy :D That sentence was for Michael to show me where TSQLQuery fill parameters. Regards, Ara -- http://www.fastmail.com - Access all of your messages and folders wherever you are -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Get SQL before TSQLQuery execute
On 2015-06-24 17:28, aradeonas wrote: That sentence was for Michael Interestingly, Thunderbird filed your message as a reply to one of mine. Regards, - Graeme - -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Invisible Breakpoint
Yes,File is correct,I removed a breakpoint and change code but debugger think its still there. Yes line exists but Line/Length column in BreakPoint viewer is 0 most of the times. Yes I edit file.But I dont know what you mean from blue dots. No there isnt any error. his was in case the IDE tried to delete it, but gdb refused. But the IDE still has it, so gdb is not at fault. Intersting is BreakPoint viewer show there should be a breakpoint but code editor doesnt and debugger think there is so BreakPoint viewer and debugger think same. Regards, Ara -- http://www.fastmail.com - mmm... Fastmail... -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Invisible Breakpoint
On 24/06/2015 18:45, aradeonas wrote: Martin just now I have this problem : BreakPoint viewer shows one breakpoint at line 291 but debugger wait on line 303 on begin of next procedure.when I remove procedure debugger wont wait but if I put it back on 291 it will wait on 303. I restarted IDE but problem still there and log only shows breakpoint on line 291. Ok, so the internal bap of the debugger is somehow incorrect. I assume all the above actions were within one debug session? The IDE seems to assume that you deleted lines. Now if you delete lines while debugging, the exe is not recompiled. Delete 12 lines before 290, and the code that was at line 303 will be at line 291. (That is in the editor) But in the exe in the debugger it would still be at line 303. SO if indeed those lines where deleted, then setting a breakpoint at 291, needs to set a breakpoint at what was 303 at compile time. BEst to open an issue on the bugtracker. I'll need to see how best to find additional info what causes this (that is why the IDE thinks you deleted lines, when you did not) -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Invisible Breakpoint
Take a look at attachment,as you see blue dots are at all lines except the procedure that breakpoint is in it.Also as you can see debugger wait on 303. BEst to open an issue on the bugtracker Yes but I have problem to reproduce it. Regards, Ara -- http://www.fastmail.com - Access all of your messages and folders wherever you are -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Invisible Breakpoint
On 24/06/2015 19:05, aradeonas wrote: Take a look at attachment,as you see blue dots are at all lines except the procedure that breakpoint is in it.Also as you can see debugger wait on 303. BEst to open an issue on the bugtracker Yes but I have problem to reproduce it. Ah, that looks like a different issue. There are no blue dots for that procedure at all. That usually means this procedure was not compiled into the exe at all. If the procedure is not in the exe, then gdb thinks there is no executable code on that line 291, and it sets the breakpoint on the first line with code that it can find after that. (Yep in that case it be better to not set a breakpoint at all, and mark the breakpoint as invalid, but that is not (yet) implemented). By any chance, do you have smart linking enabled? http://wiki.lazarus.freepascal.org/Debugger_Setup#Project_Options -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Invisible Breakpoint
But code is in exe and line works,I put a log in that line and it works. No I havent and options are as wiki : Link smart= False; (wiki screenshot seems outdated) Ara -- http://www.fastmail.com - Send your email first class -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Get SQL before TSQLQuery execute
On Wed, 24 Jun 2015, aradeonas wrote: Thank you VERY MUCH Graeme for your helps but Im not that lazy :D That sentence was for Michael to show me where TSQLQuery fill parameters. TSQLQuery does not do this, the TSQLConnection does this. For mysql this is mysqlconn.inc, line 592. And the detExecute log DOES show the SQL with parameters replaced (as I imagined). Michael. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Invisible Breakpoint
On 24/06/2015 18:20, Martin Frb wrote: line is 0... Interesting. you said Its almost first condition but I removed breakpoint but it debugger think it still there. Does that mean: - The breakpoint is there (red mark in the gutter) - You click it, and it disappears from the editor - Now you discover it is still there? -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Invisible Breakpoint
On 24/06/2015 18:35, aradeonas wrote: I forgot to mention I use JCF formatter much,maybe it is the reason,I will focus on it and when I found a way to reproduce it tell you. JCF may indeed not preserve breakpoints. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Invisible Breakpoint
Do you at any time replace (e.g. copy and paste -- undo/redo -- delete-all/undo ) the content of the entire file? Or at least from line 1 to the line with the breakpoint? undo only undoes the text, but the breakpoint pos might in some cases be off, after the undo. replacing lines, moves breakpoints in the replaced range, to (iirc) the top of that range. On 24/06/2015 16:55, aradeonas wrote: Yes,File is correct,I removed a breakpoint and change code but debugger think its still there. Yes line exists but Line/Length column in BreakPoint viewer is 0 most of the times. Ok it all sounds as if some part of the IDE thinks there is a different file. Is it a file in your project (main folder or via some path), or is it in some package? Do the logfile anyway, it should tell what filename and path the IDE sends to GDB. And also the line number. (see below) line is 0... Interesting. Yes I edit file.But I dont know what you mean from blue dots. When you run your app, there should be blue dots in the gutter for any executable line. Intersting is BreakPoint viewer show there should be a breakpoint but code editor doesnt and debugger think there is so BreakPoint viewer and debugger think same. Where exactly does the debugger stop in that unit? First line of first procedure? Or the actual line in which the breakpoint used to be, before it became corrupted? -- Some background. A breakpoint at line 0 can not be shown in the editor. (since first line is 1). However if setting a breakpoint in gdb to a line with no code (line 0 has no code) gdb searches the next line with code, and sets it there. (set a breakpoint on an empty line, will stop on next line) This can be useful (if its just 1 or 2 lines off), and harmful if its 100 or more lines away (e.g. in the interface section) So if you stop at the first line of code in the unit, then you got a breakpoint at line 0, and that can not be displayed in the editor. The question is, how it moved to line 0. Something else: 1) when you edit a file while NOT debugging, breakpoints move as you insert/delete lines (obviously) 2) edit a file while debugging, they still move, but only in the IDE. Because the exe in the debugger still needs the old positions. So if procedure Foo is at line 500 to 550, with a breakpoint (in foo) at 510; and you delete 5 lines somewhere before 500, then in the SourceEditor Foo is from 495 to 545 (but the loaded exe still is from 500 to 550) The IDE then maps the breakpoint (that is now displayed at 505) to still stop at 510 (in loaded exe). This map is reset when the debugger stops. Maybe there is an issue with that map... -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Invisible Breakpoint
I forgot to mention I use JCF formatter much,maybe it is the reason,I will focus on it and when I found a way to reproduce it tell you. Ara -- http://www.fastmail.com - IMAP accessible web-mail -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Invisible Breakpoint
On 24/06/2015 18:31, aradeonas wrote: Do you at any time replace (e.g. copy and paste -- undo/redo -- delete-all/undo ) the content of the entire file? Or at least from line 1 to the line with the breakpoint? Yes but not all time this problem happen. Try to keep watching those actions. In case any of them sets the line no to 0 Mostly package but it without any duplicate so make IDE wrong. Right lets ignore filename and path. It seems the issue i on the line number. Excuse me but still I can understand what you mean. As in the image. Blue dots in the gutter. (they are red on lines with breakpoint) -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Invisible Breakpoint
Do you at any time replace (e.g. copy and paste -- undo/redo -- delete-all/undo ) the content of the entire file? Or at least from line 1 to the line with the breakpoint? Yes but not all time this problem happen. Is it a file in your project (main folder or via some path), or is it in some package? Mostly package but it without any duplicate so make IDE wrong. When you run your app, there should be blue dots in the gutter for any executable line. Excuse me but still I can understand what you mean. Where exactly does the debugger stop in that unit? First line of first procedure? Or the actual line in which the breakpoint used to be, before it became corrupted? Mostly on the end of procedure. A breakpoint at line 0 can not be shown in the editor. (since first line is 1). However if setting a breakpoint in gdb to a line with no code (line 0 has no code) gdb searches the next line with code, and sets it there. (set a breakpoint on an empty line, will stop on next line) This can be useful (if its just 1 or 2 lines off), and harmful if its 100 or more lines away (e.g. in the interface section) BreakPoint viewer shows line 0 but its not about first line,it just cant find the line,for correct breakpoints when you dbl click editor go to it but for these one nothing happen. 2) edit a file while debugging, they still move, but only in the IDE. Because the exe in the debugger still needs the old positions. So if procedure Foo is at line 500 to 550, with a breakpoint (in foo) at 510; and you delete 5 lines somewhere before 500, then in the SourceEditor Foo is from 495 to 545 (but the loaded exe still is from 500 to 550) The IDE then maps the breakpoint (that is now displayed at 505) to still stop at 510 (in loaded exe). This map is reset when the debugger stops. Yes it just happens for me and I saw it for example all of breakpoints in a procedure go 2 line down. Regards, Ara -- http://www.fastmail.com - IMAP accessible web-mail -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus