Board index » delphi » Break Points

Break Points

Does anybody know is Borland Pascal be able to set a break point
that work in anywhere of my source that can be triggered when,
say, I>10 ??

The conditional breakpoint only allow me to perform a check
on a specific line.

Regards

 

Re:Break Points


In article <3uot9o$...@tst.hk.super.net>,
Mr Anders Lee <and...@hk.super.net> wrote:

Quote

>Does anybody know is Borland Pascal be able to set a break point
>that work in anywhere of my source that can be triggered when,
>say, I>10 ??

  No.  Breakpoints always work on a specific line.  (Unless I've missed
something BIG!)  Just set conditional breakpoints on every line that changes
the value of I.  (I know, it might be a lot, but whaddaya do...)

 -Pat

Re:Break Points


In article <DCAy1C....@ecf.toronto.edu> doy...@ecf.toronto.edu (DOYLE  PATRICK) writes:

Quote
>In article <3uot9o$...@tst.hk.super.net>,
>Mr Anders Lee <and...@hk.super.net> wrote:

>>Does anybody know is Borland Pascal be able to set a break point
>>that work in anywhere of my source that can be triggered when,
>>say, I>10 ??
>  No.  Breakpoints always work on a specific line.  (Unless I've missed
>something BIG!)  Just set conditional breakpoints on every line that changes
>the value of I.  (I know, it might be a lot, but whaddaya do...)

That's right about the IDE de{*word*81}, but TD can set the other kind of
breakpoint.

Duncan Murdoch

Re:Break Points


If its a TVision app, put the check in the message loop, or in 'Idle'. It
will get a lot of time.
Bri

Re:Break Points


