Thread overview
Step into in debugging.
Feb 20, 2017
ANtlord
Feb 21, 2017
ANtlord
Feb 22, 2017
ANtlord
Feb 22, 2017
ANtlord
Feb 22, 2017
drug
Feb 24, 2017
ANtlord
Feb 25, 2017
digitalmars
Feb 25, 2017
drug
February 20, 2017
Hello! I care for project DCD. I've wanted to fix some issue in it very long time ago. But when I get a little bit of free time I encounter one big problem for me.

I can't debug it using GDB. I can't go through call stack because I get a number of issues. Long story short I've decided to solve them one by one and I really need community's help.

First of them. I can't make `step into` staying on this code line https://github.com/ANtlord/DCD/blob/master/src/server/autocomplete.d#L341.
What I do:

1. I compile DCD project using dub with dmd `dub build --compiler=dmd --build=debug --config=server --parallel`
2. I run `gdb <path/to/dcd-server>`. I do it from project root directory always `gdb dcd-server`.
3. Inside gdb. I do `break autocomplete.d:341`
4. Inside gdb. I do `run -p 6767` where `-p 6767` is DCD parameter.
5. I launch dcd-client with parameters for calling desirable code `dcd-client  --port 6767 myfile.d -c 53`. File `myfile.d` consists of `void main(string[] args) { int[] asd = [4,2]; asd[0]. }`. Yes, it has one line.
6. Inside gdb. I stay on desirable line and I do `step`.
7. Inside gdb. I am ended up in `/usr/include/dlang/dmd/std/typecons.d:6097` instead function `generateAutocompleteTrees` called on the line.

I attach this screenshot to be clear https://www.dropbox.com/s/6i2hmbvqwdvopur/Screenshot_20170220_214526.png?dl=0

Thanks.
February 21, 2017
On Monday, 20 February 2017 at 13:55:57 UTC, ANtlord wrote:
> Hello! I care for project DCD. I've wanted to fix some issue in it very long time ago. But when I get a little bit of free time I encounter one big problem for me.
>
> I can't debug it using GDB. I can't go through call stack because I get a number of issues. Long story short I've decided to solve them one by one and I really need community's help.
>
> First of them. I can't make `step into` staying on this code line https://github.com/ANtlord/DCD/blob/master/src/server/autocomplete.d#L341.
> What I do:
>
> 1. I compile DCD project using dub with dmd `dub build --compiler=dmd --build=debug --config=server --parallel`
> 2. I run `gdb <path/to/dcd-server>`. I do it from project root directory always `gdb dcd-server`.
> 3. Inside gdb. I do `break autocomplete.d:341`
> 4. Inside gdb. I do `run -p 6767` where `-p 6767` is DCD parameter.
> 5. I launch dcd-client with parameters for calling desirable code `dcd-client  --port 6767 myfile.d -c 53`. File `myfile.d` consists of `void main(string[] args) { int[] asd = [4,2]; asd[0]. }`. Yes, it has one line.
> 6. Inside gdb. I stay on desirable line and I do `step`.
> 7. Inside gdb. I am ended up in `/usr/include/dlang/dmd/std/typecons.d:6097` instead function `generateAutocompleteTrees` called on the line.
>
> I attach this screenshot to be clear https://www.dropbox.com/s/6i2hmbvqwdvopur/Screenshot_20170220_214526.png?dl=0
>
> Thanks.

My bad. I haven't point version dmd. It is 2.072.0. But I get same issue using 2.073.1, but instead `/usr/include/dlang/dmd/std/typecons.d:6097` I'm ended up in `/usr/include/dlang/dmd/std/typecons.d:6408`.

