Announcement

Collapse
No announcement yet.

Best PB Degugger???

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Best PB Degugger???

    I am a new PB user and am looking for assistance in selecting the best PB debugger. I have tried the PB and RAD Developer Debuggers but nether allow me to view my array of UDT. I will save hours and hours by being able to step through the array Raw Data or at a minimum view a selected complete Raw Data record in the debugger.

    I understand that this question is mostly answered by an opinion (best PB debugger?) but I am hoping that you folks that have years of experience also know the best tools.

    Thanks Jim

    Type RawData
    sDate As Asciiz * 12
    sTime As Asciiz * 6
    lData1 As Long
    lData2 As Long
    End Type

    Global rd () As RawData

    Function PbMain () As Long

    Dim rd (1000000) As RawData

    Local sDate As String
    Local sTime As String
    Local f Data1!, f Data2!

    Local lCnt0 As Long
    Local hFile As Integer

    hFile = FreeFile
    Open "D:\Projects\~PowerBasic\Data.csv" For Input As hFile

    lCnt0 = 0
    While IsFalse Eof(hFile)
    Input# hFile, sDate, sTime, f Data1!, f Data2!
    rd (lCnt0).sDate = sDate
    rd (lCnt0).sTime = sTime
    rd (lCnt0).l Data1 = f Data1! * 100
    rd (lCnt0).l Data2 = f Data2! * 100

    lCnt0 = lCnt0 + 1
    Wend

    Close hFile
    End Function

  • #2
    Originally posted by Jim Lyons View Post
    or at a minimum view a selected complete Raw Data record in the debugger.
    I wrote this under similar circumstances, it may help...

    BTW to make it easier to read, wrap your source code in code delimiters (like quote, but the keyword is code) or use the # symbol on the editor.

    Comment


    • #3
      Originally posted by Jim Lyons View Post
      I have tried the PB and RAD Developer Debuggers but nether allow me to view my array of UDT.
      The debugger in PBWin and PBCC both support viewing members of an array of a UDT. If this is not working for you, I would send an email to support.
      Sincerely,

      Steve Rossell
      PowerBASIC Staff

      Comment


      • #4
        See TRACE in the Help file.
        I use it for most all my debugging.

        James

        Comment


        • #5
          You may not be able to output those UDTs in their entirety as 'regular' character strings, as the ASCIIZ members will be terminated by a $NUL, which will terminate 'regular' strings when PRINTed or used in one of the 'regular' text functions.

          What exactly is the problem you are encountering? Perhaps there is another way to isolate and correct it.
          Michael Mattias
          Tal Systems (retired)
          Port Washington WI USA
          [email protected]
          http://www.talsystems.com

          Comment


          • #6
            Originally posted by Steve Rossell View Post
            The debugger in PBWin and PBCC both support viewing members of an array of a UDT. If this is not working for you, I would send an email to support.
            Steve there are many occasions the debugger will not evaluate a UDT member or array within the UDT etc, usually the UDT has been defined in an INC file. It is a nuisance but never bothered to report it as if it was important then would just change the code to copy the field into a simple variable at the point I want to watch it.
            John

            Comment


            • #7
              If you ever come across this problem again in the future, please send in source code that we can use to replicate this problem. Thank you.
              Sincerely,

              Steve Rossell
              PowerBASIC Staff

              Comment


              • #8
                Ah yes, the debugger...
                Last edited by Chris Holbrook; 1 Jul 2008, 04:11 AM. Reason: content removed in the interests of world peace

                Comment


                • #9
                  Well I found the problem with evaluating a single array UDT. I had a space character after the rd and before the array index.

                  rd (lCnt0).sTime = sTime

                  changed to

                  rd(lCnt0).sTime = sTime

                  Although this compiled and ran the debugger would not evaluate it until the space was removed. I guess I have a little trouble when my tools force my coding style, but I’ll adjust.

                  What I’m really looking for at least at this point is the best most useful, most powerful, most feature rich PB debugger available. As a way to indicate a desired feature I pointed out the display of an arrayed UDT to be able to evaluate an entire UDT record in the debugger based on what ever the index is at the point the trace was stopped.

                  Jim

                  Comment


                  • #10
                    Best debugger = the one between your ears.
                    Michael Mattias
                    Tal Systems (retired)
                    Port Washington WI USA
                    [email protected]
                    http://www.talsystems.com

                    Comment


                    • #11
                      Originally posted by Michael Mattias View Post
                      Best debugger = the one between your ears.
                      Between my ears tells me to search out the best tools available for the job. Experience tells me that have the best tools available will save me time and money in the long run. Both of which we could all use more of.

                      Comment


                      • #12
                        Best tools = that gray stuff between your ears.

                        Give me the best hammers, saws and screwdrivers ever invented, and I'll produce a three-legged stool which wobbles; but I can find and fix programming problems without using a stepping debugger.
                        Michael Mattias
                        Tal Systems (retired)
                        Port Washington WI USA
                        [email protected]
                        http://www.talsystems.com

                        Comment


                        • #13
                          I think that you will have a tough time finding many PB Debuggers. PB has one of course, and I guess that RAD Developer has one (but has not been updated in a loooooooooong time). Philipp Emanuel Weidmann wrote PowerDebug but he has since long abandoned the project (and programming in general). Check out his post: http://planetsquires.com/support/index.php?topic=1907.0
                          Paul Squires
                          FireFly Visual Designer (for PowerBASIC Windows 10+)
                          Version 3 now available.
                          http://www.planetsquires.com

                          Comment


                          • #14
                            IMO...the "BEST"debugger is from the guys that did the compiler.....they know the details of things that many users do not know

                            That said...MCM has a point too....you wrote the code, you know how you intended it to work, you know what you want to do......now is the time to step back and wonder "Ok, it does not work....but WHY???? does it not work?

                            Although...I also see your point....like writing an essay....a second pair of eyes can not hurt
                            Engineer's Motto: If it aint broke take it apart and fix it

                            "If at 1st you don't succeed... call it version 1.0"

                            "Half of Programming is coding"....."The other 90% is DEBUGGING"

                            "Document my code????" .... "WHYYY??? do you think they call it CODE? "

                            Comment


                            • #15
                              OllyDbg (freeware, probably the best usermode debugger for Windows)
                              That plus the PBAnalyzer plugin for it which recognises PB instructions
                              -

                              Comment


                              • #16
                                Wow!! That's REALLY NICE Wayne! Thanks!!!!!

                                Comment


                                • #17
                                  Now that’s what I’m talking about. Simple question simple answer. Thank you Wayne.

                                  Comment


                                  • #18
                                    One other option

                                    I think Michael has one of the best ideas --- but sometimes even that needs assistance.

                                    Somewhere there is a bit of code kicking around that will output stuff to a console window. I use it for debugging in FireFly since using the PB debugger would be difficult.

                                    Essentially you can add a statement like:

                                    Code:
                                    DEBUG("some identifier : " & stringvariable & str$(numericvariable) & etc ...)
                                    Sprinkle this in your code.

                                    The first call will create the console window (even in a PB Win program) and output your string. The next call will output to the same window.

                                    You can make it fancy if you want and possibly turn it on/off with some logic and you would not even have to remove or comment out the DEBUG call. If you get really fancy you could have it pass multiple optional VARIANT parms.

                                    Food for thought.
                                    Mark Strickland, CISSP, CEH
                                    SimplyBASICsecurity.com

                                    Comment


                                    • #19
                                      Don't feel singled out.

                                      For years I have been bashing both the use of the term "debugger" when "stepping debugger" is what is meant, and the over-reliance on stepping debuggers as a primary test/debugging tool.

                                      Your first line of code should not be written until you have answered the question, "How am I going to test this? "

                                      MCM
                                      Last edited by Michael Mattias; 1 Jul 2008, 09:11 AM.
                                      Michael Mattias
                                      Tal Systems (retired)
                                      Port Washington WI USA
                                      [email protected]
                                      http://www.talsystems.com

                                      Comment


                                      • #20
                                        Originally posted by Mark Strickland View Post
                                        Somewhere there is a bit of code kicking around that will output stuff to a console window.
                                        #DEBUG PRINT metastatement will output to the IDE's output window.
                                        Sincerely,

                                        Steve Rossell
                                        PowerBASIC Staff

                                        Comment

                                        Working...
                                        X