¿Cuál es la diferencia entre "alternar punto de interrupción de línea" y "alternar punto de interrupción" en Eclipse?

I just cannot understand the two options under the Corral button of the menu in Eclipse. Doesn't the usually breakpoint refer to a line? I realize that there could be this case:

if (x >= 0 && x < 4 && y >= 0 
    && y < 4)
source ^= 1 << (x * 4 + y);

sin embargo cuando toggle line breakpoint of the 2nd line to set a breakpoint, it can also be unset by punto de interrupción de palanca.So what's their difference on earth and how to distinguish them with the símbolos?

preguntado el 10 de marzo de 12 a las 09:03

2 Respuestas

In eclipse you can have 5 types of break points:

  • the one you are used to: the ordinary line breakpoint
  • a conditional breakpoint in which you stop on a line, but only when a certain condition is met
  • method breakpoint that is triggered when you enter in a method
  • an exception breakpoint, that stops on any line that throws a certain exception.
  • (as per the comments I have forgotten about those) watchpoints: using them you will break whenever a certain field is accessed or modified. They can be configured from the outline view.

The second option is also put on a certain line, but as long as it needs to be configured it might be considered as something more special. The symbols of the first two breakpoints are different. The third has special symbol too. The fourth one has no symbol (it does not belong to any specific place).

This comes as explanation fighting off your words Doesn't the usually breakpoint refer to a line.

Also you can see the difference between the two if you have such code:

void func() {
    int a = 16;
}

Trata de hacerlo toggle breakpoint y toggle line breakpoint en la línea void func(). Do you see the difference? Toggle breakpoint actually chooses the suitable option between toggle line breakpoint y toggle method breakpoint.

respondido 10 mar '12, 09:03

Thanks very much. And is there any example about the other two break points? - Hongxu Chen

Note: Method breakpoints can be set/unset in the Outline view. - Thorbjorn Ravn Andersen

You can do conditional breakpoint if you right click on the breakpoint of a line and go to breakpoint properties. The exception breakpoint: go to Debug perspective -> breakpoints find the symbol J!. There you can choose the exception you want to stop into. - Boris Strandjev

Many thanks.Then could you please explain punto de interrupción condicional y punto de interrupción de excepción a bit more? I also see there's a "toggle watchpoint" option in the Outline view, which seems to toggle a field.Is it also a breakpoint? - Hongxu Chen

About the first question: just play around with the options, they are easy to understand and will spare me a lot of explanations. About the second one: thanks for pointing that one out, I forgot about it. Using toggle watchpoint the execution will stop whenever you access or modify the selected field. - Boris Strandjev

toggle line breakpoint only act on the line breakpoint. the other act on any breakpoint. Here ( http://eclipse-tips.com/tips/29-types-of-breakpoints-in-eclipse ) you can see the list of possible breakpoints in eclipse.

respondido 10 mar '12, 09:03

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.