Re: Debugging D code with GDB

2022-01-05 Thread Luís Ferreira via Digitalmars-d-learn
On Tue, 2021-11-30 at 09:01 +, Iain Buclaw via Digitalmars-d-learn wrote: > On Monday, 29 November 2021 at 14:48:21 UTC, Luís Ferreira wrote: > > On Sun, 2021-11-28 at 21:59 +, Iain Buclaw via > > Digitalmars-d-learn wrote: > > > > > > DMD doesn't emit this information. GDB can't work

Re: Debugging D code with GDB

2021-12-02 Thread Eduard Staniloiu via Digitalmars-d-learn
On Tuesday, 30 November 2021 at 09:01:38 UTC, Iain Buclaw wrote: On Monday, 29 November 2021 at 14:48:21 UTC, Luís Ferreira wrote: [...] Indeed, gdb assumes calling convention is same as default for target (actually its been years since I last looked, but are calling conventions tags in

Re: Debugging D code with GDB

2021-11-30 Thread Iain Buclaw via Digitalmars-d-learn
On Monday, 29 November 2021 at 14:48:21 UTC, Luís Ferreira wrote: On Sun, 2021-11-28 at 21:59 +, Iain Buclaw via Digitalmars-d-learn wrote: DMD doesn't emit this information. GDB can't work miracles when the compiler isn't pulling its own weight. I confirm this is an issue with DMD. I

Re: Debugging D code with GDB

2021-11-29 Thread Luís Ferreira via Digitalmars-d-learn
On Sun, 2021-11-28 at 21:59 +, Iain Buclaw via Digitalmars-d-learn wrote: > On Saturday, 27 November 2021 at 14:17:11 UTC, Eduard Staniloiu > wrote: > > Hello, > > > > I'm trying to use `gdb` to debug D binaries, but I'm having > > trouble accessing the methods of a struct or class. It

Re: Debugging D code with GDB

2021-11-28 Thread Iain Buclaw via Digitalmars-d-learn
On Saturday, 27 November 2021 at 14:17:11 UTC, Eduard Staniloiu wrote: Hello, I'm trying to use `gdb` to debug D binaries, but I'm having trouble accessing the methods of a struct or class. It seems that `gdb` doesn't see them. Given the following simple example ``` // test.d struct S {

Re: Debugging D code with GDB

2021-11-28 Thread user1234 via Digitalmars-d-learn
On Sunday, 28 November 2021 at 16:44:38 UTC, russhy wrote: On Sunday, 28 November 2021 at 14:53:17 UTC, user1234 wrote: ... there is a plugin to demangle things automatically https://github.com/ANtlord/gdb-ddemangle That's off-topic. The point here is that you can (unfortunately)

Re: Debugging D code with GDB

2021-11-28 Thread russhy via Digitalmars-d-learn
On Sunday, 28 November 2021 at 14:53:17 UTC, user1234 wrote: ... there is a plugin to demangle things automatically https://github.com/ANtlord/gdb-ddemangle

Re: Debugging D code with GDB

2021-11-28 Thread user1234 via Digitalmars-d-learn
On Saturday, 27 November 2021 at 14:17:11 UTC, Eduard Staniloiu wrote: Hello, I'm trying to use `gdb` to debug D binaries, but I'm having trouble accessing the methods of a struct or class. It seems that `gdb` doesn't see them. [...] Looking forward to your answers, Edi [0] -

Re: Debugging D code with GDB

2021-11-27 Thread Alexey via Digitalmars-d-learn
I found what Nemiver is much better for debugging D programs. With GDB I've got many problems, don't remember exactly. Thou I've used it through ddd, so maybe it's ddd problems, not exactly GDB's

Debugging D code with GDB

2021-11-27 Thread Eduard Staniloiu via Digitalmars-d-learn
Hello, I'm trying to use `gdb` to debug D binaries, but I'm having trouble accessing the methods of a struct or class. It seems that `gdb` doesn't see them. Given the following simple example ``` // test.d struct S { int x; void myPrint() { writefln("x is %s\n", x); } } void

Re: Debugging D applications from VS code with webfreak.debug

2017-07-10 Thread Domain via Digitalmars-d-learn
On Friday, 24 February 2017 at 13:19:53 UTC, FR wrote: On Friday, 24 February 2017 at 03:15:11 UTC, Jerry wrote: You can use the C++ plugin, which provides a debugger. Just make sure you aren't using optlink, I don't think it generates compatible files. Also you might need to use "-gc" which

Re: Debugging D applications from VS code with webfreak.debug

2017-02-24 Thread FR via Digitalmars-d-learn
On Friday, 24 February 2017 at 03:15:11 UTC, Jerry wrote: You can use the C++ plugin, which provides a debugger. Just make sure you aren't using optlink, I don't think it generates compatible files. Also you might need to use "-gc" which generates debug names to be in C format.

Re: Debugging D applications from VS code with webfreak.debug

2017-02-23 Thread Jerry via Digitalmars-d-learn
You can use the C++ plugin, which provides a debugger. Just make sure you aren't using optlink, I don't think it generates compatible files. Also you might need to use "-gc" which generates debug names to be in C format. https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools

Re: Debugging D applications from VS code with webfreak.debug

2017-02-23 Thread FR via Digitalmars-d-learn
On Thursday, 23 February 2017 at 17:54:09 UTC, FR wrote: gdb is in my path, I can run it from the command line. When I run 'gdb test.exe' (test.exe being the binary placed in my workspace folder), I get the error message "not in executable format: File format not recognized", whether I build

Re: Debugging D applications from VS code with webfreak.debug

2017-02-23 Thread FR via Digitalmars-d-learn
On Thursday, 23 February 2017 at 16:30:08 UTC, WebFreak001 wrote: I don't know how to build mago-mi either, but you can obtain it from the bundle with dlangide https://github.com/buggins/dlangide/releases/download/v0.6.11/dlangide-v0_6_11-bin-win32_x86-magomi-v0_3_1.zip Thanks, that got me

Re: Debugging D applications from VS code with webfreak.debug

2017-02-23 Thread WebFreak001 via Digitalmars-d-learn
On Thursday, 23 February 2017 at 16:28:26 UTC, FR wrote: Hi everyone, as the subject says, I'm trying to get a debugger running with visual studio code on windows. I have installed WebFreak001's code-d and debug extensions but fail to figure out how to install a working debugger. The gdb I

Re: Debugging D DLL from C# app with C linkage for native Unity 5 plugin

2016-03-30 Thread Thalamus via Digitalmars-d-learn
On Wednesday, 30 March 2016 at 07:38:07 UTC, Benjamin Thaut wrote: On Tuesday, 29 March 2016 at 23:41:28 UTC, Thalamus wrote: dmd dllmain.d dll.def -w -wi -g -map -ofLogic.dll -m64 -debug -shared Anyone know what I should try next? Am I missing something simple? :) thanks! Thalamus

