www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - ndslice and limits of debug info and autocompletion

reply Jay Norwood <jayn prismnet.com> writes:
I'm trying to determine if the debugger autocompletion would be 
useful in combination with ndslice.   I find that using visualD I 
get offered no completion to select core_ctr or epu_ctr where 
epu_ctr is used in the writeln below.

I take it this either means that there is some basic limitation 
in the debug info, or else VisualD just punts after some number 
of array subscripts.

The code builds and executes correctly ... but I was hoping the 
debugger completion would help out with an exploratory mode using 
compiled code.

import std.stdio;
import std.experimental.ndslice;
import std.experimental.ndslice.iteration: transposed;
struct sample{
	ulong [10] core_ctr;
	ulong [32] epu_ctr;
}


void main() {
	auto a1 = new sample[60];
	auto t3 = a1.sliced!(ReplaceArrayWithPointer.no)(3,4,5);
	writeln(t3[0][0][0].epu_ctr);
}
Dec 21 2015
next sibling parent Jay Norwood <jayn prismnet.com> writes:
The autocompletion doesn't work here to offer epu_ctr in the 
writeln statement either, so it doesn't seem to be a problem with 
number of subscripts.   writeln(a1[0].   does offer epu_ctr for 
completion at the same place.

import std.stdio;
import std.experimental.ndslice;
import std.experimental.ndslice.iteration: transposed;
struct sample{
	ulong [10] core_ctr;
	ulong [32] epu_ctr;
}


void main() {
	auto a1 = new sample[60];
	auto t3 = a1.sliced!(ReplaceArrayWithPointer.no)(60);
	writeln(t3[0].epu_ctr);
}
Dec 21 2015
prev sibling next sibling parent Jack Stouffer <jack jackstouffer.com> writes:
On Tuesday, 22 December 2015 at 00:21:16 UTC, Jay Norwood wrote:
 import std.experimental.ndslice.iteration: transposed;
I don't use visualD so I can't help you there, but I wanted to point out that this import is unnecessary.
Dec 21 2015
prev sibling parent Ilya <ilyayaroshenko gmail.com> writes:
On Tuesday, 22 December 2015 at 00:21:16 UTC, Jay Norwood wrote:
 I'm trying to determine if the debugger autocompletion would be 
 useful in combination with ndslice.   I find that using visualD 
 I get offered no completion to select core_ctr or epu_ctr where 
 epu_ctr is used in the writeln below.

 I take it this either means that there is some basic limitation 
 in the debug info, or else VisualD just punts after some number 
 of array subscripts.

 The code builds and executes correctly ... but I was hoping the 
 debugger completion would help out with an exploratory mode 
 using compiled code.

 import std.stdio;
 import std.experimental.ndslice;
 import std.experimental.ndslice.iteration: transposed;
 struct sample{
 	ulong [10] core_ctr;
 	ulong [32] epu_ctr;
 }


 void main() {
 	auto a1 = new sample[60];
 	auto t3 = a1.sliced!(ReplaceArrayWithPointer.no)(3,4,5);
 	writeln(t3[0][0][0].epu_ctr);
 }
I don't know how VisualD works, but to provide auto-completion it should be able to compile a source code for autocompletion information, because simple analyzer would not work with variadic templates like opIndex(Indexes...)(Indexes indexes). Nitpick: t3[0][0][0] is much slower than t3[0, 0, 0]. Best, Ilya
Dec 21 2015