Announcement

Collapse
No announcement yet.

Finding last line upon program end

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

  • Finding last line upon program end

    Hello. I have a program I am trying to debug to see why it will
    not completely finish. There are two END statements, but the
    program is stopping somehwhere else.

    It is an only 211 lines long, and I found the subroutine where
    it stops, however there is no END statement there. Is there a
    way to use debug to see the last (or next to last) line it is
    in before stopping? I think from that point, I can work
    backwards. This one is one frustrating little minx.

    Or, if I can set the debugger to pause when a variable reaches
    a certain value, that would probably help. If I could set it
    somewhere to break when CityKount = 7147, and then step
    line-by-line from that point and watch everything, it might help.

    Reason I know it is not finishing is it is reading and examining
    over 1.4 million lines of information. It is stopping after it
    reads 7,148th line for some odd reason. No error message, so I'd
    like to find the last line executed so I can see what variable
    went haywire.

    Thank you.

    Robert

    ------------------


    [This message has been edited by Robert E. Carneal (edited November 15, 2006).]

  • #2
    You may want to try this:
    PBTracer

    It's unfinished, ugly and not userfriendly. But it may help / do the job.
    Just be sure to follow what's written in the readme.txt.

    Bye!

    ------------------
    Try Online TrID file identifier! Recognize over 2.300 filetypes and counting...
    Give a powerfull scriptable Lua interface to your application with PowerBLua
    Leakout - Firewall outbound control tester - BitmapRip Extract/recover bitmaps from any file!

    [This message has been edited by Marco Pontello (edited November 16, 2006).]
    -- The universe tends toward maximum irony. Don't push it.

    File Extension Seeker - Metasearch engine for file extensions / file types
    Online TrID file identifier | TrIDLib - Identify thousands of file formats

    Comment


    • #3
      Check the stack - any recursive function?
      Check for wrong chars on input file.
      Do a memory/stack check before the line 7148.



      ------------------
      Arthur Gomide
      Como diria nosso profeta da bola, Dadá Maravilha:
      "Para toda Problemática existe uma Solucionática!"
      "The trouble with quotes on the Internet is that you can never know if they are genuine." - Abraham Lincoln.

      Comment


      • #4
        Is it ending, or is it aborting with runtime error? Big difference.

        If ending, it's probably a problem with your flow logic, prehaps in your error-handling logic.

        If aborting, it's probably a problem with your editing/error-checking.


        >and I found the subroutine where
        >it stops, however there is no END statement there

        But does that subroutine ALWAYS flow to a RETURN statement?

        Michael Mattias
        Tal Systems (retired)
        Port Washington WI USA
        [email protected]
        http://www.talsystems.com

        Comment


        • #5
          >Or, if I can set the debugger to pause when a variable reaches
          >a certain value

          ???
          Code:
           IF Var = somevalue THEN
              Dummy =  1234   '<<< SET BREAKPOINT HERE and "RUN TO BREAKPOINT"
           END IF
          MCM
          Michael Mattias
          Tal Systems (retired)
          Port Washington WI USA
          [email protected]
          http://www.talsystems.com

          Comment


          • #6
            Bob,

            Throw the code up and lets have a look. Also, what version of
            PBdos are you using?


            ------------------
            C'ya
            Don
            don at DASoftVSS dot com
            http://www.DASoftVSS.com
            --
            The perfect American sentence:
            "Like, absolutely awesome!"
            C'ya
            Don

            http://www.ImagesBy.me

            Comment


            • #7
              You may want to try this: PBTracer I will.
              Q: Check the stack - any recursive function?
              A: Yes. It stops upon reading line 7148

              Q: Check for wrong chars on input file.
              A: Done. There are not any that I see, but I am inquiring to
              the author if she put in characters that are not printable.

              Q: Do a memory/stack check before the line 7148.
              A: Done. I don’t recognize a problem.

              Q: Is it ending, or is it aborting with runtime error? Big
              difference.
              A: It is Ending.
              Q: If ending, it's probably a problem with your flow logic,
              prehaps in your error-handling logic.
              A: I agree.
              Q: If aborting, it's probably a problem with your
              editing/error-checking.
              A: Not aborting, just stopping at that line

              Q; But does that subroutine ALWAYS flow to a RETURN statement?
              A: Yes. It *should* as it is just a top-down flow sub-routine.
              I did try an IF statement where:
              If CityKount = 7147, then
              Lookhere=7 :’this had the breakpoint
              End if

              And it executed. But the line highlighted after execution was
              the very first line at the top of the program which was
              commented.

              I am going to try the tracer and see what I get.

              For those curious as to what I am doing, I have a list of places
              in the United States. They look like this:
              City, Zip, State, Country, FIPS,Pref, TZ, DST,Lat, Long, MSA, PMSA, and MA.
              I am reading all that, and then looking to see if a traditional
              abbreviation for the state exists. I.e., if St is MA, I look up
              some abbreviations to see if a traditional abbrevation for
              Massachusetts exists. Yes it does. So I print that record to a
              file.

              Then I return to the main part of the program. If it does not find a
              traditional abbreviation, is returns to the main part of the program
              without printing the record. So, yes, it is supposed to reach a
              RETURN no matter if the result is yes or no.

              After sleeping on it, I decided to copy the data, and erase
              everything but the offending line/record, and just read that
              one record and go line by line and see what it is doing. I
              should have done that last night.

              Robert


              ------------------

              Comment


              • #8
                Originally posted by Robert E. Carneal:
                Q: Check the stack - any recursive function?
                A: Yes. It stops upon reading line 7148
                Put in the beginning of your program - 1st executable line:

                PRINT FRE(-2) 'print the stack space (default is 1974 bytes)

                and change the "breakpoint" to this, just to see the stack space:

                IF CityKount = 7147 THEN
                PRINT FRE(-2)
                STOP
                END IF

                If the stack is low, put a $STACK before any executable line of your code:

                $STACK 32 ' 32kb, maximum you can allocate.



                ------------------
                Arthur Gomide
                Como diria nosso profeta da bola, Dadá Maravilha:
                "Para toda Problemática existe uma Solucionática!"
                "The trouble with quotes on the Internet is that you can never know if they are genuine." - Abraham Lincoln.

                Comment


                • #9
                  Everyone-

                  I am embarressed to admit it, but I use an editor to edit my
                  programs, and data with. Some records have "" (two double quotes)
                  for a variable. The developer of this data sometimes used '''',
                  (four single quotes), and the font I was using squeezed them
                  together making it look like two double quotes. After I spent
                  some time looking for '' (single quotes) and replacing that with
                  one double quote, it is running much better. Embarassing!!

                  Thank you everyone.

                  Robert

                  ------------------


                  [This message has been edited by Robert E. Carneal (edited November 16, 2006).]

                  Comment

                  Working...
                  X