[Issue 18984] Debugging stack struct's which are returned causes incorrect debuginfo.

2018-06-25 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18984

github-bugzi...@puremagic.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--


[Issue 18984] Debugging stack struct's which are returned causes incorrect debuginfo.

2018-06-25 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18984

--- Comment #7 from github-bugzi...@puremagic.com ---
Commits pushed to master at https://github.com/dlang/dmd

https://github.com/dlang/dmd/commit/b3c9c561ce8a52b9997a0fef8912eecd296f8c32
fix issue 18984 - Debugging stack struct's which are returned causes incorrect
debuginfo.

change the names of the hidden return value and the NRVO variable

https://github.com/dlang/dmd/commit/b9cf7458c2c6521bf78cd97822d1905e2e43da4e
Merge pull request #8368 from rainers/issue18984

fix issue 18984 - stack struct's which are returned causes incorrect debuginfo.
merged-on-behalf-of: Petar Kirov 

--


[Issue 18984] Debugging stack struct's which are returned causes incorrect debuginfo.

2018-06-21 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18984

--- Comment #6 from Manu  ---
> but I have not been able to
> get RVO from C++ to see what happens there.

I think if you build with C++14 (RVO guaranteed) and std::move the result to
return value you should be able to force it.

Copy elision is all bundled up in move semantics.

--


[Issue 18984] Debugging stack struct's which are returned causes incorrect debuginfo.

2018-06-21 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18984

--- Comment #5 from Rainer Schuetze  ---
> This is closed right?

IIRC fixes to stable no longer cause automatic closing. This is done when it is
merged back to master to avoid spamming bugzilla with multiple messages.

I think the patch can still be improved, because the RVO variable is now
magically converted to a pointer of a struct, but I have not been able to get
RVO from C++ to see what happens there.

--


[Issue 18984] Debugging stack struct's which are returned causes incorrect debuginfo.

2018-06-20 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18984

--- Comment #4 from Manu  ---
This is closed right?

--


[Issue 18984] Debugging stack struct's which are returned causes incorrect debuginfo.

2018-06-18 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18984

Rainer Schuetze  changed:

   What|Removed |Added

   Keywords||pull

--- Comment #3 from Rainer Schuetze  ---
Might not be too complicated: https://github.com/dlang/dmd/pull/8368

--


[Issue 18984] Debugging stack struct's which are returned causes incorrect debuginfo.

2018-06-17 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18984

--- Comment #2 from Manu  ---
Do you have any feel for the difficulty of this patch?
Is it just an if somewhere to detect if RVO and point the debuginfo at a
different location?

It'd be really good to get a fix in 2.081 if possible, since the guys at work
doing the evaluation all use symbolic debugging (in VisualD) very extensively,
and they'll likely run into this within minutes of doing any real work. (I
think one of them already has. He was complaining that it 'didn't work', but
didn't elaborate how)

How motivated are they to pull bugfix patches like this in 2.081 after the beta
has been cut? I didn't realise the next release was imminent..

--


[Issue 18984] Debugging stack struct's which are returned causes incorrect debuginfo.

2018-06-15 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18984

Manu  changed:

   What|Removed |Added

   Keywords||symdeb

--


[Issue 18984] Debugging stack struct's which are returned causes incorrect debuginfo.

2018-06-15 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18984

Rainer Schuetze  changed:

   What|Removed |Added

 CC||r.sagita...@gmx.de
  Component|visuald |dmd

--- Comment #1 from Rainer Schuetze  ---
To be pedantic, this is an issue with dmd generated debug info. This is a
simpler test case:

struct S
{
int a;
int b;
int c;
}

S foo()
{
S s = S(1, 2, 3);
s.a = 4; // break here, s shows junk, __HID1 has the expected values
return s;
}

void main()
{
S s = foo();
}

Here's the relevant snippet for x64 from the debug info as dumped by cvdump:

(4C) S_GPROC32: [:], Cb: 0042, Type: 0x1006, rvo.foo
 Parent: , End: , Next: 
 Debug start: 000E, Debug end: 003B

(7B)  S_REGREL32: rbp+0010, Type: 0x1007, __HID1
(90)  S_ENDARG
(94)  S_REGREL32: rbp+FFE0, Type: 0x1004, s

(A4) S_END

Happens with OMF aswell, LDC doesn't generate any information for locals.

--