Re: Debugging D DLL from C# app with C linkage for native Unity 5 plugin

2016-03-30 Thread Benjamin Thaut via Digitalmars-d-learn
On Tuesday, 29 March 2016 at 23:41:28 UTC, Thalamus wrote: dmd dllmain.d dll.def -w -wi -g -map -ofLogic.dll -m64 -debug -shared Anyone know what I should try next? Am I missing something simple? :) thanks! Thalamus You should be using "-gc" instead of "-g" when building 64-bit D

Re: Debugging D DLL from C# app with C linkage for native Unity 5 plugin

2016-03-30 Thread Rainer Schuetze via Digitalmars-d-learn
On 30.03.2016 01:41, Thalamus wrote: Apologies if this has been discussed before, but I wasn't able to find anything similar on the forums or web. I can't seem to figure out how to debug a D DLL from a C# EXE. (My actual purpose here is to use D to build native plugins for Unity 5, but Unity

Debugging D DLL from C# app with C linkage for native Unity 5 plugin

2016-03-29 Thread Thalamus via Digitalmars-d-learn
Apologies if this has been discussed before, but I wasn't able to find anything similar on the forums or web. I can't seem to figure out how to debug a D DLL from a C# EXE. (My actual purpose here is to use D to build native plugins for Unity 5, but Unity and Mono aren't necessary to repro the

Re: Debugging D shared libraries

2015-09-22 Thread Johannes Pfau via Digitalmars-d-learn
Am Tue, 22 Sep 2015 14:40:43 + schrieb John Colvin : > On Tuesday, 22 September 2015 at 14:37:11 UTC, Russel Winder > wrote: > > On Sun, 2015-09-20 at 17:47 +0200, Johannes Pfau via > > Digitalmars-d -learn wrote: > >> [...] > > […] > >> [...] > > > > Debian

Re: Debugging D shared libraries

2015-09-22 Thread Russel Winder via Digitalmars-d-learn
On Sun, 2015-09-20 at 17:49 +0200, Johannes Pfau via Digitalmars-d -learn wrote: > […] > > Just realized this thread is titled "Debugging D shared libraries" ; > -) > GDC does not yet support shared libraries. Conversely I thought it did due to the GCC toolchain thing

