Re: [fpc-devel] bounty: FPC based debugger
On 09/14/2011 09:00 PM, Hans-Peter Diettrich wrote: Every (reasonable) OS provides such features in its debug API. Available support depends on the actual hardware, of course. Can you point us to a description (Win XP, Win 7, Linux ?) Thanks, -Michael ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] bounty: FPC based debugger
On 09/14/2011 08:47 PM, dmitry boyarintsev wrote: That's true. The only thing concerns me about that, is there's no really a standard in GDB (i can be wrong). This of course would be a necessary condition for working with the gdb team. Also, IRC, Apple forked gdb (as well other gnu-tools) to make it usable for their own needs (iDevice debugging support). Yak ! Is a reunification in progress ? -Michael ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] bounty: FPC based debugger
Hi, On Thu, 15 Sep 2011 09:31:39 +0200, Michael Schnell wrote: On 09/14/2011 09:00 PM, Hans-Peter Diettrich wrote: Every (reasonable) OS provides such features in its debug API. Available support depends on the actual hardware, of course. Can you point us to a description (Win XP, Win 7, Linux ?) *nix: mprotect(), signal() and friends. *Win: VirtualProtect/Ex(), AddVectoredExceptionHandler() and friends. Thomas ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] bounty: FPC based debugger
On 14/09/2011 20:47, dmitry boyarintsev wrote: really a standard in GDB (i can be wrong). But I've seen a lot of issues in Lazarus gdb-support, because of the different builds of GDB used. Exactly the reason we need a FPC based debugger. Currently each Linux distro includes a different version of GDB. DWARF features added to FPC takes forever to be supported in GDB. GDB is just foreign on Windows platforms - like all other GNU tools. The release cycles between GDB and FPC (and Lazarus) are totally different. Nobody (or near nobody) that works with FPC or Object Pascal, can help maintain GDB. All things that can be improved on with a custom FPC based debugger. Last night I made some good progress with my forked Duby. Over 50 patches since the fork, loads of memory leak fixes, class cleanup by slowly removing those pesky global variables, finally have a working breakpoint system under 32bit 64bit Linux. I'm learning the code and debugging internals as I go, but it's fun. :) What really boggles the mind is debugging a debugger that is currently debugging an application, using GDB. WTF!! :-D Regards, - Graeme - -- fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] bounty: FPC based debugger
On Thu, Sep 15, 2011 at 5:52 AM, Graeme Geldenhuys graemeg.li...@gmail.com wrote: Last night I made some good progress with my forked Duby. Over 50 patches since the fork, loads of memory leak fixes, class cleanup by slowly removing those pesky global variables, finally have a working breakpoint system under 32bit 64bit Linux. I'm learning the code and debugging internals as I go, but it's fun. :) And you will provide these patches, from SVN/Git, right? =) Marcos Douglas ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] bounty: FPC based debugger
On 15/09/2011 13:52, Marcos Douglas wrote: And you will provide these patches, from SVN/Git, right? =) Yes of course. Now that I know Dmitry's goals for Duby is quite different to mine [based on his recent posts], I'll publish it to GitHub in due time - with a different project name to prevent confusion. Dimitry is obviously welcome to grab whatever patches he sees fit for Duby. Regards, - Graeme - -- fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] bounty: FPC based debugger
On Thu, Sep 15, 2011 at 3:34 AM, Michael Schnell mschn...@lumino.de wrote: Yak ! Is a reunification in progress ? I'd ask on Apple-dev-maillist, gdb-maillist, gnu-maillist or Jonas :) 2 Graeme: thanks for your hard work! I could definitely use code clean-ups. thanks, Dmitry ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] bounty: FPC based debugger
On 09/13/2011 04:52 PM, Hans-Peter Diettrich wrote: It's not the CPU, it's more the MMU which can help in finding changed (global) variables. AFAIK, the MMU can not work in byte addresses but just with much bigger blocks of data. So it does not seem to help with finding a write access to a dedicated variable. Moreover the MMU programming and interrupts will be consumed by the OS and a user space program can't even see it. -Michael ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] bounty: FPC based debugger
On 09/13/2011 02:53 PM, Joost van der Sluis wrote: You do know that GDB does have a Pascal extension, right? IMHO, if we really can work with the gdb team on feeding the necessary Object-Pascal specific add-ons into gdb, creating a new debugger from scratch does not make any sense at all. -Michael ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] bounty: FPC based debugger
On 09/13/2011 04:59 PM, Hans-Peter Diettrich wrote: IMO you're addressing the wrong audience. Most things, beyond breakpoint handling, stepping and memory read/writes, can be done outside the debugger. Such external code is not bound to debugger support, and can use language specific information (RTTI...). If this is true, why discussing replacing gdb ? -Michael ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] bounty: FPC based debugger
On 14.09.2011 12:44, Michael Schnell wrote: On 09/13/2011 04:52 PM, Hans-Peter Diettrich wrote: It's not the CPU, it's more the MMU which can help in finding changed (global) variables. AFAIK, the MMU can not work in byte addresses but just with much bigger blocks of data. So it does not seem to help with finding a write access to a dedicated variable. Moreover the MMU programming and interrupts will be consumed by the OS and a user space program can't even see it. But the debugger can ask the OS to write protect a page or to enable a page guard (which triggers on write access) and then the corresponding signal/exception can be catched. This reduces the checks necessary from the complete process memory down to only the page size. Note: I don't know whether it's implemented like that in any debugger, this is just a theory of mine. Regards, Sven ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] bounty: FPC based debugger
On 09/14/2011 01:58 PM, Sven Barth wrote: But the debugger can ask the OS to write protect a page or to enable a page guard (which triggers on write access) and then the corresponding signal/exception can be catched. This reduces the checks necessary from the complete process memory down to only the page size. Do you think this is possible without rewriting the OS (for all supported OSes) -Michael ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] bounty: FPC based debugger
Sven Barth schrieb: But the debugger can ask the OS to write protect a page or to enable a page guard (which triggers on write access) and then the corresponding signal/exception can be catched. This reduces the checks necessary from the complete process memory down to only the page size. Note: I don't know whether it's implemented like that in any debugger, this is just a theory of mine. Every (reasonable) OS provides such features in its debug API. Available support depends on the actual hardware, of course. DoDi ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] bounty: FPC based debugger
On Wed, Sep 14, 2011 at 6:48 AM, Michael Schnell mschn...@lumino.de wrote: IMHO, if we really can work with the gdb team on feeding the necessary Object-Pascal specific add-ons into gdb, creating a new debugger from scratch does not make any sense at all. That's true. The only thing concerns me about that, is there's no really a standard in GDB (i can be wrong). But I've seen a lot of issues in Lazarus gdb-support, because of the different builds of GDB used. Also, IRC, Apple forked gdb (as well other gnu-tools) to make it usable for their own needs (iDevice debugging support). I'm not sure, if the latest changes of gdb are there in the Apple gdb, I would assume they're there. thanks, Dmitry ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] bounty: FPC based debugger
On 14.09.2011 14:53, Michael Schnell wrote: On 09/14/2011 01:58 PM, Sven Barth wrote: But the debugger can ask the OS to write protect a page or to enable a page guard (which triggers on write access) and then the corresponding signal/exception can be catched. This reduces the checks necessary from the complete process memory down to only the page size. Do you think this is possible without rewriting the OS (for all supported OSes) At least Windows allows to use page guards... I don't know about Linux though. Regards, Sven @Michael: Sorry, this mail wasn't meant to be private, but Reply to list put your mail address into the to field instead of the list's address. ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] bounty: FPC based debugger
On 09/12/2011 11:16 PM, Hans-Peter Diettrich wrote: - watchpoints. break when data at memory address changed. I've seen applications crawl when such a feature was used :-( This is bound to happen unless the CPU provides support for this. (I have no idea which of the CPUs supported by FPC has what kind of hardware data-breakpoint support. I suppose this is a very complex list). -Michael ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] bounty: FPC based debugger
On 09/12/2011 11:51 PM, Hans-Peter Diettrich wrote: ) debugger, I only want *better* high-level (language specific) support in Lazarus. Finally I want to debug applications, not an new debugger with different behaviour and restrictions on every platform ;-) A multi-arch compiler should come with decent support for compatible multi-arch enabled debugging including remote-debugging, for cross-compiling environment. In so far I'm not very interested in commandline and remote debugging, I suppose (like gdb) the debugger needs to consist of stubs that run the executable under test and communicate via some byte-stream interface with a user interface. This given, remote debugging should not offer any additional challenge and a command-line interface is the obvious starting point before doing a complex GUI (e.g. integrated in an IDE) -Michael ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] bounty: FPC based debugger
On Monday 12 September 2011 13:36:43 Graeme Geldenhuys wrote: On 12/09/2011 13:32, Martin Schreiber wrote: I think it is better to invest time into gdb support instead into a FPC debugger which probably never will reach a usable state. [sarcasm on] With that attitude the same could be applied to MSEide, MSEgui and fpGUI too. Why did we bother investing time and effort into developing such frameworks or IDE's, when the should rather have invested our time in Lazarus?? Then again, why did somebody invest in FPC when we could simply have used the de-facto standard Object Pascal compiler - Delphi, stick to Windows (which covers 90% of the market). [sarcasm off] True. And because we know what it means to develop something new from scratch and because I know that I don't want to invest several years into development of a FPC debugger and because we know that there are not so many people who can make such a development and are able to *finish* the project I suggest to concentrate on gdb. Why would anybody want to concentrate on gdb, which is an ancient debugger, that does not have a modern GUI integrated into it, and that was not built to handle Pascal in the first place? Every compiler / environment should feature an integrated debugger, that can be compiled within the environment itself. That is the first priority, which is much more important than an IDE and GUI. How else could people debug applications? When I selected an environment for my OS (OpenWatcom), first priority was a debugger that could be built within the environment, and that did not build on specific OS-features, but rather could be compiled for the OS in question. A decent debugger must also suppport remote-debugging over TCP/IP. ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] bounty: FPC based debugger
Den 13-09-2011 10:15, Michael Schnell skrev: On 09/12/2011 11:16 PM, Hans-Peter Diettrich wrote: - watchpoints. break when data at memory address changed. I've seen applications crawl when such a feature was used :-( This is bound to happen unless the CPU provides support for this. (I have no idea which of the CPUs supported by FPC has what kind of hardware data-breakpoint support. I suppose this is a very complex list). -Michael i386, x86_64 and ARM has watchpoint/hardware breakpoint support. It's not really hard on either of them to implement. For i386 and x86_64 you can simply write values into DR0-DR3 with entries and configure them through DR6,7(if the OS supports that, I would guess that Windows does since it exposes them in the CONTEXT type). That limits the number to 4 watchpoints/breakpoints, but since breakpoints can be inserted into the code on this platform the number of breakpoints doesn't have to be limited here. For ARM embedded you usually have to go through a JTAG/SWD library, and communicate with the core debugger. ARM seems to have all types freely documented. I'm working on a JTAG library, and have rudimentary support for Cortex-M3 and soon Cortex-A8. An ARM-Linux platform would need hardware debugger monitor support, which I guess would exist somehow. ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] bounty: FPC based debugger
On 12 Sep 2011, at 15:23, r...@rdos.net wrote: Why would anybody want to concentrate on gdb, which is an ancient debugger, It's only 7 years older than FPC (GDB: 1986; FPC: 1993). that does not have a modern GUI integrated into it, A GUI should not be integrated in a debugger. You don't want to recompile a debugger depending on whether you use KDE or GNOME. However, what is useful and what GDB does lack, is the ability to use the debugger in library form. and that was not built to handle Pascal in the first place? GDB is built for supporting multiple languages. E.g., its ADA support has been much better than its C++ support for a long time (although C+ + support is getting fairly good nowadays too). Jonas ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] bounty: FPC based debugger
On 09/12/2011 03:23 PM, r...@rdos.net wrote: that does not have a modern GUI integrated into it, Why should a debugger have it's own GUI ? IMHO it should be used integrated in an IDE, so tit should have a decent API to be used by an IDE. So providing a command line interface (if started sitting on the API) for testing the debugger, for use in a batch, and just in case somebody does not use an IDE, is very appropriate. -Michael ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] bounty: FPC based debugger
On 09/13/2011 11:06 AM, Jonas Maebe wrote: GDB is built for supporting multiple languages. E.g., its ADA support has been much better than its C++ support for a long time (although C++ support is getting fairly good nowadays too). Unfortunately it seems to be hard (or close to impossible) to work with the g* team(s) to have gdb (or gcc) provide Object Pascal specific features :-( . -Michael ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] bounty: FPC based debugger
On 13 Sep 2011, at 12:59, Michael Schnell wrote: On 09/13/2011 11:06 AM, Jonas Maebe wrote: GDB is built for supporting multiple languages. E.g., its ADA support has been much better than its C++ support for a long time (although C++ support is getting fairly good nowadays too). Unfortunately it seems to be hard (or close to impossible) to work with the g* team(s) to have gdb (or gcc) provide Object Pascal specific features :-( . Don't insult people when you clearly don't have any experience whatsoever in working with them. The gdb people have always been extremely helpful to Pierre, Joost and me whenever we had any questions whatsoever about how to add certain Pascal-specific functionality to gdb. And the gcc people have added a DWARF identifier for the i386 Borland calling convention in a header file that's imported by gdb so that it would be possible to add support for it to gdb (even though gcc does not support it in any way). The only thing you can say is that it is not possible to order the GNU people to implement and maintain all kinds of specific features especially for us, even though their own interests or employers have no use or interest in those features. That is however perfectly normal for open source/free software projects, and that is no different in the FPC community. Jonas ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] bounty: FPC based debugger
On Tue, 2011-09-13 at 12:59 +0200, Michael Schnell wrote: On 09/13/2011 11:06 AM, Jonas Maebe wrote: GDB is built for supporting multiple languages. E.g., its ADA support has been much better than its C++ support for a long time (although C++ support is getting fairly good nowadays too). Unfortunately it seems to be hard (or close to impossible) to work with the g* team(s) to have gdb (or gcc) provide Object Pascal specific features :-( . An addition to Jonas answer: There was a time that the development of gdb stalled a bit. That can happen to any open source project. That had nothing to do with Object Pascal features. But now the gdb-development is on track again and those people working on it are really helpful. I think the problem lies more in the fact that a lot of Pascal developers do not know c very well. So they are not able to write patches for gdb to implement these features. That's why the idea of a debugger written in Pascal pop ups every year. But improving gdb to fix the last glitches seems to be a better approach to me. But 'we' are the ones who has to do the work. (As we should when we would build our own debugger) Joost. -- My Lazarus blog: http://www.lazarussupport.com/lazarus/weblog ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] bounty: FPC based debugger
On 09/13/2011 01:22 PM, Jonas Maebe wrote: Don't insult people when you clearly don't have any experience whatsoever in working with them. Sorry if I sounded impolite. I did not at all mean to insult them. On the contrary I praise them for their exceptional work ! I only wanted to state that it does not make much sense to try to have specific additional features included in gdb to improve it's usability with FPC. The gdb people have always been extremely helpful to Pierre, Joost and me whenever we had any questions whatsoever about how to add certain Pascal-specific functionality to gdb. And the gcc people have added a DWARF identifier for the i386 Borland calling convention in a header file that's imported by gdb so that it would be possible to add support for it to gdb (even though gcc does not support it in any way). If we could really hope for this, I would vote for a gdb extension instead of creating a completely new debugger from scratch . -Michael ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] bounty: FPC based debugger
On 13/09/2011 00:37, Jonas Maebe wrote: Maybe this will help? make.exe all OPT=-gl -gw -godwarfsets -O1 You should use -O-1 instead of -O1. The default for make all is -O2, and -O2 -O1 is the same as -O2 (it says enable -O2 optimizations and also -O1 optimizations, but -O2 already includes -O1). Wow, thanks for that tip! It's a rather important piece of information. Is it mentioned somewhere in the FPC docs? I searched the Programmers Guide but couldn't find any reference to -O- or -O-n syntax. Regards, - Graeme - -- fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] bounty: FPC based debugger
On 09/13/2011 02:09 PM, Joost van der Sluis wrote: Very well said ! Thanks, -Michael (who does a lot more ANSI C than Pascal, as this is necessary with embedded controllers.) ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] bounty: FPC based debugger
On 13 Sep 2011, at 14:43, Graeme Geldenhuys wrote: Wow, thanks for that tip! It's a rather important piece of information. Is it mentioned somewhere in the FPC docs? I searched the Programmers Guide but couldn't find any reference to -O- or -O-n syntax. -O-1 is the same as -O- -O1 (just like -vwn is the same as -vw -vn -- all single-character FPC options behave that way). -O- and -O1 are both listed in the overview of the command line options of the Programmers Guide (Appendix A). Jonas ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] bounty: FPC based debugger
On Tue, 2011-09-13 at 14:48 +0200, Michael Schnell wrote: On 09/13/2011 01:22 PM, Jonas Maebe wrote: Don't insult people when you clearly don't have any experience whatsoever in working with them. Sorry if I sounded impolite. I did not at all mean to insult them. On the contrary I praise them for their exceptional work ! I only wanted to state that it does not make much sense to try to have specific additional features included in gdb to improve it's usability with FPC. Why not? There are many already. If you want to do a full gdb-build, fpc is even a buildrequirement. ;) (This is for the gdb-testsuitem which has some fpc-tests) The gdb people have always been extremely helpful to Pierre, Joost and me whenever we had any questions whatsoever about how to add certain Pascal-specific functionality to gdb. And the gcc people have added a DWARF identifier for the i386 Borland calling convention in a header file that's imported by gdb so that it would be possible to add support for it to gdb (even though gcc does not support it in any way). If we could really hope for this, I would vote for a gdb extension instead of creating a completely new debugger from scratch . You do know that GDB does have a Pascal extension, right? Joost -- My Lazarus blog: http://www.lazarussupport.com/lazarus/weblog ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] bounty: FPC based debugger
On 13/09/2011 14:53, Jonas Maebe wrote: -O-1 is the same as -O- -O1 (just like -vwn is the same as -vw -vn -- all single-character FPC options behave that way). OK, thanks. -O- and -O1 are both listed in the overview of the command line options of the Programmers Guide (Appendix A). Correction. Users Guide, not Programmers Guide. ;-) Thanks again. Regards, - Graeme - -- fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: lazarus debug with gdb [Re: [fpc-devel] bounty: FPC based debugger]
On Mon, Sep 12, 2011 at 7:59 PM, Martin laza...@mfriebe.de wrote: On 12/09/2011 23:18, Martin wrote: However, I still recommend trunk = a lot of fixes have been applied. And if you are on windows, I recommend gdb 7.3 32bit: http://svn.freepascal.org/svn/lazarus/binaries/i386-win32/gdb/bin libraries go into the same folder as gdb. My env is: Lazarus 0.9.31 r31914 FPC 2.4.5 i386-win32-win32/win64 and FPC 2.5.1 too. I'm using GDB from: http://svn.freepascal.org/svn/fpcbuild/branches/fixes_2_4/install/binw32 and: http://svn.freepascal.org/svn/fpcbuild/branches/fixes_2_6/install/binw32 Why Lazarus uses another copy from GDB? When will be updated the GDB in svn/fpcbuild/* to 7.3? Thanks, Marcos Douglas ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] bounty: FPC based debugger
On 13/09/2011 14:48, Michael Schnell wrote: If we could really hope for this, I would vote for a gdb extension instead of creating a completely new debugger from scratch . I disagree. In the long term, I think a object pascal based debugger for FPC is the way to go - potential for much easier maintenance and coordinated releases with FPC. So I'll continue that route. At least later we will have two debuggers to choose from. :) Regards, - Graeme - -- fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] bounty: FPC based debugger
On Tue, Sep 13, 2011 at 10:10 AM, Graeme Geldenhuys graemeg.li...@gmail.com wrote: On 13/09/2011 14:48, Michael Schnell wrote: If we could really hope for this, I would vote for a gdb extension instead of creating a completely new debugger from scratch . I disagree. In the long term, I think a object pascal based debugger for FPC is the way to go - potential for much easier maintenance and coordinated releases with FPC. So I'll continue that route. At least later we will have two debuggers to choose from. :) +1 I don't know how make a debugger but is very logic have a Pascal debbuger. We have a Self-hosting, why have not a debbuger also coded in Pascal? [1] http://en.wikipedia.org/wiki/Self-hosting Marcos Douglas ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] bounty: FPC based debugger
Michael Schnell schrieb: GDB is built for supporting multiple languages. E.g., its ADA support has been much better than its C++ support for a long time (although C++ support is getting fairly good nowadays too). Unfortunately it seems to be hard (or close to impossible) to work with the g* team(s) to have gdb (or gcc) provide Object Pascal specific features :-( IMO you're addressing the wrong audience. Most things, beyond breakpoint handling, stepping and memory read/writes, can be done outside the debugger. Such external code is not bound to debugger support, and can use language specific information (RTTI...). DoDi ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] bounty: FPC based debugger
Michael Schnell schrieb: On 09/12/2011 11:16 PM, Hans-Peter Diettrich wrote: - watchpoints. break when data at memory address changed. I've seen applications crawl when such a feature was used :-( This is bound to happen unless the CPU provides support for this. It's not the CPU, it's more the MMU which can help in finding changed (global) variables. When the static data segment supports interrupts on write, a debugger only has to check whether the affected address in the watch list. Doing such checks on *every* write to memory (stack!?) requires many more lookups. Hardware support for writes to arbitrary memory addresses is restricted to very few addresses, not really useful. That's why Delphi normally checks for changed values only when a breakpoint is hit, not on every instruction. DoDi ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] bounty: FPC based debugger
Den 13-09-2011 16:52, Hans-Peter Diettrich skrev: Michael Schnell schrieb: On 09/12/2011 11:16 PM, Hans-Peter Diettrich wrote: - watchpoints. break when data at memory address changed. I've seen applications crawl when such a feature was used :-( This is bound to happen unless the CPU provides support for this. It's not the CPU, it's more the MMU which can help in finding changed (global) variables. When the static data segment supports interrupts on write, a debugger only has to check whether the affected address in the watch list. Doing such checks on *every* write to memory (stack!?) requires many more lookups. Hardware support for writes to arbitrary memory addresses is restricted to very few addresses, not really useful. How many times do you think you need more than 1-2 watchpoints? Lots of breakpoints I can understand, but I've never found many uses for watchpoints. That's why Delphi normally checks for changed values only when a breakpoint is hit, not on every instruction. That isn't really much of a watchpoint then, unless you single step. ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] bounty: FPC based debugger
On 13 Sep 2011, at 16:52, Hans-Peter Diettrich wrote: Michael Schnell schrieb: On 09/12/2011 11:16 PM, Hans-Peter Diettrich wrote: - watchpoints. break when data at memory address changed. I've seen applications crawl when such a feature was used :-( This is bound to happen unless the CPU provides support for this. It's not the CPU, it's more the MMU which can help in finding changed (global) variables. No. Debuggers sometimes fall back to this method when they run out of hardware watch points, but it has several problems: * in general, more than one variable is located on a memory page, so you'll get a huge slow down because every time some value on that page is written you get an exception and have to handle the unrelated write * on certain architectures (e.g. PowerPC), marking pages as read-only breaks atomic instructions operating on values stored in them (that can probably be worked around by even slower code, but at least in GDB it doesn't work) * you can get into trouble with system calls. Generally before a system call you have to make copies of all such pages, make them read- write again, perform the system call, and then compare all old contents with the new contents. At least on Linux several system calls do not give an error if you tell them to write their output to a read- only page, and even if they did then you wouldn't want a system call to fail just because it is trying to write to a page that is writable during a normal execution. When the static data segment supports interrupts on write, a debugger only has to check whether the affected address in the watch list. Doing such checks on *every* write to memory (stack!?) requires many more lookups. Marking a page on the stack as read-only is also bound to slow almost any program to a crawl (exceptions due to trying to write to a read- only page are not cheap). Jonas ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] bounty: FPC based debugger
On 13 September 2011 16:52, Hans-Peter Diettrich wrote: That's why Delphi normally checks for changed values only when a breakpoint is hit, not on every instruction. That makes no sense at all! A watchpoint should trigger as soon as that data referenced by some memory address changes. Then you can use the call stack to see what code changed that data. That's the whole point of watchpoints. If you only check the data at some other arbitrary breakpoint, the stack trace will be useless by the time the debugger tells you the data changed. -- Regards, - Graeme - ___ fpGUI - a cross-platform Free Pascal GUI toolkit http://fpgui.sourceforge.net ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] bounty: FPC based debugger
I agree with Joost. I've always liked the Insight GUI for gdb, and as best I know that's written in Tcl/Tk, of all things. So a FreePascal front end for gdb isn't a bad idea, and would be a great deal easier than writing a complete low-level debugger from scratch. --73-- --Jeff Duntemann Colorado Springs, Colorado On 9/13/2011 6:09 AM, Joost van der Sluis wrote: On Tue, 2011-09-13 at 12:59 +0200, Michael Schnell wrote: On 09/13/2011 11:06 AM, Jonas Maebe wrote: GDB is built for supporting multiple languages. E.g., its ADA support has been much better than its C++ support for a long time (although C++ support is getting fairly good nowadays too). Unfortunately it seems to be hard (or close to impossible) to work with the g* team(s) to have gdb (or gcc) provide Object Pascal specific features :-( . An addition to Jonas answer: There was a time that the development of gdb stalled a bit. That can happen to any open source project. That had nothing to do with Object Pascal features. But now the gdb-development is on track again and those people working on it are really helpful. I think the problem lies more in the fact that a lot of Pascal developers do not know c very well. So they are not able to write patches for gdb to implement these features. That's why the idea of a debugger written in Pascal pop ups every year. But improving gdb to fix the last glitches seems to be a better approach to me. But 'we' are the ones who has to do the work. (As we should when we would build our own debugger) Joost. ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] bounty: FPC based debugger
I see no problems with the idea of creating another debugger, especially if written in FPC. Since there're plenty of the GDB-wrappers already! And it's also a good option to support either ways: over-gdb and native. In fact, I've been planning to add GDB target into Duby, together with native targets. In the end the purpose of the Duby is to provide cross-platform debugging API, rather than a debugging application. The system part of the debugger (OS interfaces, memory access, break-points etc) is the easiest one. Imho, the hardest part is actually type information part. I.e. reading/writting variables by a debugger. Just changing a variable of string type (which can be shortsting, ansisting, widesting or unicodesting), should not be direct memory changes, but rather a function call. Is it all already in the DWARF? Add a lack of development time to all this. And it turns-out gdb is the best option available :) thanks, Dmitry P.S. Btw, there's debugging-mode flag in RTL TProcess class, even now. I'm wondering if it works at all ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] bounty: FPC based debugger
Jeppe Græsdal Johansen schrieb: Hardware support for writes to arbitrary memory addresses is restricted to very few addresses, not really useful. How many times do you think you need more than 1-2 watchpoints? Lots of breakpoints I can understand, but I've never found many uses for watchpoints. Just when I was debugging FPC itself, which uses many global variables. I ended up in turning the variables into properties, and set breakpoints in the setters. But this is not a solution, when the variables are also passed around as var parameters. DoDi ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] bounty: FPC based debugger
On Tue, Sep 13, 2011 at 10:03 PM, Paul Ishenin i...@kmiac.ru wrote: 14.09.2011 9:21, dmitry boyarintsev wrote: How would you estimate the costs of this task? Would you take it if we collect some good sum of money or do work for a full day now? It's not just 1 task. These are multiple tasks: 1) Abstract Debugging API (i.e. start debugging process, catch debugging events) - this part is done. However, I'm expecting that there're more changes required. 1.1) Win-32 implementation for the API - working. 1.2) Win-64 implementation for the API - working. 1.3) Linux-32 implementation for the API - working. 1.4) Linux-64 implementation for the API - working. 1.5) MacOSX - implementation - not working at all (kenrel man pages are not really helpful) - Jonas explained above. 1.6) GDB implementation - never started. 2) Abstract Debug Data reading API - designed and working 2.1) STABS implementation - working 2.1.1) STABS-FPC corrector? 2.2) Dwarf 2 implementation - undone (code part is copied from FPdebugger) 2.3) Dwarf 3 implementation - undone (code part is copied from FPdebugger) 2.4) PPU reader (what FPC version? all of them?) - never started. 3) Debugging Data Processor. The most interesting part of the debugger. Where the type-info is being used to read the actual data from the debugged processed, using Abstract Debugging API. Some kind of virtual machine(?!) 4) Abstract Expression Source API - a component that would handle user evaluation expression. The result of user evaluation should some kind of instruction-list handled by the Debugging Data Processor. 4.1) Object Pascal syntax parsing implementation. 4.x) ...any other languages?... working - means - it worked for me. Never thoroughly tested or used. That's all i have in my mind. Any other additional debugging features can be built on top of this 4 core parts. The development can be paralleled, so I'd expect the team of 4 people working 4 hours a day on the project would be able to show some good results in 6 months. My current employment keeps me off open sourcing - no time at all! :( I would even grand leader rights for the duby project to anyone else. thanks, Dmitry P.S.: as Graeme noted above, I really don't want to make FPC-debugger, it should be a debugger with the primary FPC-support. I.e. part 2.1 shouldn't rely on FPC implementation of Stabs, but there're should be an additional plugin for FPC-generated Stabs - 2.1.1, that is to be used if FPC executable detected. ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] bounty: FPC based debugger
On 2011-09-12 09:08, Graeme Geldenhuys wrote: Hi, Speaking of the subject in another thread, and to show the desire I have to finding a solution to this [what I consider a very serious] problem FPC needs its own debugger! GDB is just rubbish when it comes to the Object Pascal language. Also if FPC had it's own debugger, the time it would take developers to benefit from new debugger features, would be much quicker that it currently takes with GDB. If anybody with the know how is interested in implementing a Object Pascal based debugger (or extending Duby specifically for use with FPC), please let me know. I am more than willing to pay a few hundred US dollars (or Euros) towards this bounty. So consider this an official bounty. If others want to add to this bounty, you are more than welcome. Regards, - Graeme - I can +1 this post and add that my company is also willing to add a few hundred Euros to this bounty. I really miss the easy use of the Delphi debugger from D7. Especially the live inspection of object during single step of the code. Perhaps you Graeme will add this bounty to the wiki: http://wiki.freepascal.org/Bounties You can put me down as EpiData Association, with (at least) 250€. Kind regards, Torsten Bonde Christiansen. ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] bounty: FPC based debugger
Graeme Geldenhuys schrieb: If anybody with the know how is interested in implementing a Object Pascal based debugger (or extending Duby specifically for use with FPC), please let me know. I am more than willing to pay a few hundred US dollars (or Euros) towards this bounty. I'd add another 100€ for reasonable debugging support in Lazarus :-) DoDi ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] bounty: FPC based debugger
On 12/09/2011 08:47, Torsten Bonde Christiansen wrote: I really miss the easy use of the Delphi debugger from D7. Especially the live inspection of object during single step of the code. In that case you (all involved) better specify the required features. The debugger itself (in my understanding) can either have a library-like interface or command-line driven or both. Representing the data in an object-inspector-like format (I guess that is what you mean) is part of a debugger frontend (such as is included in Lazarus). And btw, Lazarus does have an Debug inspector (context menu: Debug Inspect or alt-F5) = So it appears it doesn't correctly refresh. Nor does it allow to unfold [+] any sub-classes. ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] bounty: FPC based debugger
On 09/12/2011 12:18 PM, Hans-Peter Diettrich wrote: I'd add another 100€ for reasonable debugging support in Lazarus :-) Could you generate a wish-List ? -Michael ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] bounty: FPC based debugger
On 12/09/2011 11:43, Martin wrote: The debugger itself (in my understanding) can either have a library-like interface or command-line driven or both. Duby already has both (in rudimentary form). At this point I will be fine with a command-line debugger only, that can actually debug my code. Integration in a IDE (eg: like the GDB-MI interface) can come later. Duby even has instruction on how to integrate itself with Lazarus IDE, but I have never been able to get that to work for whatever reason. I've only used Duby from the command-line interface. Just being able to debug your code without requiring writeln() or log-to-file statements, would already be a 100x better than what we currently have. Here is what I would consider a debugger: - command line interface at least - watches - breakpoints - expression handling with break points would be very handy. eg: break when i = 1234 - watchpoints. break when data at memory address changed. Very handy to debug those procedural programs that loves to use global variables. MSEide supports this (but it is actually a GDB feature) - querying variables, properties, arrays, strings. Irrespective if things like variables are local, global, or if parameters are from a nested function, method, event handler. Querying properties of a class instance (like can be done in Delphi for years) is very important (irrespective of the potential dangers in that). - Object Pascal expression evaluation (but I guess this goes hand-in-hand with Watches and Breakpoints. Yes I know there are many other items than can be added (thread debugging, remote debugging etc), but I would consider the above features a usable debugger with FPC. Regards, - Graeme - -- fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] bounty: FPC based debugger
On 12/09/2011 11:10, Graeme Geldenhuys wrote: Here is what I would consider a debugger: - command line interface at least - watches since lazarus displays watches, using gdb, maybe this should be more specific? - Yes, certain expressions are not supported, or not well supported. -- strings: 0 vs 1 base = need to test with stabs 3 = need to adapt some part of Lazarus to deal with gdb output when using stabs3 -- properties: discussed before -- dyn-arrays: lazarus deals with simple cases, but by far not with all -- please add? - breakpoints - expression handling with break points would be very handy. eg: break when i = 1234 Lazarus does support conditional expressions. And they do work, I have used them - watchpoints. break when data at memory address changed. Very handy to debug those procedural programs that loves to use global variables. MSEide supports this (but it is actually a GDB feature) Yes indeed. Btw, i have used them a few times in Lazarus. they are on the todo list Though to use them in Lazarus, quite a few hacks are required. The big issue, is that gdb often scopes them wrong, and you loose the watch point before you it triggers - querying variables, properties, arrays, strings. Irrespective if things like variables are local, global, or if parameters are from a nested function, method, event handler. Querying properties of a class instance (like can be done in Delphi for years) is very important (irrespective of the potential dangers in that). That is a repeat of watches ? - Object Pascal expression evaluation (but I guess this goes hand-in-hand with Watches and Breakpoints. Yes I know there are many other items than can be added (thread debugging, remote debugging etc), but I would consider the above features a usable debugger with FPC. ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] bounty: FPC based debugger
Martin wrote: On 12/09/2011 08:47, Torsten Bonde Christiansen wrote: I really miss the easy use of the Delphi debugger from D7. Especially the live inspection of object during single step of the code. In that case you (all involved) better specify the required features. The debugger itself (in my understanding) can either have a library-like interface or command-line driven or both. Allowing that gdb is implemented over a wide variety of CPUs and OSes, I wonder whether it would make more sense to adopt libgdb than writing something from scratch? I've managed to compile this and incorporate it into the fp IDE for a number of Linux platforms, with the exception of ARM which was problematic. I can't remember the extent to which I've tried for Windows and Solaris. -- Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues] ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] bounty: FPC based debugger
12.09.2011 11:08, Graeme Geldenhuys: [...] If anybody with the know how is interested in implementing a Object Pascal based debugger (or extending Duby specifically for use with FPC), please let me know. I am more than willing to pay a few hundred US dollars (or Euros) towards this bounty. I'd also happily contribute $300 or so (in case there is a reasonable chance to actually get it working at least on windows/linux/bsd) However, the effort needed is probably much much more expensive (Supposedly some pretty skilled developer(s) would have to work hard for several months, therefore it would then cost several thousands $ or more...) Nikolai So consider this an official bounty. If others want to add to this bounty, you are more than welcome. Regards, - Graeme - ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] bounty: FPC based debugger
On Monday 12 September 2011 12:23:44 Martin wrote: - watchpoints. break when data at memory address changed. Very handy to debug those procedural programs that loves to use global variables. MSEide supports this (but it is actually a GDB feature) Yes indeed. Btw, i have used them a few times in Lazarus. they are on the todo list Though to use them in Lazarus, quite a few hacks are required. The big issue, is that gdb often scopes them wrong, and you loose the watch point before you it triggers MSEide has popup menu functions 'Address Watchpoint 8', 'Address Watchpoint 16', 'Address Watchpoint 32' and 'Address Watchpoint 64' in watch window in order to prevent gdb from dropping the watchpoint. Martin ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] bounty: FPC based debugger
On 12/09/2011 11:51, Martin Schreiber wrote: The big issue, is that gdb often scopes them wrong, and you loose the watch point before you it triggers MSEide has popup menu functions 'Address Watchpoint 8', 'Address Watchpoint 16', 'Address Watchpoint 32' and 'Address Watchpoint 64' in watch window in order to prevent gdb from dropping the watchpoint. ah, yes I was planning on doing the same thing ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] bounty: FPC based debugger
On Monday 12 September 2011 12:45:40 Nikolai Zhubr wrote: 12.09.2011 11:08, Graeme Geldenhuys: [...] If anybody with the know how is interested in implementing a Object Pascal based debugger (or extending Duby specifically for use with FPC), please let me know. I am more than willing to pay a few hundred US dollars (or Euros) towards this bounty. I'd also happily contribute $300 or so (in case there is a reasonable chance to actually get it working at least on windows/linux/bsd) However, the effort needed is probably much much more expensive (Supposedly some pretty skilled developer(s) would have to work hard for several months, therefore it would then cost several thousands $ or more...) True. And maintaining all platforms is a fulltime job too. And a FPC only debugger can not debug linked c libraries which we can do currently with gdb. And think of the remote debugging options gdb provides with many targets. Martin ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] bounty: FPC based debugger
On 12/09/11 12:00, Martin Schreiber wrote: And a FPC only debugger can not debug linked c libraries which we can do Good point. I've found this very handy in the past. currently with gdb. And think of the remote debugging options gdb provides with many targets. Another one very handy for embedded developers. Henry ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] bounty: FPC based debugger
On 09/12/2011 12:10 PM, Graeme Geldenhuys wrote: - watchpoints. break when data at memory address changed. Very handy to debug those procedural programs that loves to use global variables. MSEide supports this (but it is actually a GDB feature) Ooops. (Without hardware support) This would need the debugger to run the program completely in single step mode and after each step check the condition. - Object Pascal expression evaluation A think object pascal expression evaluator software is available in Pascal source code so this should be doable. -Michael ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] bounty: FPC based debugger
On Monday 12 September 2011 13:08:31 Michael Schnell wrote: On 09/12/2011 12:10 PM, Graeme Geldenhuys wrote: - watchpoints. break when data at memory address changed. Very handy to debug those procedural programs that loves to use global variables. MSEide supports this (but it is actually a GDB feature) Ooops. (Without hardware support) This would need the debugger to run the program completely in single step mode and after each step check the condition. gdb uses hardware watchpoint support if available. Martin ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] bounty: FPC based debugger
On 12/09/2011 13:00, Martin Schreiber wrote: True. And maintaining all platforms is a fulltime job too. Maintenance should be MUCH less work than the initial implementation. So I don't consider this too a big problem. FPC doesn't change that radically that often. And a FPC only debugger can not debug linked c libraries which we can do Then use GDB for such cases. currently with gdb. And think of the remote debugging options gdb provides with many targets. As I mentioned, there are many additional features that could be added to a debugger. But for an initial implementation, I think what I listed should suffice to most often used cases. GDB wasn't developer overnight, neither would a FPC debugger. But that is no reason, not to implement one. Regards, - Graeme - -- fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] bounty: FPC based debugger
12.09.2011 15:01, Henry Vermaak: On 12/09/11 12:00, Martin Schreiber wrote: And a FPC only debugger can not debug linked c libraries which we can do Good point. I've found this very handy in the past. currently with gdb. And think of the remote debugging options gdb provides with many targets. Another one very handy for embedded developers. Well maybe this could be resolved by allowing to select either gdb or another hypothetical debugger at runtime, if designed as kind of plugin. No feature loss would then happen, compared to current state. That would be even more work, though :( Nikolai Henry ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] bounty: FPC based debugger
12.09.2011 19:00, Martin Schreiber wrote: True. And maintaining all platforms is a fulltime job too. And a FPC only debugger can not debug linked c libraries which we can do currently with gdb. And think of the remote debugging options gdb provides with many targets. As I understand the plan is to create a new debugger without destroying what we already have with gdb. At the moment Lazarus allows to write debugger plugins. When the new debugger is ready the new plugin should be written. As result you should be able to debug linked c libraries as before with gdb and to debug other code with the new debugger. Best regards, Paul Ishenin. ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] bounty: FPC based debugger
On Monday 12 September 2011 13:12:11 Graeme Geldenhuys wrote: On 12/09/2011 13:00, Martin Schreiber wrote: True. And maintaining all platforms is a fulltime job too. Maintenance should be MUCH less work than the initial implementation. So I don't consider this too a big problem. FPC doesn't change that radically that often. The platforms change too. :-) Martin ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] bounty: FPC based debugger
On 12/09/2011 12:45, Nikolai Zhubr wrote: I'd also happily contribute $300 or so (in case there is a reasonable chance to actually get it working at least on windows/linux/bsd) However, the effort needed is probably much much more expensive Well, considering the about of people that are already willing to contribute money towards the bounty, a reasonable sum of money should be on offer in the end. The many responses also clearly indicate the demand for a working debugger. Regards, - Graeme - -- fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] bounty: FPC based debugger
On Monday 12 September 2011 13:16:58 Graeme Geldenhuys wrote: On 12/09/2011 12:45, Nikolai Zhubr wrote: I'd also happily contribute $300 or so (in case there is a reasonable chance to actually get it working at least on windows/linux/bsd) However, the effort needed is probably much much more expensive Well, considering the about of people that are already willing to contribute money towards the bounty, a reasonable sum of money should be on offer in the end. ??? EUR 100'000..200'000? Really? Martin ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] bounty: FPC based debugger
On Monday 12 September 2011 13:16:21 Paul Ishenin wrote: 12.09.2011 19:00, Martin Schreiber wrote: True. And maintaining all platforms is a fulltime job too. And a FPC only debugger can not debug linked c libraries which we can do currently with gdb. And think of the remote debugging options gdb provides with many targets. As I understand the plan is to create a new debugger without destroying what we already have with gdb. At the moment Lazarus allows to write debugger plugins. When the new debugger is ready the new plugin should be written. As result you should be able to debug linked c libraries as before with gdb and to debug other code with the new debugger. I think it is better to invest time into gdb support instead into a FPC debugger which probably never will reach a usable state. Martin ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] bounty: FPC based debugger
On 12/09/2011 13:32, Martin Schreiber wrote: I think it is better to invest time into gdb support instead into a FPC debugger which probably never will reach a usable state. [sarcasm on] With that attitude the same could be applied to MSEide, MSEgui and fpGUI too. Why did we bother investing time and effort into developing such frameworks or IDE's, when the should rather have invested our time in Lazarus?? Then again, why did somebody invest in FPC when we could simply have used the de-facto standard Object Pascal compiler - Delphi, stick to Windows (which covers 90% of the market). [sarcasm off] Regards, - Graeme - -- fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] bounty: FPC based debugger
On 12/09/2011 13:30, Martin Schreiber wrote: ??? EUR 100'000..200'000? Really? Yes, we all know your rates a much higher than others - so we will not ask you to do the work. Regards, - Graeme - -- fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] bounty: FPC based debugger
On Monday 12 September 2011 13:36:43 Graeme Geldenhuys wrote: On 12/09/2011 13:32, Martin Schreiber wrote: I think it is better to invest time into gdb support instead into a FPC debugger which probably never will reach a usable state. [sarcasm on] With that attitude the same could be applied to MSEide, MSEgui and fpGUI too. Why did we bother investing time and effort into developing such frameworks or IDE's, when the should rather have invested our time in Lazarus?? Then again, why did somebody invest in FPC when we could simply have used the de-facto standard Object Pascal compiler - Delphi, stick to Windows (which covers 90% of the market). [sarcasm off] True. And because we know what it means to develop something new from scratch and because I know that I don't want to invest several years into development of a FPC debugger and because we know that there are not so many people who can make such a development and are able to *finish* the project I suggest to concentrate on gdb. Martin ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] bounty: FPC based debugger
12.09.2011 19:36, Graeme Geldenhuys wrote: On 12/09/2011 13:32, Martin Schreiber wrote: I think it is better to invest time into gdb support instead into a FPC debugger which probably never will reach a usable state. [sarcasm on] With that attitude the same could be applied to MSEide, MSEgui and fpGUI too. Why did we bother investing time and effort into developing such frameworks or IDE's, when the should rather have invested our time in Lazarus?? I also want to know. Imo, you are loosing your time :) Best regards, Paul Ishenin. ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] bounty: FPC based debugger
On 12/09/2011 13:49, Martin Schreiber wrote: True. And because we know what it means to develop something new from scratch and because I know that I don't want to invest several years into development of a FPC debugger and because we know that there are not so many people who Please have a look at some of the Google Summer of Code projects. Some people can do amazing things in a fraction of the time it takes others. Oh, and they [Google Summer of Code entrants] don't get paid hundreds of thousands of euros for their work either. So how much did you benefit from the FPC project so far? And how much did you pay for FPC? Oh. Never thought of contributing back, have you? can make such a development and are able to *finish* the project I suggest to concentrate on gdb. Fine, so we all now know that YOU are not interested in the project, so lets leave it at that. In the mean time, I'll just continue the work in my little spare time I have, so maybe some day at least one person can benefit from it. I just thought, by offering a bounty, the work could possibly be done in a fraction of the time than what it would take me. My thoughts was that if it was written in Object Pascal, more people [in the FPC community] might be able to contribute and help here and there, just like what is done in FPC, Lazarus, fpGUI etc. Regards, - Graeme - -- fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] bounty: FPC based debugger
On 12 Sep 2011, at 12:23, Martin wrote: The big issue, is that gdb often scopes them wrong, and you loose the watch point before you it triggers If you use an expression in a watch point, gdb will reevaluate that expression if a value used in the watch expression changes. Since in general you don't want that, you can take the address of the watched value once when the watchpoint is enabled and then put a watchpoint on that calculated address (similar to what Martin Schreiber said). Jonas ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] bounty: FPC based debugger
On 12/09/2011 13:07, Graeme Geldenhuys wrote: On 12/09/2011 13:49, Martin Schreiber wrote: True. And because we know what it means to develop something new from scratch and because I know that I don't want to invest several years into development of a FPC debugger and because we know that there are not so many people who Please have a look at some of the Google Summer of Code projects. Some people can do amazing things in a fraction of the time it takes others. Oh, and they [Google Summer of Code entrants] don't get paid hundreds of thousands of euros for their work either. So how much did you benefit from the FPC project so far? And how much did you pay for FPC? Oh. Never thought of contributing back, have you? I think Greame, that is not very well worded. Whatever you attempted to express... I believe that Martin Schreiber has contributed back quite well. By providing an excellent IDE, he helps spreading fpc. And that is a huge contribution. ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] bounty: FPC based debugger
On 12/09/2011 14:07, Paul Ishenin wrote: I also want to know. Imo, you are loosing your time :) [off-topic: so this will be my last public response to this] No, fpGUI has now reached a point where I can knock out apps in a fraction of the time it took me 5 years ago. Also those apps are considerably more stable and consistent across platforms than what Lazarus could offer. So the time was well spent - and I enjoyed it! :) Regards, - Graeme - -- fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] bounty: FPC based debugger
On 09/12/2011 01:15 PM, Martin Schreiber wrote: gdb uses hardware watchpoint support if available. That seems hard to beat when doing a new multi-arch debugger -Michael ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] bounty: FPC based debugger
On 12/09/2011 13:11, Jonas Maebe wrote: On 12 Sep 2011, at 12:23, Martin wrote: The big issue, is that gdb often scopes them wrong, and you loose the watch point before you it triggers If you use an expression in a watch point, gdb will reevaluate that expression if a value used in the watch expression changes. Since in general you don't want that, you can take the address of the watched value once when the watchpoint is enabled and then put a watchpoint on that calculated address (similar to what Martin Schreiber said). Yes, I know that, and done that too. BTW, another issue with watchpoint is, that gdb 9latest tested with 7.2, need to test 7.3) warns you to late = actually applies to any breakpoint that can not be set) If you have more watchpoints than gdb can set (or any other breakpoint fails the following happens (depends on gdbn version) [gdb paused] - inserting watch abnd breakpoints] - send step or run command [ gdb will print warnings / not error] [gdb will step or partly step] - send step or run command again [gdb will give an error, about the watch/breakpoints] on that first partly step, something could have happen to the watched value... I need to see if that is fixed in gdb 7.3 ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] bounty: FPC based debugger
On Monday 12 September 2011 14:20:06 Michael Schnell wrote: On 09/12/2011 01:15 PM, Martin Schreiber wrote: gdb uses hardware watchpoint support if available. That seems hard to beat when doing a new multi-arch debugger Correct. :-) Martin ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] bounty: FPC based debugger
12.09.2011 15:08, Graeme Geldenhuys wrote: So consider this an official bounty. If others want to add to this bounty, you are more than welcome. I suggest to create a wiki page with: 1) at least brief specification 2) a list of sponsors 3) a list of jury members 4) acceptance criteria Best regards, Paul Ishenin. ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] bounty: FPC based debugger
- Graeme Geldenhuys graemeg.li...@gmail.com schreef: On 12/09/2011 13:30, Martin Schreiber wrote: ??? EUR 100'000..200'000? Really? Yes, we all know your rates a much higher than others - so we will not ask you to do the work. Graeme, I think you underestimate the work required when doing it from scratch (or from Duby, which, from what I can see hasn't released anything to tinker with yet on their sf.net page). That said, even when I think of the entry-level programming fee (no freelance/consultant) a professional developer gets a month in my country (Belgium), and divided by 20 to get a daily fee from it, it still is 125 euro before taxes etc (after which you have about 3/5 left). When you take into account the black market or undeclared sidejob as opposed to hobby, that could go down to 50 or so. But still, it would take quite some more effort than a few 1000 euro's in manhours, especially for those programmers with experience (whom have a higher cost ofcourse). I don't disagree with the need for a prime debugger, nor with the amounts of bounty everyone is offering, just with the statements above. kind regards, Dimitri Smits ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] bounty: FPC based debugger
On 12/09/2011 14:57, Dimitri Smits wrote: I don't disagree with the need for a prime debugger, nor with the amounts of bounty everyone is offering, just with the statements above. I still stand with my statement that it will NOT cost 100,000 - 200,000 euros to get a basic working debugger! Then you should also keep an open mind that this is an open-source project - thus costs are generally much lower to commercial counterparts. Why, because it is often done part-time with no or little time constraints, by developers that love to improve open-source software. It's for the love of programming, not just to get rich. Then also deduct the cost you saved from getting FPC and its stacks of tools, components and high quality documentation for FREE. Embarcadero will charge you $3500 for something similar, but which lacks in many other areas compared to Free Pascal. Not to mention that EMB forces you to re-purchase a new version/upgrade after every release - roughly once every 12-18 months. It's simple really. If nobody is interested, that is fine too! I'll continue my efforts either way, albeit much slower than somebody that has more free time than I, or that is more experienced in the subject than I. It's a great learning experience for me already, so I don't consider my time waisted so far. Regards, - Graeme - -- fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] bounty: FPC based debugger
Michael Schnell schrieb: On 09/12/2011 12:18 PM, Hans-Peter Diettrich wrote: I'd add another 100€ for reasonable debugging support in Lazarus :-) Could you generate a wish-List ? For now: see my notes on Graeme's wish list. I haven't been debugging for a while, because it mostly ended up in frustration and adding DebugLn's and other hacks to the code :-( DoDi ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] bounty: FPC based debugger
Graeme Geldenhuys schrieb: Here is what I would consider a debugger: - command line interface at least Me: GUI interface at least. Where GUI is not a special property of the interface, only a set of (callback) procedures that allow to implement desired language-specific display features, regardless of GUI or Console display and use. - watches +1 - breakpoints - expression handling with break points would be very handy. eg: break when i = 1234 Nice to have, but I could live without this. - watchpoints. break when data at memory address changed. Very handy to debug those procedural programs that loves to use global variables. MSEide supports this (but it is actually a GDB feature) Again I could live without it, depending on the time required to determine such changes. I've seen applications crawl when such a feature was used :-( - querying variables, properties, arrays, strings. Irrespective if things like variables are local, global, or if parameters are from a nested function, method, event handler. Querying properties of a class instance (like can be done in Delphi for years) is very important (irrespective of the potential dangers in that). +1 (as far as calling getters can be avoided, somehow). - Object Pascal expression evaluation (but I guess this goes hand-in-hand with Watches and Breakpoints. Nice to have. Another wish: separation of debug info and debug code. Currently I can't step into packages or FCL/RTL, without compiling these first for debugging. But doing so puts in all the debug code (output...), residing in the units. What I want is a dedicated option, that provides everything required to debug the entire application, without enabling special {$IFDEF DEBUG} code. Or did I simply miss something already existing? DoDi ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] bounty: FPC based debugger
Paul Ishenin schrieb: 12.09.2011 19:00, Martin Schreiber wrote: True. And maintaining all platforms is a fulltime job too. And a FPC only debugger can not debug linked c libraries which we can do currently with gdb. And think of the remote debugging options gdb provides with many targets. As I understand the plan is to create a new debugger without destroying what we already have with gdb. At the moment Lazarus allows to write debugger plugins. When the new debugger is ready the new plugin should be written. My wishes don't call for an new (platform dependent) debugger, I only want *better* high-level (language specific) support in Lazarus. Finally I want to debug applications, not an new debugger with different behaviour and restrictions on every platform ;-) In so far I'm not very interested in commandline and remote debugging, when these discourage the use of an already existing debugger (gdb...). DoDi ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
lazarus debug with gdb [Re: [fpc-devel] bounty: FPC based debugger]
cced lazarus On 12/09/2011 22:51, Hans-Peter Diettrich wrote: Paul Ishenin schrieb: 12.09.2011 19:00, Martin Schreiber wrote: True. And maintaining all platforms is a fulltime job too. And a FPC only debugger can not debug linked c libraries which we can do currently with gdb. And think of the remote debugging options gdb provides with many targets. As I understand the plan is to create a new debugger without destroying what we already have with gdb. At the moment Lazarus allows to write debugger plugins. When the new debugger is ready the new plugin should be written. My wishes don't call for an new (platform dependent) debugger, I only want *better* high-level (language specific) support in Lazarus. Finally I want to debug applications, not an new debugger with different behaviour and restrictions on every platform ;-) In so far I'm not very interested in commandline and remote debugging, when these discourage the use of an already existing debugger (gdb...). Best to list individual issues. If told it should work, then the best is to provide little test apps, that demonstrate the issue. See my notes on hints in the other mail though. However, I still recommend trunk = a lot of fixes have been applied. Known issues are : - properties with getter. - strings 0 versus 1 based (I do hope to test with dwarf3 soon, but no idea yet, if it will help...) - dyn array, element access in deeply nested pascal expression (simple cases are normally handled) - dyn array: not possible to see the entire list. ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] bounty: FPC based debugger
On 12/09/2011 22:16, Hans-Peter Diettrich wrote: Another wish: separation of debug info and debug code. Currently I can't step into packages or FCL/RTL, without compiling these first for debugging. But doing so puts in all the debug code (output...), residing in the units. What I want is a dedicated option, that provides everything required to debug the entire application, without enabling special {$IFDEF DEBUG} code. Or did I simply miss something already existing? I do not know if it helps. Never had an issue with any of those debug stuff you mention. But how to you build fpc? Maybe this will help? make.exe all OPT=-gl -gw -godwarfsets -O1 ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] bounty: FPC based debugger
On 13 Sep 2011, at 00:31, Martin wrote: Maybe this will help? make.exe all OPT=-gl -gw -godwarfsets -O1 You should use -O-1 instead of -O1. The default for make all is -O2, and -O2 -O1 is the same as -O2 (it says enable -O2 optimizations and also -O1 optimizations, but -O2 already includes -O1). Jonas___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: lazarus debug with gdb [Re: [fpc-devel] bounty: FPC based debugger]
On 12/09/2011 23:18, Martin wrote: However, I still recommend trunk = a lot of fixes have been applied. And if you are on windows, I recommend gdb 7.3 32bit: http://svn.freepascal.org/svn/lazarus/binaries/i386-win32/gdb/bin libraries go into the same folder as gdb. 64 bit = not yet updated. Debugging on win64 bit is not yet that good ( though if you get yourself the latest gdb, and use fpc trunk, it may even work) Otherwise I recommend at least gdb 7.x Though version 6.7.5 and 6.8.3 seem to work too for many cases ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel