Menu

#111 Debugger difficult to use and seems to malfunction at times

None
fixed
Debugger (3)
2014-07-22
2014-03-05
SilverNexus
No

As I've been debugging a C program in Dev-C++, I've found the debugger has a few quirks.

  1. If the first value of a watched structure is another structure, the value for the watch on the outer structure looks like this:
    {knights = {playing = 0x0;
    Additionally, any members of the inner structure beyond the first are displayed on the level equivalent of a member of the outer structure.

  2. The value of a variable does not seem to necessarily align with the value it has.
    For example, this line:
    file = settings.path_to_knights_ai;
    Both file and settings.path_to_knights_ai are of type char *. file is initialized to a null reference.
    The debugger tells me "settings.path_to_knights_ai = 0x6010c8 'knight_ai.txt'"
    Yet, after the pointer assignment, file = 0x0;
    Theoretically, this assignment should copy the address stored in settings.path_to_knights_ai to file, but it does not seem to occur. I'm not totally sure if this is the debugger, the compiler, or my computer going insane.

  3. Every time you step forward a line in the debugger, watched variables will collapse all members of any structure, leaving only the outermost structure visible until the user expands the structure once again. This behavior is annoying and makes it far more difficult to pinpoint any particular issue, since the variable watch is consistently distracting the debugger from focusing on the bug, since they have to expand any structures again to see if any variables have changed.

If anyone can prove on any of these that I'm just doing something wrong, I would greatly appreciate the workarounds/fixes anyone has to offer.

Version: 5.6.1 TDM-GCC Portable
OS Version: Windows 7 Professional 64-bit (build 7600)
Error Reported: The debugger seems unstable.
Stack Trace: None in particular. This isn't an error report like the last one I did (Ticket #110), but more an unstable application piece report.
Steps needed to reproduce the problem: Compile a project with debugging info, and run the debugger. #1 needs a structure with another structure as its first member, then a watch on the outer structure is made; #3 needs a structure to be watched and the "Next line" debugging command to be used (either F7 or the button on the Debug tab). #2 seems to occur consistently in my application in the place indicated, but I'm not sure how to reproduce it.

1 Attachments

Discussion

  • SilverNexus

    SilverNexus - 2014-03-05
    • summary: Debgguer difficult to use and seems to malfunction at times --> Debugger difficult to use and seems to malfunction at times
    • Milestone: -->
     
  • SilverNexus

    SilverNexus - 2014-03-07

    Actually, it appears as though issue #1 applies to any member that appears first in the structure, not just another structure.

    Also, the image for Ticket #112 from the OP has this issue, although that wasn't the point of the ticket.

    The issue in #2 seems to have gone away, so that may have been a compiler error, not the debugger.

     
  • SilverNexus

    SilverNexus - 2014-03-07
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -4,13 +4,13 @@
     *{knights = {playing = 0x0;*
     Additionally, any members of the inner structure beyond the first are displayed on the level equivalent of a member of the outer structure.
    
    -2. The value of a variable does not seem to necessarily align with the value it has.
    +2. <s>The value of a variable does not seem to necessarily align with the value it has.
     For example, this line:
     *file = settings.path_to_knights_ai;*
     Both file and settings.path_to_knights_ai are of type char *. file is initialized to a null reference.
     The debugger tells me "settings.path_to_knights_ai = 0x6010c8 'knight_ai.txt'"
     Yet, after the pointer assignment, file = 0x0;
    -Theoretically, this assignment should copy the address stored in settings.path_to_knights_ai to file, but it does not seem to occur. I'm not totally sure if this is the debugger, the compiler, or my computer going insane.
    +Theoretically, this assignment should copy the address stored in settings.path_to_knights_ai to file, but it does not seem to occur. I'm not totally sure if this is the debugger, the compiler, or my computer going insane.</s>
    
     3. Every time you step forward a line in the debugger, watched variables will collapse all members of any structure, leaving only the outermost structure visible until the user expands the structure once again. This behavior is annoying and makes it far more difficult to pinpoint any particular issue, since the variable watch is consistently distracting the debugger from focusing on the bug, since they have to expand any structures again to see if any variables have changed.
    
    @@ -20,4 +20,4 @@
     OS Version: Windows 7 Professional 64-bit (build 7600)
     Error Reported: The debugger seems unstable.
     Stack Trace: None in particular. This isn't an error report like the last one I did (Ticket #110), but more an unstable application piece report.
    -Steps needed to reproduce the problem: Compile a project with debugging info, and run the debugger. #1 needs a structure with another structure as its first member, then a watch on the outer structure is made; #3 needs a structure to be watched and the "Next line" debugging command to be used (either F7 or the button on the Debug tab). #2 seems to occur consistently in my application in the place indicated, but I'm not sure how to reproduce it.
    +Steps needed to reproduce the problem: Compile a project with debugging info, and run the debugger. #1 needs a structure with another structure as its first member, then a watch on the outer structure is made; #3 needs a structure to be watched and the "Next line" debugging command to be used (either F7 or the button on the Debug tab). <s>#2 seems to occur consistently in my application in the place indicated, but I'm not sure how to reproduce it.</s>
    
     
  • orwelldevcpp

    orwelldevcpp - 2014-03-11
    • status: open --> pending
    • assigned_to: orwelldevcpp
     
  • orwelldevcpp

    orwelldevcpp - 2014-03-11

    1) This problem should be fixed as of the version included in the attachment.
    2) You seem to have that sorted out. Great.
    3) I have changed the behaviour to always expand everything when updating. Given enough time, I'll implement expansion state persistence.

     
  • SilverNexus

    SilverNexus - 2014-03-11
    • labels: --> Debugger
    • status: pending --> open
    • assigned_to: orwelldevcpp --> nobody
     
  • orwelldevcpp

    orwelldevcpp - 2014-03-11
    • status: open --> pending
    • assigned_to: orwelldevcpp
     
  • SilverNexus

    SilverNexus - 2014-03-11
    • status: pending --> fixed
     
  • SilverNexus

    SilverNexus - 2014-03-11

    Both issues appear to be resolved in this ticket. I ran a test run, and the behavior is much more usable. Thank you.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.