Debug option
Spire_Jeff
Posts: 1,917
Is there an option to have the debugger break on an error? I am referring to errors like index=0 and other internal errors.
Right now, I just grab the line number, then do a find in files, then try to find the line number that matches the error. It would be a little easier if I could just have it break on an error and point me to the offending code
Jeff
Right now, I just grab the line number, then do a find in files, then try to find the line number that matches the error. It would be a little easier if I could just have it break on an error and point me to the offending code
Jeff
0
Comments
I've gotten into the habit of trapping zero index probabilities myself as a result. I don't put in traps that are setup in button events where a zero index errors are not probable. But do them in data_events where the strings can get goofed up and whatnot.
I suppose the added IF statements are kinda processor 'spendy' but it does keep the run time errors to a minimum.
It also adds a considerable amount of processing to the system, which is why most also include a flag to shut it down when you are fully debugged. AMX has such a flag as well, but the debug environment is considerably less able than, let's say, Visual Studio's. I would be willing to bet a decision was made somewhere along the line, that since the primary objective was to actually control a hardware device, not invent a full-bodied programming language, that it was in their best interests not to go any farther down that road than they had to and remain functional. IMO, they need to go just a bit farther than they have, but I don't think they need the full range of debugging a commercial programming environment has.
So I guess my thinking is: having the feature of the language available won't necessarily bog down the processor too much in and of itself; properly integrated debugging code shouldn't add too much weight, and would give incredible capability for creating a more reliable system.
Edit: Furthermore, I don't necessarily think that the debugger needs to be more powerful, but more opportunities for runtime error handling code.