Re: gdb + Windows 64: No debugging symbols found

2020-12-26 Thread Виталий Фадеев via Digitalmars-d-learn
On Saturday, 26 December 2020 at 14:10:46 UTC, Basile B. wrote: On Saturday, 26 December 2020 at 11:55:58 UTC, Виталий Фадеев wrote: We have: [...] Problem is: $ gdb ./app.exe GNU gdb (GDB) 9.2 ... (No debugging symbols found in ./app.exe) What is a right way to build .exe and

Re: Get the code of any D-entity as string?

2020-12-26 Thread Max Haughton via Digitalmars-d-learn
On Friday, 25 December 2020 at 21:25:40 UTC, sighoya wrote: I've read a bit in Dlang traits. It now has the ability to retrieve all method signatures of an overload set. Big plus from me. Is generally possible to get the declaration of a type/module/value as string in traits? I didn't

Re: Reading files using delimiters/terminators

2020-12-26 Thread Ali Çehreli via Digitalmars-d-learn
On 12/26/20 4:13 PM, Rekel wrote: I'm trying to read a file with entries seperated by '\n\n' (empty line), with entries containing '\n'. I thought the File.readLine(KeepTerminator, Terminator) might work, as it seems to accept strings as terminators, since there seems to have been a thread

Re: Reading files using delimiters/terminators

2020-12-26 Thread Jesse Phillips via Digitalmars-d-learn
On Sunday, 27 December 2020 at 00:13:30 UTC, Rekel wrote: I'm trying to read a file with entries seperated by '\n\n' (empty line), with entries containing '\n'. I thought the File.readLine(KeepTerminator, Terminator) might work, as it seems to accept strings as terminators, since there seems

Reading files using delimiters/terminators

2020-12-26 Thread Rekel via Digitalmars-d-learn
I'm trying to read a file with entries seperated by '\n\n' (empty line), with entries containing '\n'. I thought the File.readLine(KeepTerminator, Terminator) might work, as it seems to accept strings as terminators, since there seems to have been a thread regarding '\r\n' seperators. I

Re: Get the code of any D-entity as string?

2020-12-26 Thread Basile B. via Digitalmars-d-learn
On Saturday, 26 December 2020 at 12:38:21 UTC, sighoya wrote: On Friday, 25 December 2020 at 23:04:15 UTC, Ali Çehreli wrote: I am probably misunderstanding it but there is the .stringof property for all types: T.stringof. But does stringof really print the declaration as string and not the

Re: Surprising behaviour of std.experimental.allocator

2020-12-26 Thread ag0aep6g via Digitalmars-d-learn
On 26.12.20 13:59, ag0aep6g wrote: Looks like a pretty nasty bug somewhere in std.experimental.allocator or (less likely) the GC. Further reduced code: [...] Apparently, something calls deallocateAll on a Mallocator instance after the memory of that instance has been recycled by

Re: visibility of private Class C in module named "C"; private variables in modules

2020-12-26 Thread kdevel via Digitalmars-d-learn
On Saturday, 26 December 2020 at 18:43:19 UTC, kdevel wrote: $ dmd main.d $ dmd -i main

Re: visibility of private Class C in module named "C"; private variables in modules

2020-12-26 Thread kdevel via Digitalmars-d-learn
On Saturday, 26 December 2020 at 17:48:17 UTC, Mike Parker wrote: On Saturday, 26 December 2020 at 15:58:30 UTC, kdevel wrote: package class Private { void foo () { __PRETTY_FUNCTION__.writeln; } } import Private; auto p = new Private; // works, but Private.Private is private ?!?

Re: visibility of private Class C in module named "C"; private variables in modules

2020-12-26 Thread Mike Parker via Digitalmars-d-learn
On Saturday, 26 December 2020 at 15:58:30 UTC, kdevel wrote: package class Private { void foo () { __PRETTY_FUNCTION__.writeln; } } import Private; auto p = new Private; // works, but Private.Private is private ?!? You've declared `Private` as `package`.

visibility of private Class C in module named "C"; private variables in modules

2020-12-26 Thread kdevel via Digitalmars-d-learn
~~~Private.d module Private; class A {} private class B {} package class Private { void foo () { __PRETTY_FUNCTION__.writeln; } } ~~~ ~~~main.d void main () { import Private: A; // okay // import Private: B; // main.d(4): Error: module Private member B // is

Re: gdb + Windows 64: No debugging symbols found

2020-12-26 Thread Basile B. via Digitalmars-d-learn
On Saturday, 26 December 2020 at 11:55:58 UTC, Виталий Фадеев wrote: We have: [...] Problem is: $ gdb ./app.exe GNU gdb (GDB) 9.2 ... (No debugging symbols found in ./app.exe) What is a right way to build .exe and debug with gdb ? Try to build with latest version of LDC and

Re: gdb + Windows 64: No debugging symbols found

2020-12-26 Thread Mike Parker via Digitalmars-d-learn
On Saturday, 26 December 2020 at 11:55:58 UTC, Виталий Фадеев wrote: Problem is: $ gdb ./app.exe GNU gdb (GDB) 9.2 ... (No debugging symbols found in ./app.exe) What is a right way to build .exe and debug with gdb ? The version of gdb that ships with MSYS is probably going

Re: Surprising behaviour of std.experimental.allocator

2020-12-26 Thread ag0aep6g via Digitalmars-d-learn
On 24.12.20 17:12, Saurabh Das wrote: This causes a segfault when run with rdmd -gx: [...] (Tested on DMD 2.094.2 and on https://run.dlang.io/is/p0FsOQ) If the "GC.collect()" line is commented out, it works somehow. Please help me understand why this is happening. This is a very reduced

Re: Get the code of any D-entity as string?

2020-12-26 Thread sighoya via Digitalmars-d-learn
On Friday, 25 December 2020 at 23:04:15 UTC, Ali Çehreli wrote: I am probably misunderstanding it but there is the .stringof property for all types: T.stringof. But does stringof really print the declaration as string and not the type name itself? I found:

gdb + Windows 64: No debugging symbols found

2020-12-26 Thread Виталий Фадеев via Digitalmars-d-learn
We have: // app.d import std.stdio; void main() { writeln( "OK" ); } Build: dmd -m64 -g app.d OS: Windows 10, x86_64 MSYS2: gdb Goal: gdb app.exe Problem is: $ gdb ./app.exe GNU gdb (GDB) 9.2 ... (No debugging symbols found in

Re: Surprising behaviour of std.experimental.allocator

2020-12-26 Thread Kagamin via Digitalmars-d-learn
Try to compile in debug mode, maybe you breach some contract.