Quando a depuração de código Eclipse CDT eu testemunhei um comportamento estranho. Eu tento explicar isso com screen-shots. Estou pessoas certeza que não sabem CDT ainda pode me dar uma resposta a esta pergunta, porque eu acho que está relacionado com (depuração) de código Java com Eclipse em geral.
O IIndexFile file
que você vê na linha realçada terá um campo com um valor errado e eu tento entender onde esse valor vem.
Antes de entrar getFile()
:
Dentro de getFile()
uma nova PDOMFile
é criada. O construtor com dois parâmetros é chamado:
Shortly before leaving the constructor we can see on the right side that location
is null. Not surprising, as it hasn't been set yet.
The next image shows the first thing that surprises me a bit. When leaving the constructor for PDOMFILE
I actually expect the debugger to tell me the return value. Instead it says No explicit return value
. Maybe it's because it was a constructor or maybe it's because of the if-statement.
Now the highlighted line shows that the dubber is back from the call getFile()
, but the assignment to file
hasn't been done yet. We can see that the location
field is still null.
And this is what I don't understand. Why is location
from file set now?
As chamadas do depurador toString()
para obter a seqüência de caracteres exibida no painel inferior da vista "Variáveis". PDOMFile.toString()
chamadas getLocation()
que define location
em sua primeira chamada.