Re: debugging in vs code on Windows

2017-10-14 Thread Heromyth via Digitalmars-d-learn
On Saturday, 14 October 2017 at 19:01:52 UTC, piotrklos wrote: On Saturday, 14 October 2017 at 13:12:51 UTC, Jerry wrote: On Friday, 13 October 2017 at 12:55:09 UTC, piotrklos wrote: (...) If you use generate a 32-bit binary using DMD, it generates it in a format that the C/C++ extension doe

Re: Assert and undefined behavior

2017-10-14 Thread kdevel via Digitalmars-d-learn
On Saturday, 14 October 2017 at 09:32:32 UTC, Timon Gehr wrote: Also, UB can and does sometimes mean that the program can execute arbitrary code. It's called "arbitrary code execution": https://en.wikipedia.org/wiki/Arbitrary_code_execution This confuses different levels of reasoning. In C/C++

Re: debugging in vs code on Windows

2017-10-14 Thread Jerry via Digitalmars-d-learn
On Saturday, 14 October 2017 at 19:01:52 UTC, piotrklos wrote: On Saturday, 14 October 2017 at 13:12:51 UTC, Jerry wrote: On Friday, 13 October 2017 at 12:55:09 UTC, piotrklos wrote: (...) If you use generate a 32-bit binary using DMD, it generates it in a format that the C/C++ extension doe

Re: debugging in vs code on Windows

2017-10-14 Thread piotrklos via Digitalmars-d-learn
On Saturday, 14 October 2017 at 13:12:51 UTC, Jerry wrote: On Friday, 13 October 2017 at 12:55:09 UTC, piotrklos wrote: (...) If you use generate a 32-bit binary using DMD, it generates it in a format that the C/C++ extension doesn't understand. You need to compile -m32mscoff or -m64, and yo

Re: debugging in vs code on Windows

2017-10-14 Thread Jerry via Digitalmars-d-learn
On Saturday, 14 October 2017 at 14:23:34 UTC, piotrklos wrote: On Saturday, 14 October 2017 at 13:20:27 UTC, Jerry wrote: On Saturday, 14 October 2017 at 10:15:53 UTC, evilrat wrote: webfreak's NativeDebug extension to be able to click to set breakpoint on lines(only for that). You can just

Re: Two way struct wrapper

2017-10-14 Thread drug via Digitalmars-d-learn
14.10.2017 16:23, Alex пишет: On Saturday, 14 October 2017 at 12:39:17 UTC, Alex wrote: ok, the last version for now. Without assumptions on alias number. Sorry for noise. https://run.dlang.io/is/OSJYtY That's cool, but unfortunately demands access to source code of Foo, it's not my case( I

Re: debugging in vs code on Windows

2017-10-14 Thread piotrklos via Digitalmars-d-learn
On Saturday, 14 October 2017 at 13:20:27 UTC, Jerry wrote: On Saturday, 14 October 2017 at 10:15:53 UTC, evilrat wrote: webfreak's NativeDebug extension to be able to click to set breakpoint on lines(only for that). You can just use VS Code setting, put the following into your settings.json

Re: Two way struct wrapper

2017-10-14 Thread Alex via Digitalmars-d-learn
On Saturday, 14 October 2017 at 12:39:17 UTC, Alex wrote: ok, the last version for now. Without assumptions on alias number. Sorry for noise. https://run.dlang.io/is/OSJYtY

Re: debugging in vs code on Windows

2017-10-14 Thread Jerry via Digitalmars-d-learn
On Saturday, 14 October 2017 at 10:15:53 UTC, evilrat wrote: webfreak's NativeDebug extension to be able to click to set breakpoint on lines(only for that). You can just use VS Code setting, put the following into your settings.json: "debug.allowBreakpointsEverywhere": true

Re: debugging in vs code on Windows

