Board index » delphi » TP7 IDE debugging help needed

TP7 IDE debugging help needed

Hi All

Using the TP7 IDE, I haven't been able to work out how to do
effective debugging.  I have Read The Fine Manual but there
aren't any examples of things like Watch Expressions, nor
Setting Breakpoints.  Can anyone explain how to do these things
or provide a simple example?

Also, I was testing a procedure and kept getting Stack Overflow
errors when I shouldn't have.  I now have the procedure working,
but wonder if there is a way that I can see just what is occupying
the stack (and what space is used/available) ?

I am teaching myself TP, and am a relatively novice programmer.

Cheers

Andrew McLachlan,  PhD student.               <MCLAC...@lincoln.ac.nz>
Ecology & Entomology Group,   Soil, Plant and Ecological Sciences Division
P.O. Box 84,   Lincoln University,   Canterbury,   New Zealand.  
ph. +64 3 325-2811,  fax. +64 3 325-3844.

 

Re:TP7 IDE debugging help needed


Quote
>aren't any examples of things like Watch Expressions, nor
>Setting Breakpoints.  Can anyone explain how to do these things
>or provide a simple example?

You set a breakpoint by pressing CTRL+F8 on the line you want the BP.

Watches are set with CTRL+F7

Hope this helps,

Daniel, Sweden

Re:TP7 IDE debugging help needed


JRS:  In article <mclachla.250.350F7...@tui.lincoln.ac.nz> of Wed, 18
Mar 1998 08:02:53 in comp.lang.pascal.borland, Andrew McLachlan

Quote
<mclac...@tui.lincoln.ac.nz> wrote:
>Also, I was testing a procedure and kept getting Stack Overflow
>errors when I shouldn't have.  I now have the procedure working,
>but wonder if there is a way that I can see just what is occupying
>the stack (and what space is used/available) ?

The easy ways of getting Stack Overflow are recursing too deep, and
having over-large variables and parameters, or, especially, both.

Never declare anything as type string without considering using a
shorter type string [x].

Never declare anything in a recursive procedure if it could be declared
non-recursively in a wrapper.

To save stack, use const and var procedure parameters wherever
practicable.

*Sometimes* if you have an essentially recursive method it is possible
to save intermediate results in a cache for re-use - see
        http://www.merlyn.demon.co.uk/homepage/programs/jad_9514.pas

In the online help (shift F1), type SPtr; also $M.

Quote
>Cheers

>Andrew

No SigSep.

--
John Stockton, Surrey, UK.    j...@merlyn.demon.co.uk    Turnpike v1.12    MIME.
  Web <URL: http://www.merlyn.demon.co.uk/> - FAQqish topics, acronyms & links.
  Correct 4-line sig separator is as above, a line comprising "-- " (SoRFC1036)
  Do not Mail News to me.    Before a reply, quote with ">" or "> " (SoRFC1036)

Re:TP7 IDE debugging help needed


Quote
Andrew McLachlan wrote:

> Hi All

> Using the TP7 IDE, I haven't been able to work out how to do
> effective debugging.  I have Read The Fine Manual but there
> aren't any examples of things like Watch Expressions, nor
> Setting Breakpoints.  Can anyone explain how to do these things
> or provide a simple example?

Watches:
  This is the BEST debugging tool I have ever used...  Watchya do is go
to  DEBUG>WATCH and that'll bring up another window.  Hit INS in the
window, it'll ask what variable you want to look at.  Type it in, and
then you'll see the variable name, and what it looks like to the
compiler.  (Use only for declared variables.  You can't use TYPE
classes)

BreakPoints:
  Second best tool the IDE has to offer.  This will put a trigger in
your code (While you're running under the IDE) so that you can stop, and
look at the WATCH and whatever else you need to do.  You can also step
through your program (F7 and F8) to see what happens to your data, etc.

Quote
> Also, I was testing a procedure and kept getting Stack Overflow
> errors when I shouldn't have.  I now have the procedure working,
> but wonder if there is a way that I can see just what is occupying
> the stack (and what space is used/available) ?

CTRL-F3 will bring up the stack window.  This shows what procedures are
being run.  Here's an example of what one of my programs produce:

scanfile('c:\PROGRAM\HELPPC\ASM.TXT','ASM.TXT')
scanallfiles('c:\PROGRAM\HELPPC')
scantree('c:\PROGRAM')
scantree('c:\')
PROGRAM

SCANTREE searches the directory tree.  SCANALLFILES looks at all the
files IN that directory, and SCANFILE will read the file (In this case)
ASM.TXT

To bump your stack size up, before you start doing any coding (As in
before your USES or TYPE def'ns) put in {$M 32000,0,63000}  That'll give
ya 32k worth for your stack (The stack includes whatever gets pushed or
pulled through variables, parameters, whatever.  Not just the 4bytes to
the pointer where the last call was made, but, that's an advanced topic,
I would suppose.  :)  

Quote
> I am teaching myself TP, and am a relatively novice programmer.

We all gotta start somewhere.  hehe  :)

  vcard.vcf
< 1K Download

Other Threads