HP3000-L Archives

June 1998, Week 1

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
John Korb <[log in to unmask]>
Reply To:
John Korb <[log in to unmask]>
Date:
Tue, 2 Jun 1998 16:04:47 -0400
Content-Type:
text/plain
Parts/Attachments:
text/plain (45 lines)
>Yes. Do this right. If the design requires verifying that there's no loop
>in a tree structure, code the check explicitly. FindPMapAddr is a slow
>way of doing something that should be handled at a much higher level.
>
>You could:
>
>   1. Pass a LEVEL parameter in to the routine, and each recursive call
>      passes LEVEL+1 as its LEVEL argument. If LEVEL gets to be too big,
>      abort.
>
>   2. Same as 1, but use a static variable that gets incremented and
>      decremented. This only works if the procedure has exactly one
>      entry point and one exit point, and if the program logic doesn't
>      allow two "chains" of calls.
>
>   3. Keep track of whatever "thing" this procedure is supposed to be
>      operating on -- part numbers, document numbers, file names,
>      what have you -- in a static array in the procedure. Scan the array
>      for the current argument to see if the argument has been seen
>before.
>      Abort if it has.
>
>You can always call HPDEBUG with a command string of TR;C (print stack
>traceback and continue) and with the output sent to a file that you then
>parse for procedure names. There are other, similar tricks you could use
>in order to get the debugger to do this job. But if there's any way to
>get rid of this kludge, you should take it.
>
>-- Bruce

Thanks for the help.  It now looks like they won't be converting the
program to native mode after all (they are missing some of the source code).

The call to HPDEBUG wiht "TR;C" looks very interesting and I can see a lot
of use for it in debugging.  Thanks!

John

--------------------------------------------------------------
John Korb                            email: [log in to unmask]
Innovative Software Solutions, Inc.

The thoughts, comments, and opinions expressed herein are mine
and do not reflect those of my employer(s), or anyone else.

ATOM RSS1 RSS2