Thread: Porting from VC6 to Linux Fedora core 5

  1. #16
    Crazy Fool Perspective's Avatar
    Join Date
    Jan 2003
    Location
    Canada
    Posts
    2,640
    >So, what is the good and effective debugging?


    Compile with the -g flag and run gdb (or a GUI interface to gdb like DDD or Eclipse's CDT) on the executable.

  2. #17
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    > So, what is the good and effective debugging?
    For memory debugging, using the tools I suggested. Test as you go, so that you spot early on any overwrites or memory leaks.

    Also consider tools like lint which perform static analysis on the code to spot bugs.

    For memory allocations, try and create wrapper functions to allocate, extend and free, and very carefully debug them in isolation before integrating them into the main project.
    Also, keep such code very simple - it's all too easy to outsmart yourself when dynamically allocating and freeing stuff.

    For example, I often allocate memory then go and figure out all the places where the free should happen, and make sure it does before complicating matters further.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #18
    In the Land of Diddly-Doo g4j31a5's Avatar
    Join Date
    Jul 2006
    Posts
    476
    I used KDevelop with GDB debugger. What I did in debugging was only looking at the values of each variables. I didn't even use assert and try-catch-throw whatsoever. I don't have any experience with them. Maybe that's one of my faults.

    So, when the debugger showed the memory allocation or any assembly lines, I don't know how to read them. That's one more of my weaknesses. Can you help me understand them?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Porting to Linux?
    By cpjust in forum C Programming
    Replies: 3
    Last Post: 10-18-2007, 05:46 PM
  2. wxWidgets, porting from Linux to PDA
    By BobS0327 in forum Tech Board
    Replies: 0
    Last Post: 05-16-2006, 08:25 AM
  3. Replies: 1
    Last Post: 10-18-2005, 10:20 AM
  4. gcc problems with Fedora Core 3
    By phldml3 in forum C Programming
    Replies: 4
    Last Post: 06-11-2005, 12:34 AM
  5. Porting the NES emulator from DOS to Linux
    By billholm in forum Game Programming
    Replies: 14
    Last Post: 08-03-2002, 01:48 AM