One more. Am I ended up in typecons because on of arguments of function `generateAutocompleteTrees` is template?
February 22, 2017
On Monday, 20 February 2017 at 13:55:57 UTC, ANtlord wrote:
> Hello! I care for project DCD. I've wanted to fix some issue in it very long time ago. But when I get a little bit of free time I encounter one big problem for me.
>
> I can't debug it using GDB. I can't go through call stack because I get a number of issues. Long story short I've decided to solve them one by one and I really need community's help.
>
> First of them. I can't make `step into` staying on this code line https://github.com/ANtlord/DCD/blob/master/src/server/autocomplete.d#L341.
> What I do:
>
> 1. I compile DCD project using dub with dmd `dub build --compiler=dmd --build=debug --config=server --parallel`
> 2. I run `gdb <path/to/dcd-server>`. I do it from project root directory always `gdb dcd-server`.
> 3. Inside gdb. I do `break autocomplete.d:341`
> 4. Inside gdb. I do `run -p 6767` where `-p 6767` is DCD parameter.
> 5. I launch dcd-client with parameters for calling desirable code `dcd-client  --port 6767 myfile.d -c 53`. File `myfile.d` consists of `void main(string[] args) { int[] asd = [4,2]; asd[0]. }`. Yes, it has one line.
> 6. Inside gdb. I stay on desirable line and I do `step`.
> 7. Inside gdb. I am ended up in `/usr/include/dlang/dmd/std/typecons.d:6097` instead function `generateAutocompleteTrees` called on the line.
>
> I attach this screenshot to be clear https://www.dropbox.com/s/6i2hmbvqwdvopur/Screenshot_20170220_214526.png?dl=0
>
> Thanks.

My bad again. It appears I have a smaller knowledge that I think. I'm ended up in typecons because `allocator` is made by template `scoped` returns instance of internal static struct `Scoped` and it has alias is asigned to method `Scoped_payload` and this is called on https://github.com/ANtlord/DCD/blob/master/src/server/autocomplete.d#L341.

SOLVED
February 22, 2017
On Wednesday, 22 February 2017 at 14:23:02 UTC, ANtlord wrote:
>
> My bad again. It appears I have a smaller knowledge that I think. I'm ended up in typecons because `allocator` is made by template `scoped` returns instance of internal static struct `Scoped` and it has alias is asigned to method `Scoped_payload` and this is called on https://github.com/ANtlord/DCD/blob/master/src/server/autocomplete.d#L341.
>
> SOLVED

And one more. Method `Scoped_payload` returns instance of type passed as template argument for template method `scoped`. As long as method `generateAutocompleteTrees` requires second argument must be instance of `IAllocator`, object `allocator` "transforms" to instance of class implements `IAllocator` by alias of `Scoped_payload` assigned to `this`.
February 22, 2017
22.02.2017 17:32, ANtlord пишет:
> On Wednesday, 22 February 2017 at 14:23:02 UTC, ANtlord wrote:
>>
>> My bad again. It appears I have a smaller knowledge that I think. I'm
>> ended up in typecons because `allocator` is made by template `scoped`
>> returns instance of internal static struct `Scoped` and it has alias
>> is asigned to method `Scoped_payload` and this is called on
>> https://github.com/ANtlord/DCD/blob/master/src/server/autocomplete.d#L341.
>>
>>
>> SOLVED
>
> And one more. Method `Scoped_payload` returns instance of type passed as
> template argument for template method `scoped`. As long as method
> `generateAutocompleteTrees` requires second argument must be instance of
> `IAllocator`, object `allocator` "transforms" to instance of class
> implements `IAllocator` by alias of `Scoped_payload` assigned to `this`.
Thank you for sharing this!
February 24, 2017
On Wednesday, 22 February 2017 at 14:35:14 UTC, drug wrote:

> Thank you for sharing this!

Sarcasm?
February 25, 2017
Of course no.

When I have some problem I google a solution and often I find it. I'm sure that sharing your solution may be useful for somebody else. But very often people that have solved theirs problem do not share solution - they think something like who cares and so on. You didn't shy to publish your problem and solution and I appreciated it, sincerely.
February 25, 2017
hmm.. I didn't change my nickname. It was my answer.