Results 1 to 4 of 4

Thread: Linux and wine as great debugging aids

  1. #1

    Linux and wine as great debugging aids

    You may think your code is fine, and it may even work, but how could you know there are no horrible blunders under the hood, waiting for the next version of Windows to awaken like a hung over Chthulhu pissed at noisy neighbors?
    Well, porting your project to Linux is one way to ensure there are no such horrors lying in wait.

    In this particular case, I was calling TCriticalSection.Leave twice. Windows swallowed it. Linux...? Bam! EInOutError.

    Even if you can't/won't port to Linux, there is wine . Many instances of crap code that manage to work in real Windows (which is too too forgiving) crash and burn when launched in wine. Critical sections are one example, yes.

    I learned all of that the hard way, heh.

  2. #2
    PGDCE Developer de_jean_7777's Avatar
    Join Date
    Nov 2006
    Location
    Bosnia and Herzegovina (Herzegovina)
    Posts
    243
    Indeed. Porting to linux showed me a lot of hidden bugs that worked fine in windows. It's also worth to valgrind the heck out of your program.
    In defeat we learn.

  3. #3
    Another great linux tool that helps a lot is oprofile sampling profiler. I wasn't able to find any working* profiler for 64bit FPC programs on windows, so I profile under Linux all the time.

    * sampling + properly loads symbols from debug info

  4. #4
    Also Linux recover from segment violations better than Windows (later Windows seems to recover better than older ones, but they still do weird things after a few segment violations [I didn't use Wind10 yet]).

    Fun fact: When I began programming on Windows 3.1 it was so common to break it with a segment violation (I used C only in those days) that it was quite hard to work with. Then I discovered OS/2 run Windows 3.1 programs in a similar way Wine does on Linux (actually Wine started with code from the OS/2-Windows compatability layer) so I used OS/2 because it was really unbreackable (I've never seen an OS/2 Warp or later blocked. Never). Only when the program was complete and debugged I moved it to Windows 3.1 to see if it worked, and it did always.

    The OS/2-Windows compatability was so good and OS/2 was so stable that even bugged programs that didn't work on Win3.1 worked on OS/2 (f.e. Win3.0 or Win2.0 with compatability problems).
    Last edited by Ñuño Martínez; 08-05-2017 at 11:13 AM.
    No signature provided yet.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Comodo SSL