Home AMX User Forum NetLinx Studio
Options

Debugging Modules

Has anyone seen any strange behavior in Netlinx Studio around not being able to debug when you've got large comment blocks? I was trying hit a breakpoint in a module I'm building and it just would not catch the program execution even though I was seeing responses from the module in my Diagnostics window. On a whim, I cut out a rather large comment block and put it in a text document separate from the module code. Once I did this, the debugging started working.

Is there some rule about not having extensive comments in modules or code in general?

Cheers,
Matthew

Comments

  • Options
    ericmedleyericmedley Posts: 4,177
    Has anyone seen any strange behavior in Netlinx Studio around not being able to debug when you've got large comment blocks? I was trying hit a breakpoint in a module I'm building and it just would not catch the program execution even though I was seeing responses from the module in my Diagnostics window. On a whim, I cut out a rather large comment block and put it in a text document separate from the module code. Once I did this, the debugging started working.

    Is there some rule about not having extensive comments in modules or code in general?

    Cheers,
    Matthew

    hmmm... I've never seen this myself. I have found that I have to be carefull about the number of variables I'm watching and/or the size of those variables and/or the size of data I'm trying look at. It's not that it won't do it. But it seems to be very prone to crashing if you stay there too long.

    I cannot imagine why a comment would have anything to do with the debugger. starnge...
  • Options
    If it's not a well known issue then I have to imagine it was something else then that got fixed up to allow for debugging. At first I started thinking that debugging a module was impossible. I'm new to Netlinx programming so I'm sure I'll have a lot of dumb questions along the way. It was certainly a couple painful hours last night...but I'm recovered. :)

    Thanks for the response, Eric!

    Cheers,
    Matthew
  • Options
    DHawthorneDHawthorne Posts: 4,584
    Debugging modules can be real annoying if you have multiple instances of the module, or if there are varaib le names you share in various modules. The compiler can keep track of them all, but the debugger can't and often will be looking at the wrong thing. I'll comment out all the modules except the one I am working on for that reason, and if that isn't feasible, SEND_STRING 0 because the tool of preference, not the debugging window.
  • Options
    I am definitely starting to see how SEND_STRING 0 is going to be one of my best friends as I move forward with all of this. Granted, I'd prefer better debugging facilities, but programming for A/V is a whole lot more fun than a lot of other programming work I've had to do in my life. ;-)

    Thanks for the response, Dave.

    Cheers,
    Matthew
  • Options
    Joe HebertJoe Hebert Posts: 2,159
    At first I started thinking that debugging a module was impossible.

    Not impossible but it?s certainly an adventure. Along with the instance problems that Dave mentioned there are also issues setting breakpoints and stepping through code in a module.

    Here?s a post that describes the problem.

    http://amxforums.com/showpost.php?p=9446&postcount=1

    And here?s a post with sample code that demonstrates the problem:

    http://amxforums.com/showpost.php?p=18765&postcount=34

    Hopefully someday we?ll see a fix but I?m not holding my breath as this problem has been around for years.

    Welcome to the forum?
  • Options
    Thanks Joe.

    I think this was definitely a part of the problem that I was seeing. Along the lines of your post, one of the things I would love to see become a part of the debugger is keystroke-based commands. I don't think there's a hotkey to step through each line but it gets tedious have to continuously select Debug...Single Step. To be able to press a function key to step through the next line, it would make debugging so much easier. I also wouldn't mind seeing some better intellisense but I won't hold my breath. As it stands, I'm doing okay with Diagnostics.

    Cheers and thanks for the welcome!
    Matthew
  • Options
    Joe HebertJoe Hebert Posts: 2,159
    I would love to see become a part of the debugger is keystroke-based commands. I don't think there's a hotkey to step through each line but it gets tedious have to continuously select Debug...Single Step. To be able to press a function key to step through the next line, it would make debugging so much easier.
    You can configure your own hotkeys via the Preferences dialog box and for example assign F9 to toggle a breakpoint.

    You can also use the Debug Watch toolbar instead of navigating the menu bar.
  • Options
    You rock, Joe! Thank you so much...I didn't realize you could do this!!!

    Thanks so much!

    Cheers,
    Matthew
Sign In or Register to comment.