www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - D and GDB

reply Russel Winder via Digitalmars-d-learn <digitalmars-d-learn puremagic.com> writes:
I thought I had left SIGSEGV debugging behind, but it seems not.
However whilst the C++/CLion debug tooling is excellent, D seems to be
without. I guess there must be some gdb magic I am missing, but:


Program received signal SIGSEGV, Segmentation fault.
0x00007fffffffc788 in ?? ()
gdb>b
Breakpoint 1 at 0x7fffffffc788
gdb>

Not the most illuminating backtrace I have seen.

--=20
Russel.
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D
Dr Russel Winder      t: +44 20 7585 2200   voip: sip:russel.winder ekiga.n=
et
41 Buckmaster Road    m: +44 7770 465 077   xmpp: russel winder.org.uk
London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder
Jun 04 2017
parent reply ketmar <ketmar ketmar.no-ip.org> writes:
Russel Winder wrote:

 I thought I had left SIGSEGV debugging behind, but it seems not.
 However whilst the C++/CLion debug tooling is excellent, D seems to be
 without. I guess there must be some gdb magic I am missing, but:


 Program received signal SIGSEGV, Segmentation fault.
 0x00007fffffffc788 in ?? ()
 gdb>b
 Breakpoint 1 at 0x7fffffffc788
 gdb>

 Not the most illuminating backtrace I have seen.
maybe 'cause backtrace is called with `bt` command? ;-)
Jun 04 2017
next sibling parent Russel Winder via Digitalmars-d-learn <digitalmars-d-learn puremagic.com> writes:
On Sun, 2017-06-04 at 20:31 +0300, ketmar via Digitalmars-d-learn
wrote:
=20
[=E2=80=A6]
 maybe 'cause backtrace is called with `bt` command? ;-)
:-) Well it is 14 years since I started a gdb instance. --=20 Russel. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D Dr Russel Winder t: +44 20 7585 2200 voip: sip:russel.winder ekiga.n= et 41 Buckmaster Road m: +44 7770 465 077 xmpp: russel winder.org.uk London SW11 1EN, UK w: www.russel.org.uk skype: russel_winder
Jun 04 2017
prev sibling parent reply Russel Winder via Digitalmars-d-learn <digitalmars-d-learn puremagic.com> writes:
On Sun, 2017-06-04 at 20:31 +0300, ketmar via Digitalmars-d-learn
wrote:
=20
=20
 maybe 'cause backtrace is called with `bt` command? ;-)
Sadly even using the correct command, I am not getting any data that 86_64-linux-gnu/libdvbv5.so.0 PS6dvb_fe15dvb_v5_fe_parmsPS8dvb_file9dvb_entryiPUPvPS6dvb_fe15dvb_v5_fe_pa= rmsZikkZS8libdvbv515ScanHandler_Ptr (this=3D..., frontendParameters=3D0x555= 5557b4830,=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0entry=3D0x5555557aa0b0, dmx_fd=3D4, check_frontend= =3D0x55555556f730 <checkFrontend>, other_nit=3D0, timeout_multiplier=3D1) a= t /home/users/russel/Repositories/Git/Masters/DVBTune/source/libdvbv5.d:140 ibdvbv510FrontendIdxkxkxkxkxbZC8channels12ChannelsData (this=3D..., fei=3D.= .., other_nit=3D0, timeout_multiplier=3D1, get_detected=3D1, get_nit=3D1,= =C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0dont_add_new_frequencies=3Dfalse) at /home/users/ru= ssel/Repositories/Git/Masters/DVBTune/source/channels.d:159 el/Repositories/Git/Masters/DVBTune/source/main.d:35 --=20 Russel. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D Dr Russel Winder t: +44 20 7585 2200 voip: sip:russel.winder ekiga.n= et 41 Buckmaster Road m: +44 7770 465 077 xmpp: russel winder.org.uk London SW11 1EN, UK w: www.russel.org.uk skype: russel_winder
Jun 04 2017
next sibling parent reply Basile B. <b2.temp gmx.com> writes:
On Sunday, 4 June 2017 at 18:13:41 UTC, Russel Winder wrote:
 Sadly even using the correct command, I am not getting any data 





 /usr/lib/x86_64-linux-gnu/libdvbv5.so.0

 _D8libdvbv515ScanHandler_Ptr6__ctorMFNcPS6dvb_fe15dvb_v5_fe_parmsPS8dvb_file9dvb_entryiPUPvPS6dvb_fe15dvb_v5_fe_parmsZikkZS8libdv
v515ScanHandler_Ptr (this=..., frontendParameters=0x5555557b4830,
     entry=0x5555557aa0b0, dmx_fd=4, 
 check_frontend=0x55555556f730 <checkFrontend>, other_nit=0, 
 timeout_multiplier=1) at 
 /home/users/russel/Repositories/Git/Masters/DVBTune/source/libdvbv5.d:140

 _D8channels15TransmitterData4scanMFxS8libdvbv510FrontendIdxkxkxkxkxbZC8ch
nnels12ChannelsData (this=..., fei=..., other_nit=0, timeout_multiplier=1,
get_detected=1, get_nit=1,
     dont_add_new_frequencies=false) at 
 /home/users/russel/Repositories/Git/Masters/DVBTune/source/channels.d:159

 /home/users/russel/Repositories/Git/Masters/DVBTune/source/main.d:35
