digitalmars.D - Compiling D files on Windows
- Larry Hemsley (17/17) Nov 16 2022 It has been a long time since I have tried to compile D files
- Adam D Ruppe (7/13) Nov 16 2022 Are you sure about that? I thought gdb expected the dwarf format
- jussij (21/24) Nov 16 2022 Zeus ships with a version of gdb, so the problem you are seeing
- torhu (4/10) Nov 16 2022 Does it help to pass the -m32omf switch to dmd? IIRC, it will
- torhu (8/20) Nov 16 2022 It seems you used to be able to do this with much older versions
- rikki cattermole (3/3) Nov 16 2022 Your best bet is probably using ldc instead, with:
- Larry Hemsley (10/14) Nov 20 2022 Using ldc2 with the --gdwarf switch worked to get the symbols where
- Adam D Ruppe (3/5) Nov 20 2022 sorry for not saying something sooner, we got 5 feet of snow here
- rikki cattermole (2/2) Nov 20 2022 I made that mistake once.
It has been a long time since I have tried to compile D files or build a D project on Windows. I was surprised since I asked for verbose output to see that the Windows native linker was called. I was also surprised to see the pdb file in the project folder. The problem is that the IDE I was using (Zeus) uses gdb to debug files and the debugger issued a warning that there were no debug symbols in the executable file. Obviously, because gdb expects code view style debug symbols to be embedded in the executable. If any one knows of a magic switch (undocumented or documented) that reverts to the older code view style, I would be very thankful to know it. I do know that cl.exe does have a compiler switch for this, but I do not know if dmd calls cl.exe to do the linking. From the verbose output it looks like dmd calls the Windows native linker directly. Thanks for helping Larry
Nov 16 2022
On Wednesday, 16 November 2022 at 22:02:41 UTC, Larry Hemsley wrote:Obviously, because gdb expects code view style debug symbols to be embedded in the executable.Are you sure about that? I thought gdb expected the dwarf format even on windows.I do know that cl.exe does have a compiler switch for this, but I do not know if dmd calls cl.exe to do the linking. From the verbose output it looks like dmd calls the Windows native linker directly.Maybe try running cl with its verbose output and see how it calls the linker, the switch should be there passed to the linker somehow then you can have dmd pass it too with the -L switch.
Nov 16 2022
On Wednesday, 16 November 2022 at 22:02:41 UTC, Larry Hemsley wrote:The problem is that the IDE I was using (Zeus) uses gdb to debug files and the debugger issued a warning that there were no debug symbols in the executable file.Zeus ships with a version of gdb, so the problem you are seeing might be related to that version of gdb. To test for this, I'd suggest using the Windows, Start Run button to create a command line prompt and try using an alternative version of gdb to debug your executable directly from that command line. But don't use a command prompt created from within Zeus itself only because that will have the PATH set so that it finds the Zeus version of gdb. If by using an alternative version of gdb you can debug your executable that will mean this is an issue with Zeus. However, if you get the same error in both cases then at least you'll know the problem lies elsewhere.
Nov 16 2022
On Wednesday, 16 November 2022 at 22:02:41 UTC, Larry Hemsley wrote:If any one knows of a magic switch (undocumented or documented) that reverts to the older code view style, I would be very thankful to know it. I do know that cl.exe does have a compiler switch for this, but I do not know if dmd calls cl.exe to do the linking. From the verbose output it looks like dmd calls the Windows native linker directly.Does it help to pass the -m32omf switch to dmd? IIRC, it will output CodeView format then.
Nov 16 2022
On Wednesday, 16 November 2022 at 23:16:32 UTC, torhu wrote:On Wednesday, 16 November 2022 at 22:02:41 UTC, Larry Hemsley wrote:It seems you used to be able to do this with much older versions of the Microsoft linker by using the /PDB:NONE option, but this is no longer the case: "It is not possible to create an .exe or .dll that contains debug information. Debug information is always placed in a .obj or .pdb file." https://learn.microsoft.com/en-us/cpp/build/reference/debug-generate-debug-info?view=msvc-170If any one knows of a magic switch (undocumented or documented) that reverts to the older code view style, I would be very thankful to know it. I do know that cl.exe does have a compiler switch for this, but I do not know if dmd calls cl.exe to do the linking. From the verbose output it looks like dmd calls the Windows native linker directly.Does it help to pass the -m32omf switch to dmd? IIRC, it will output CodeView format then.
Nov 16 2022
Your best bet is probably using ldc instead, with: --gdwarf - Emit DWARF debuginfo (instead of CodeView) for MSVC targets
Nov 16 2022
On 11/16/22 4:48 PM, rikki cattermole wrote:Your best bet is probably using ldc instead, with: --gdwarf - Emit DWARF debuginfo (instead of CodeView) for MSVC targetsUsing ldc2 with the --gdwarf switch worked to get the symbols where the debugger could use them. Unfortunately the debugger that Zeus uses does not work very well. I apologize for replying directly to each person that gave me segestions. I didn't know that Thunderbird had a reply to list option on its menu. Live and learn, I don't reply very often or even post to this forum or any other for that matter. Again Thanks for the Help Larry
Nov 20 2022
On Sunday, 20 November 2022 at 22:34:49 UTC, Larry Hemsley wrote:I apologize for replying directly to each person that gave me segestionssorry for not saying something sooner, we got 5 feet of snow here friday so ive been pretty occupied digging lol
Nov 20 2022