2017-10-14 Thread Jerry via Digitalmars-d-learn
On Friday, 13 October 2017 at 12:55:09 UTC, piotrklos wrote: I have windows 10, VS Code with code-d and C/C++ language extensions. I try to debug but it doesn't work. In particular, the debugging doesn't stop on breakpoints. It exits immediately. I recompile with -m64 and -g. I use dub to build

Re: Is there an opposite of .toString()?

2017-10-14 Thread myst via Digitalmars-d-learn
On Saturday, 14 October 2017 at 03:47:29 UTC, Jonathan M Davis wrote: The function to use for conversions in general is std.conv.to. And really, there isn't much of a reason to ever call toString. Functions like writeln, format, and to may use it internally, but it's more or less an anti-patter

Re: Two way struct wrapper

2017-10-14 Thread Alex via Digitalmars-d-learn
On Saturday, 14 October 2017 at 11:25:20 UTC, Alex wrote: of course, with the proper operator in line 32 return T(mixin("this" ~ op ~ "f")); https://run.dlang.io/is/jGKVYN

Re: Two way struct wrapper

2017-10-14 Thread Alex via Digitalmars-d-learn
On Wednesday, 11 October 2017 at 12:35:51 UTC, drug wrote: Using `alias this` it's easy to make wrapper for structure that calls wrapped structure methods like its own. This is one way - from wrapper to wrapped transformation. Is it possible to create the opposite way from wrapped to wrapper?

Re: Huge increase in UT compile time

2017-10-14 Thread Saurabh Das via Digitalmars-d-learn
On Saturday, 14 October 2017 at 09:03:05 UTC, Joakim wrote: On Saturday, 14 October 2017 at 04:36:25 UTC, Saurabh Das wrote: [...] I can reproduce on linux/x64, looks like a memory leak, as dmd balloons out to eat up all available memory until it's killed. I see it with this minimal command

Re: debugging in vs code on Windows

2017-10-14 Thread evilrat via Digitalmars-d-learn
On Saturday, 14 October 2017 at 07:40:31 UTC, piotrklos wrote: On Friday, 13 October 2017 at 17:04:00 UTC, kerdemdemir wrote: On Friday, 13 October 2017 at 12:55:09 UTC, piotrklos wrote: (...) I am using VisualD(https://github.com/dlang/visuald/releases) with vs2015 community version(free) a

Re: Assert and undefined behavior

2017-10-14 Thread Timon Gehr via Digitalmars-d-learn
On 14.10.2017 07:20, Jesse Phillips wrote: On Thursday, 12 October 2017 at 15:37:23 UTC, John Burton wrote: This is an example of what I mean :- undefined what it is meant to do anyway, so the compiler can "optimize" out the if condition as it only affects the case where the language doesn't

Re: Huge increase in UT compile time

2017-10-14 Thread Joakim via Digitalmars-d-learn
On Saturday, 14 October 2017 at 04:36:25 UTC, Saurabh Das wrote: On Wednesday, 11 October 2017 at 08:11:37 UTC, Jonathan M Davis wrote: On Wednesday, October 11, 2017 06:25:19 Dhananjay via Digitalmars-d-learn wrote: Hello, I am upgrading to DMD 2.076.1 from DMD 2.069.2 (similar results on 2.

Re: debugging in vs code on Windows

2017-10-14 Thread piotrklos via Digitalmars-d-learn
On Friday, 13 October 2017 at 17:04:00 UTC, kerdemdemir wrote: On Friday, 13 October 2017 at 12:55:09 UTC, piotrklos wrote: (...) I am using VisualD(https://github.com/dlang/visuald/releases) with vs2015 community version(free) and I can debug. I highly recommend it if you haven't tried yet.

Re: Assert and undefined behavior

2017-10-14 Thread Jonathan M Davis via Digitalmars-d-learn
On Saturday, October 14, 2017 05:20:47 Jesse Phillips via Digitalmars-d- learn wrote: > The point is assert tells the compiler something it can use to > reason about its job, not that it can insert additional runtime > checks to see if you code is invalid an then add new jumps to > execute whatever