you have to pipe the output to ddemangle. Personally i don't know how to do this by hand since my IDE does the task automatically (http://bbasile.github.io/Coedit/widgets_gdb_commander). Also i suppose you compiled with -g -gs ?
Jun 04 2017
next sibling parent Paolo Invernizzi <paolo.invernizzi gmail.com> writes:
On Sunday, 4 June 2017 at 19:24:17 UTC, Basile B. wrote:
 On Sunday, 4 June 2017 at 18:13:41 UTC, Russel Winder wrote:
 [...]
you have to pipe the output to ddemangle. Personally i don't know how to do this by hand since my IDE does the task automatically (http://bbasile.github.io/Coedit/widgets_gdb_commander). Also i suppose you compiled with -g -gs ?
at `libdvbv5.d:140` you are calling the native `dvb_scan_transponder` in `libdvbv5.so` that's segfaulting... Try to just log the arguments values you are using there... /Paolo
Jun 04 2017
prev sibling parent reply "H. S. Teoh via Digitalmars-d-learn" <digitalmars-d-learn puremagic.com> writes:
On Sun, Jun 04, 2017 at 07:24:17PM +0000, Basile B. via Digitalmars-d-learn
wrote:
[...]
 you have to pipe the output to ddemangle.
Here's the output:


 /usr/lib/x86_64-linux-gnu/libdvbv5.so.0

libdvbv5.ScanHandler_Ptr.__ctor(dvb_fe.dvb_v5_fe_parms*, dvb_file.dvb_entry*,
int, extern (C) int function(void*, dvb_fe.dvb_v5_fe_parms*)*, uint, uint)
 (this=..., frontendParameters=0x5555557b4830,
     entry=0x5555557aa0b0, dmx_fd=4, check_frontend=0x55555556f730
 <checkFrontend>, other_nit=0, timeout_multiplier=1) at
 /home/users/russel/Repositories/Git/Masters/DVBTune/source/libdvbv5.d:140

channels.TransmitterData.scan(const(libdvbv5.FrontendId), const(uint),
const(uint), const(uint), const(uint), const(bool))
 (this=..., fei=..., other_nit=0, timeout_multiplier=1, get_detected=1,
 get_nit=1,
     dont_add_new_frequencies=false) at
 /home/users/russel/Repositories/Git/Masters/DVBTune/source/channels.d:159

 /home/users/russel/Repositories/Git/Masters/DVBTune/source/main.d:35
The ?? on the first line is probably a function that has no debugging info, perhaps from a library that wasn't compiled with debugging symbols added.
 Personally i don't know how to do this by hand since my IDE does the
 task automatically
 (http://bbasile.github.io/Coedit/widgets_gdb_commander).
It can't be any more trivial than just running ddemangle, which is found in the dlang/tools repo on github. (Arguably this should be shipped by default with dmd... or is it already?) T -- My program has no bugs! Only unintentional features...
Jun 04 2017
next sibling parent reply Basile B. <b2.temp gmx.com> writes:
On Monday, 5 June 2017 at 01:07:51 UTC, H. S. Teoh wrote:
 It can't be any more trivial than just running ddemangle, which 
 is found in the dlang/tools repo on github.
Trivial i don't know but i had the feeling that the OP complained about the stack trace not being readable although all the answers went in another direction.
 (Arguably this should be shipped by default with dmd... or is 
 it already?)
Of course it is. Currently i don't use it much but at the beginning of 2017 it's been very useful to me, to process valgrind's output, dozen and dozen of times. How can anyone ignore that it's shipped with dmd ?
Jun 04 2017
parent "H. S. Teoh via Digitalmars-d-learn" <digitalmars-d-learn puremagic.com> writes:
On Mon, Jun 05, 2017 at 05:34:14AM +0000, Basile B. via Digitalmars-d-learn
wrote:
 On Monday, 5 June 2017 at 01:07:51 UTC, H. S. Teoh wrote:
 
 It can't be any more trivial than just running ddemangle, which is
 found in the dlang/tools repo on github.
[...]
 (Arguably this should be shipped by default with dmd... or is it
 already?)
Of course it is. Currently i don't use it much but at the beginning of 2017 it's been very useful to me, to process valgrind's output, dozen and dozen of times. How can anyone ignore that it's shipped with dmd ?
'cos I run dmd off git HEAD, so I've no idea what it ships with/without. :-D T -- My program has no bugs! Only undocumented features...
Jun 05 2017
prev sibling parent Mike Wey <mike-wey example.com> writes:
On 06/05/2017 03:07 AM, H. S. Teoh via Digitalmars-d-learn wrote:
 It can't be any more trivial than just running ddemangle, which is found
 in the dlang/tools repo on github. (Arguably this should be shipped by
 default with dmd... or is it already?)
 
Recent? versions of gdb also support demangling D symbols, it should detect it's D when you compile with -g. -- Mike Wey
Jun 05 2017
prev sibling next sibling parent Jacob Carlborg <doob me.com> writes:
On 2017-06-04 20:13, Russel Winder via Digitalmars-d-learn wrote:
 On Sun, 2017-06-04 at 20:31 +0300, ketmar via Digitalmars-d-learn
 wrote:
 maybe 'cause backtrace is called with `bt` command? ;-)
Sadly even using the correct command, I am not getting any data that
If you refer to ??, I'm guessing that's inside libdvbv5.so which might not have been compiled with debug information enabled. -- /Jacob Carlborg
Jun 04 2017
prev sibling parent Stefan Koch <uplink.coder googlemail.com> writes:
On Sunday, 4 June 2017 at 18:13:41 UTC, Russel Winder wrote:
 On Sun, 2017-06-04 at 20:31 +0300, ketmar via 
 Digitalmars-d-learn wrote:
 [...]
Sadly even using the correct command, I am not getting any data [...]
My guess is a null pointer :) check your pointers :)
Jun 04 2017