visual D BP's not being hit

Amex Amex at gmail.com
Sun Jun 2 14:35:45 UTC 2019


On Sunday, 2 June 2019 at 09:47:27 UTC, Rainer Schuetze wrote:
>
>
> On 02/06/2019 09:55, Amex wrote:
>> It seems there is some issue with the source code mapping.
>> 
>> Even if I just do
>> 
>>         if (index < 0 || index >= S.length)
>>             return;
>> 
>> and put a BP on the return then my code breaks at the line 
>> below it.
>> 
>
> That's a known issue with the dmd backend: it doesn't generate 
> any code that could be identified with the return statement, 
> because the respective jump instruction is already generated 
> into the condition.
>
> Walter thinks these kind of optimizations are necessary even in 
> debug builds, so that it still runs reasonably fast. I'm not so 
> sure...
>
> Workaround is adding some code to the return block statement 
> that isn't/cannot be removed.

Wow, Why not just make it optional? A simple command line option. 
I don't see how it could significantly slow things down and the 
whole point of debugging is to debug. It's very weird for a BP 
too jump to a line outside the scope ;/ Requiring junk code just 
to make it work is unacceptable(it takes more time to write and 
delete than all the overhead in the returns in the program would 
add and must be done every time).

Maybe you should talk Walter in to getting a VisualD version flag 
added to the DMD compiler so that one could compile with it and 
get VisualD specific code emitted?

Such code could be added willy nilly(not requiring dips since 
they do not effect standard operation) and be used to improve 
coding under VisualD.






More information about the Digitalmars-d-ide mailing list