In article <3uot9o$...@tst.hk.super.net>, and...@hk.super.net (Mr Anders Lee) writes:
|
| Does anybody know is Borland Pascal be able to set a break point
| that work in anywhere of my source that can be triggered when,
| say, I>10 ??
|
| The conditional breakpoint only allow me to perform a check
| on a specific line.

  I was a bit surprised to read two answers to this, both saying that cond.
  breakpoints are not possible in TP/BP. Well, they are. What you do is this:

  You make an ordinary breakpoint (unconditional.) Then you enter the menu,
  choosing Debug and then I don't remember what. Something about breakpoints,
  I think. (My fingers know what to do, but I don't. :) Anyhow, you get a
  window showing you all your breakpoints. Choose edit on the breakpoint you
  want to make conditional and type in the condition. No problem.
  This is in version 7.0, but I think also in 6.0 and maybe even 5.5.

  --Lars M.

_______________________________________________________________________________

  -- Lars M. Garshol, Institute of Informatics, Oslo University

     "Life is a {*word*225}ly transmitted disease." -- A. Brink
     http://www.ifi.uio.no/~larsga

Re:Break Points


Lars Marius Garshol (lar...@ifi.uio.no) wrote:

: In article <3uot9o$...@tst.hk.super.net>, and...@hk.super.net (Mr Anders Lee) writes:
: |
: | Does anybody know is Borland Pascal be able to set a break point
: | that work in anywhere of my source that can be triggered when,
: | say, I>10 ??
: |
: | The conditional breakpoint only allow me to perform a check
: | on a specific line.

:   I was a bit surprised to read two answers to this, both saying that cond.
:   breakpoints are not possible in TP/BP. Well, they are. What you do is this:

:   You make an ordinary breakpoint (unconditional.) Then you enter the menu,
:   choosing Debug and then I don't remember what. Something about breakpoints,
:   I think. (My fingers know what to do, but I don't. :) Anyhow, you get a
:   window showing you all your breakpoints. Choose edit on the breakpoint you
:   want to make conditional and type in the condition. No problem.
:   This is in version 7.0, but I think also in 6.0 and maybe even 5.5.

Sorry, you over-look the not-so-simple question.
Setting conditioned breakpoint still has to be specified onto one of the
program line.

My point is to set a condition that can be triggered at any program line.

Say, that my program goes wrong when c<=0.  But I have too many lines
that alter c, setting condition to each line works, but not practical,
it may take years to do.

Re:Break Points


On Tue Aug  8, and...@hk.super.net (Mr Anders Lee) wrote:

Quote

>Setting conditioned breakpoint still has to be specified onto one of the
>program line.

>My point is to set a condition that can be triggered at any program line.

>Say, that my program goes wrong when c<=0.  But I have too many lines
>that alter c, setting condition to each line works, but not practical,
>it may take years to do.

Debugging is fun, isn't it?

The standard way is to work down through the program, putting
breakpoints in outer procedures and working into inner
procedures. This requires extensive knowledge of the program.

An alternative might be to define an array with bounds the valid
values of c:

  var  check   : array[1..100] or byte;

then sprinkle assignments around your code:

  check[c] := 0;

Turn range checking on. When it traps, you can isolate the
section of code between these two lines as the problem section.
Remove all the other check lines, and put a bunch more in this
section.

Brent
--
Brent Beach, Victoria, BC

Re:Break Points


Quote
In article <4086ot$...@tst.hk.super.net> and...@hk.super.net writes:

>Lars Marius Garshol (lar...@ifi.uio.no) wrote:

>: In article <3uot9o$...@tst.hk.super.net>, and...@hk.super.net (Mr Anders Lee)> writes:
>: |
>: | Does anybody know is Borland Pascal be able to set a break point
>: | that work in anywhere of my source that can be triggered when,
>: | say, I>10 ??
>: |

Turbo De{*word*81} lets you do this look for global breakpoints. They will
slow down the program a bit depending on how complex the breakpoint
is.

Re:Break Points


and...@hk.super.net (Mr Anders Lee) wrote:

Quote
>Lars Marius Garshol (lar...@ifi.uio.no) wrote:
>: In article <3uot9o$...@tst.hk.super.net>, and...@hk.super.net (Mr Anders Lee) writes:
>: |
>: | Does anybody know is Borland Pascal be able to set a break point
>: | that work in anywhere of my source that can be triggered when,
>: | say, I>10 ??
>: |
>: | The conditional breakpoint only allow me to perform a check
>: | on a specific line.

[answer cut]

Quote
>Sorry, you over-look the not-so-simple question.
>Setting conditioned breakpoint still has to be specified onto one of the
>program line.
>My point is to set a condition that can be triggered at any program line.
>Say, that my program goes wrong when c<=0.  But I have too many lines
>that alter c, setting condition to each line works, but not practical,
>it may take years to do.

Use the standalone de{*word*81}, TD386 should be able to set global
conditioned breakpoints, at least with TDH386.SYS.

Regards,
Mathias Block.

Re:Break Points


Quote
ae...@FreeNet.Carleton.CA (Brent Beach) wrote:
>On Tue Aug  8, and...@hk.super.net (Mr Anders Lee) wrote:

>>Setting conditioned breakpoint still has to be specified onto one of the
>>program line.

>>My point is to set a condition that can be triggered at any program line.

>>Say, that my program goes wrong when c<=0.  But I have too many lines
>>that alter c, setting condition to each line works, but not practical,
>>it may take years to do.

>Debugging is fun, isn't it?
>The standard way is to work down through the program, putting
>breakpoints in outer procedures and working into inner
>procedures. This requires extensive knowledge of the program.
>An alternative might be to define an array with bounds the valid
>values of c:
>  var  check   : array[1..100] or byte;
>then sprinkle assignments around your code:
>  check[c] := 0;
>Turn range checking on. When it traps, you can isolate the
>section of code between these two lines as the problem section.
>Remove all the other check lines, and put a bunch more in this
>section.

Maybe, then it is easier to use a variable of a given subtype,
e.g.
var c: 1..100;
begin
  c := {some calculation};
end.
You'll get a Range Check error then, if the calculation is outside the
bounds of the subtype. But - you cannot use constants, because the
compiler will know at compile time.

Regards,
Mathias.

Other Threads