Re: Debugging D shared libraries

2015-09-22 Thread Russel Winder via Digitalmars-d-learn
On Sun, 2015-09-20 at 07:49 +, rom via Digitalmars-d-learn wrote: > […] > > works entirely fine. However the "parallel" code: > > > > extern(C) > > double parallel(const int n, const double delta) { > > Runtime.initialize(); > > const pi = 4.0 * delta * taskPool.reduce!"a

Re: Debugging D shared libraries

2015-09-22 Thread John Colvin via Digitalmars-d-learn
On Tuesday, 22 September 2015 at 14:37:11 UTC, Russel Winder wrote: On Sun, 2015-09-20 at 17:47 +0200, Johannes Pfau via Digitalmars-d -learn wrote: [...] […] [...] Debian Jessie is far too out of date to be useful. I'm on Debian Sid (still quite old), and Fedora Rawhide (not quite so

Re: Debugging D shared libraries

2015-09-22 Thread Russel Winder via Digitalmars-d-learn
On Sun, 2015-09-20 at 17:47 +0200, Johannes Pfau via Digitalmars-d -learn wrote: > Am Sat, 19 Sep 2015 17:41:41 +0100 > […] > > Have you tried using a newer GDC version? The debian jessie version > probably uses the 2.064.2 frontend. Debian Jessie is far too out of date to be useful. I'm on

Re: Debugging D shared libraries

2015-09-20 Thread rom via Digitalmars-d-learn
On Saturday, 19 September 2015 at 10:45:22 UTC, Russel Winder wrote: Calling D from Python. I have two functions in D, compiled to a shared object on Linux using LDC (but I get same problem using DMD). The sequential code: extern(C) double sequential(const int n, const double delta)

Re: Debugging D shared libraries

2015-09-20 Thread Martin Krejcirik via Digitalmars-d-learn
Dne 19. 9. 2015 v 18:41 Russel Winder via Digitalmars-d-learn napsal(a): > Indeed, it works well. Well for LDC. DMD and GDC are still broken. My > GDC problems are deeper that this code: Debian packages seem to have > weird problems and Fedora do not package GDC. All I need to do to make your

Re: Debugging D shared libraries

2015-09-20 Thread Johannes Pfau via Digitalmars-d-learn
Am Sat, 19 Sep 2015 17:41:41 +0100 schrieb Russel Winder via Digitalmars-d-learn : > On Sat, 2015-09-19 at 16:33 +, John Colvin via Digitalmars-d-learn > wrote: > > On Saturday, 19 September 2015 at 16:15:45 UTC, Russel Winder > > wrote: > > > Sadly the: >

Re: Debugging D shared libraries

2015-09-20 Thread Johannes Pfau via Digitalmars-d-learn
gt; > > Have you tried using a newer GDC version? The debian jessie version > probably uses the 2.064.2 frontend. > > I wanted to add @attribute(cctor/cdtor) support for some time now, I > even wrote the code some time but didn't push it to the main repo for > some reason. I'll put it on the TODO list but I can't work on this for > the next 2-3 weeks. Just realized this thread is titled "Debugging D shared libraries" ;-) GDC does not yet support shared libraries.

Re: Debugging D shared libraries

2015-09-20 Thread ponce via Digitalmars-d-learn
On Saturday, 19 September 2015 at 17:02:37 UTC, Russel Winder wrote: English and Spanish meanings of the word are very different. In UK (not sure about Canada, USA, Australia, New Zealand, South Africa,…) it is generally a somewhat derogatory term. In French it means "to rub down with

Re: Debugging D shared libraries

2015-09-19 Thread Laeeth Isharc via Digitalmars-d-learn
On Saturday, 19 September 2015 at 17:41:39 UTC, Laeeth Isharc wrote: On Saturday, 19 September 2015 at 10:45:22 UTC, Russel Winder wrote: Calling D from Python. I have two functions in D, compiled to a shared object on Linux using LDC (but I get same problem using DMD). The sequential code:

Debugging D shared libraries

2015-09-19 Thread Russel Winder via Digitalmars-d-learn
Calling D from Python. I have two functions in D, compiled to a shared object on Linux using LDC (but I get same problem using DMD). The sequential code: extern(C) double sequential(const int n, const double delta) { Runtime.initialize(); const pi = 4.0 * delta * reduce!(

Re: Debugging D shared libraries

2015-09-19 Thread John Colvin via Digitalmars-d-learn
On Saturday, 19 September 2015 at 10:45:22 UTC, Russel Winder wrote: Calling D from Python. I have two functions in D, compiled to a shared object on Linux using LDC (but I get same problem using DMD). [...] I heard it crashed during the talk. Bummer. I should really be there, seeing as I

Re: Debugging D shared libraries

2015-09-19 Thread ponce via Digitalmars-d-learn
On Saturday, 19 September 2015 at 10:45:22 UTC, Russel Winder wrote: Calling D from Python. I have two functions in D, compiled to a shared object on Linux using LDC (but I get same problem using DMD). The sequential code: extern(C) double sequential(const int n, const double delta)

Re: Debugging D shared libraries

2015-09-19 Thread Laeeth Isharc via Digitalmars-d-learn
On Saturday, 19 September 2015 at 10:45:22 UTC, Russel Winder wrote: Calling D from Python. I have two functions in D, compiled to a shared object on Linux using LDC (but I get same problem using DMD). The sequential code: extern(C) double sequential(const int n, const double delta)

Re: Debugging D shared libraries

2015-09-19 Thread Russel Winder via Digitalmars-d-learn
On Sat, 2015-09-19 at 12:21 +, ponce via Digitalmars-d-learn wrote: > […] > > Try using an explicit TaskPool and destroying it with scope(exit). > > > Also if using LDC, you can use global ctor/dtor to deal with the > runtime. > > > --->8- > >

Re: Debugging D shared libraries

2015-09-19 Thread Russel Winder via Digitalmars-d-learn
On Sat, 2015-09-19 at 15:58 +, ponce via Digitalmars-d-learn wrote: > On Saturday, 19 September 2015 at 15:42:15 UTC, Russel Winder > wrote: > > > > Hummm… I now do not get a segfault, and the code runs as > > expected : > > -) but the program never terminates. :-( > > Where is it

Re: Debugging D shared libraries

2015-09-19 Thread Russel Winder via Digitalmars-d-learn
On Sat, 2015-09-19 at 11:07 +, John Colvin via Digitalmars-d-learn wrote: > […] > I heard it crashed during the talk. Bummer. I should really be > there, seeing as I live about 15 mins away. If you get a chance > to talk to Alex Bishop, don't be too harsh on D to him, I'm > trying to

Re: Debugging D shared libraries

2015-09-19 Thread John Colvin via Digitalmars-d-learn
On Saturday, 19 September 2015 at 16:25:28 UTC, Laeeth Isharc wrote: On Saturday, 19 September 2015 at 12:21:02 UTC, ponce wrote: [...] What is the difference between shared static this and the global constructor ? Russell, if you use shared static this for dmd does it work ? Laeeth.

Re: Debugging D shared libraries

2015-09-19 Thread Russel Winder via Digitalmars-d-learn
On Sat, 2015-09-19 at 17:15 +0100, Russel Winder wrote: > […] > Sadly the: > > pragma(LDC_global_crt_ctor, 0) > void initRuntime() { > import core.runtime: Runtime; > Runtime.initialize(); >} > > will not compile under DMD :-( On the otherhand using a: version(LDC) {

Re: Debugging D shared libraries

2015-09-19 Thread John Colvin via Digitalmars-d-learn
On Saturday, 19 September 2015 at 16:15:45 UTC, Russel Winder wrote: Sadly the: pragma(LDC_global_crt_ctor, 0) void initRuntime() { import core.runtime: Runtime; Runtime.initialize(); } will not compile under DMD :-( version(LDC){ /* ... */ } not that it helps make

Re: Debugging D shared libraries

2015-09-19 Thread Russel Winder via Digitalmars-d-learn
On Sat, 2015-09-19 at 16:33 +, John Colvin via Digitalmars-d-learn wrote: > On Saturday, 19 September 2015 at 16:15:45 UTC, Russel Winder > wrote: > > Sadly the: > > > > pragma(LDC_global_crt_ctor, 0) > > void initRuntime() { > > import core.runtime: Runtime; > >

Re: Debugging D shared libraries

2015-09-19 Thread ponce via Digitalmars-d-learn
On Saturday, 19 September 2015 at 16:32:18 UTC, Russel Winder wrote: (*) ponce is arguably not the most positive or constructive name to go by. Friend call me like this IRL since forever. It seems to be a swear word in english?

Re: Debugging D shared libraries

2015-09-19 Thread Laeeth Isharc via Digitalmars-d-learn
On Saturday, 19 September 2015 at 16:34:05 UTC, John Colvin wrote: On Saturday, 19 September 2015 at 16:25:28 UTC, Laeeth Isharc wrote: On Saturday, 19 September 2015 at 12:21:02 UTC, ponce wrote: [...] What is the difference between shared static this and the global constructor ? Russell,

Re: Debugging D shared libraries

2015-09-19 Thread ponce via Digitalmars-d-learn
On Saturday, 19 September 2015 at 15:42:15 UTC, Russel Winder wrote: Hummm… I now do not get a segfault, and the code runs as expected : -) but the program never terminates. :-( Where is it stuck? Also, what would I need to cover the DMD and the GDC situations? I don't know. :(

Re: Debugging D shared libraries

2015-09-19 Thread Laeeth Isharc via Digitalmars-d-learn
On Saturday, 19 September 2015 at 12:21:02 UTC, ponce wrote: On Saturday, 19 September 2015 at 10:45:22 UTC, Russel Winder wrote: Calling D from Python. I have two functions in D, compiled to a shared object on Linux using LDC (but I get same problem using DMD). The sequential code:

Re: Debugging D shared libraries

2015-09-19 Thread ponce via Digitalmars-d-learn
On Saturday, 19 September 2015 at 16:25:28 UTC, Laeeth Isharc wrote: What is the difference between shared static this and the global constructor ? Russell, if you use shared static this for dmd does it work ? Laeeth. Would like to know too. On OSX I've found that shared static this()

Re: Debugging D shared libraries

2015-09-19 Thread Russel Winder via Digitalmars-d-learn
On Sat, 2015-09-19 at 16:25 +, Laeeth Isharc via Digitalmars-d -learn wrote: > […] > What is the difference between shared static this and the global > constructor ? Russell, if you use shared static this for dmd > does it work ? Laeeth. I had no idea what to put in a: shared static

Re: Debugging D shared libraries

2015-09-19 Thread Russel Winder via Digitalmars-d-learn
On Sat, 2015-09-19 at 16:41 +, ponce via Digitalmars-d-learn wrote: > […] > Friend call me like this IRL since forever. > > It seems to be a swear word in english? English and Spanish meanings of the word are very different. In UK (not sure about Canada, USA, Australia, New Zealand, South

Debugging D in MonoDevelop, finding multiple gdb processes?

2015-06-10 Thread Rodger Beats via Digitalmars-d-learn
I'm new to the language and new to using MonoDevelop and I've got this persistent problem that I haven't been able to solve with Google searching. I frequently test out my code as I write it and every time I start it up a new gdb process will start running but not terminate at the end of the

Re: Debugging D in MonoDevelop, finding multiple gdb processes?

2015-06-10 Thread michaelc37 via Digitalmars-d-learn
i am assuming you are using the built in gdb debugger. a) you can try using this addin Gdb.D instead -https://github.com/llucenic/MonoDevelop.Debugger.Gdb.D it might be also be in the monodevelop beta repos. b) you can fix/work around the issue by replacing Syscall.kill in the source

Re: Debugging D?

2011-02-07 Thread Robert Clipsham
On 06/02/11 22:28, Sean Eskapp wrote: == Quote from Robert Clipsham (rob...@octarineparrot.com)'s article On 06/02/11 20:29, Sean Eskapp wrote: Are debug symbols compiled with -gc stored in a separate file? Visual Studio refuses to debug my things, and windbg seems to be remarkably unhelpful.

Debugging D?

2011-02-06 Thread Sean Eskapp
Are debug symbols compiled with -gc stored in a separate file? Visual Studio refuses to debug my things, and windbg seems to be remarkably unhelpful.

Re: Debugging D?

2011-02-06 Thread Trass3r
Are debug symbols compiled with -gc stored in a separate file? Visual Studio refuses to debug my things Nope. Plus you need to use cv2pdb to debug with Visual

Re: Debugging D?

2011-02-06 Thread Robert Clipsham
On 06/02/11 20:29, Sean Eskapp wrote: Are debug symbols compiled with -gc stored in a separate file? Visual Studio refuses to debug my things, and windbg seems to be remarkably unhelpful. I suggest you take a look at VisualD if you're using visual studio, it will handle converting debug info

Re: Debugging D?

2011-02-06 Thread Sean Eskapp
== Quote from Robert Clipsham (rob...@octarineparrot.com)'s article On 06/02/11 20:29, Sean Eskapp wrote: Are debug symbols compiled with -gc stored in a separate file? Visual Studio refuses to debug my things, and windbg seems to be remarkably unhelpful. I suggest you take a look at VisualD