More flexible debugger (show variables)

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by MrVainSCL.

Hi bro´n sis,
Its surelly nice that you can show variables of your program when running with enabled debugger! The only problem is that you will only see GLOBAL variables but not the one you are using in all your procedures. I know that every procedure can have the same variable names and that this will show a problem when planing to display ALL (!) variables in a debug window!

So, what about following idea to display the user ALL (!) variables in the debug window (even with ALL variables of ALL procedures). The output has to been advanced with a TreeGadget. This could look like following structure / output:

Code: Select all

   [+]- Global
    |   |
    |   +-- col           216    long
    |   +-- x             600    long
    |   +-- y             480    word   
    |
   [+]- Procedures
        |
       [+]- MyFirstProcedure()
        |   +- testval     23    byte
        |   +- quitval     12    long
        |
       [+]- MyNextProcedure()
            +- testval    521    long  
            +- quitval      2    byte
            +- power       48    word
I think this would make coding, esp bug fixing more easy and give the code a better overview for testing. What do you think about this idea?

greetz
MrVainSCL! aka Thorsten

PIII450, 256MB Ram, 80GB HD + 6,4 GB, RivaTNT, DirectX9.0, SB AWE64, Win2000 + all Updates...
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by tinman.
Originally posted by MrVainSCL

So, what about following idea to display the user ALL (!) variables
I wouldn't want to see all my variables, I currently have 10000 lines of code (a lot of it comments though :). But my variable window would be swamped and refreshing it would waste a lot of time.

Much better if you could choose the variables you want to see (usually called "watches" in other languages/debuggers). And then put it in a tree system like you have (maybe that is what you meant?).

I don't know how possible it would be, but if you could create executables with "standard" debug sections and use any debugger you want, it would be excellent. I would have thought that other systems could probably support, or in fact use, debug information in "GNU debugger" format. That's if there is a "standard" format.

Even if PureBasic had a debugger like AmiBlitz's, that would be a lot more useful than the current debugger (although that would probably take a while to write).

Other nice features might be the copy and paste from the debug window, and redirecting or saving the contents of the debug window to a file.

I also remember Fred saying the debugger source would be released? Is that going to happen? It may take some of the work off him.


--
It's not minimalist - I'm increasing efficiency by reducing input effort.
(Win98first ed. + all updates, PB3.51)
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by MrVainSCL.

hi tinman,
if you dont want show all your variables, you can close the treegadgets. You may be right, that it would waste some time... But its only while coding and for checking/debugging :wink:

Lets us wait for some more discussion postings and what Fred think about this idea :wink:

greetz
MrVainSCL! aka Thorsten

PIII450, 256MB Ram, 80GB HD + 6,4 GB, RivaTNT, DirectX9.0, SB AWE64, Win2000 + all Updates...
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by tinman.
Originally posted by MrVainSCL

if you dont want show all your variables, you can close the treegadgets. You may be right, that it would waste some time... But
OK, what if I have 100 variables in a procedure and I want to look at only 1 of them. Should I be forced to see the other 99? The treegadget will still need to store the memory for all variables and their displays. Is that a really good solution, even though you can hide them?
its only while coding and for checking/debugging :wink:
That's no reason to have such basic tools that just dump everything to the screen. Debugging isn't always a simple case of looking at some numbers. And if you cannot see errors in your code, why are you more likely to see one wrong value in a list of 20?


--
It's not minimalist - I'm increasing efficiency by reducing input effort.
(Win98first ed. + all updates, PB3.51)
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by MrVainSCL.

tinman, maybe it would be ok, that the user can say optional which variables or procedures he wish to see in the debug window... i agree in this point with you... But the first step is to have a final working version, then the other things could be implemented optional...

Ahhh, thats no reason, mhhhh! Have you ever tried a very very complex program with a lot of procedures and threads... for this case it would make really big sence to have such an function in the debugger... PureBasic has a debugger window to show some variables... it a nice start, but for real coding this is still useless if you wanna check if something get wrong with a procedure in a thread or whatever... If pure will give us such a feature atm, why not add it optional that coders can have complete overview...? You dont must use the system if you dont need nor dont want use it :wink:

Btw sometiems is debugging looking to some numbers more easy instead to seach the whole source of a very big complex program with 1000 include files! In a lot parts you can debug yourself with OpenConsole() i know and agree... But in some parts this isnt easy at all... and last but not least, i think its important to have a very easy and complex SDK which should help ppl while developing!

greetz
MrVainSCL! aka Thorsten

PIII450, 256MB Ram, 80GB HD + 6,4 GB, RivaTNT, DirectX9.0, SB AWE64, Win2000 + all Updates...
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by tinman.
Originally posted by MrVainSCL

But the first step is to have a final working version, then the other things could be implemented optional...
You really think that? I would much rather see the debugger be designed to include all the useful features of a good debugger rather than hacking out quick updates and then adding on parts afterwards. Not only would users not get annoyed at half finished and useless parts of PB (the debugger as it was has already turned some people away, and look at the number of people moaning about the first, quickly released version of the 3D library), but it would reduce the amount of time Fred needs to write something and then change bits of it to fit in with an update.
Ahhh, thats no reason, mhhhh! Have you ever tried a very very complex program with a lot of procedures and threads... for this case it would make really big sence to have such an function in the
Quite the opposite. As the size and complexity of software increases, you are less likely to want to see every variable, or have every variable added to a tree/list gadget. Can you imagine the additional wasted memory? Slowdown? I don't want the debugger to break my program or prevent me from getting the resources it may need just because it was designed to do the job in the simplest, least elegant way possible.

Of course, if your software was developed cleanly, you would not ever need to see all variables at once. There is not a chance that you should be able to affect all variables in your program from any piece of code, unless you have good, specific reasons for it.

You will also have tested parts of it before you bring them all together. You will need some integration testing, but if you've done your first round of testing properly, then it would not need to be at a level where you see all variables.

I don't think an option for "Show all variables" should not exist, I just do not think it should be the default, or only option.

--
It's not minimalist - I'm increasing efficiency by reducing input effort.
(Win98first ed. + all updates, PB3.51, Ed3.53)
Post Reply