digitalmars.D.learn - Latest GDB version problems
- Piotrek (39/39) May 10 2010 Hi,
- Piotrek (2/7) May 10 2010 The dmd version is 2.045.
- Robert Clipsham (16/27) May 10 2010 You are not using a version of gdb with D support if s is not displayed
- Piotrek (10/24) May 10 2010 (gdb) p s
- sha0coder (10/20) Jun 01 2013 try this:
- sha0coder (7/19) Jun 01 2013 add this macro to your ~/.gdbinit
- dennis luehring (2/24) Jun 01 2013
- David (3/35) Jun 02 2013 And still, gdb doesn't recognize D strings.
- Brad Roberts (7/38) May 10 2010 For what it's worth, I've still had lots of problems with gdb (from cvs)...
Hi, I tried to debug program in gdb (with d support) but with no big success. I'm on kubuntu 10.04 I compiled gdb from trunk. 7.1.50.20100504 I use the -gc switch with dmd of course. With this example (brakeboint at line 8) 1. import std.stdio; 2. 3. 4. void main() 5. { 6. int i = 1; 7. string s = "Hello"; 8. float f; 9. } gdb produces: (gdb) info locals i = 1 s = 578159222890430469 f = 9.55146781e-38 (gdb) show language The current source language is "auto; currently d". worse is that following example: 1. import std.stdio; 2. 3. 4. void main() 5. { 6. int i = 1; 7. string s = "Hello"; 8. float f; 9. writeln ("Hello"); 10.} gives seg falut: Reading symbols from /home/pio/dev/d/projects/cb_test/hello...Segmentation fault Does anyone can work with gdb on linux? Cheers Piotrek
May 10 2010
W dniu 10.05.2010 20:48, Piotrek pisze:Hi, I tried to debug program in gdb (with d support) but with no big success. I'm on kubuntu 10.04 I compiled gdb from trunk. 7.1.50.20100504 I use the -gc switch with dmd of course.The dmd version is 2.045.
May 10 2010
On 10/05/10 19:48, Piotrek wrote:(gdb) info locals i = 1 s = 578159222890430469 f = 9.55146781e-38 (gdb) show language The current source language is "auto; currently d".You are not using a version of gdb with D support if s is not displayed as a string. This said, I've only ever looked at variables using print or a backtrace, could you try 'p s' and see what result it gives? If it's the same you aren't using a D capable version of gdb. This said, it should be working in that version of gdb, I guess there's some other issues there if this is the case.Reading symbols from /home/pio/dev/d/projects/cb_test/hello...Segmentation faultThis is a gdb issue, not a D issue, you should report this issue to the gdb developers so they can add a test case to their test suite and fix the bug :)Does anyone can work with gdb on linux?I do, and it works great for me :) This said, if you have issues with it it's good to voice them to either the D community or the gdb devs if appropriate so we can work out any issues and make debugging D on linux/freebsd/os x etc a pleasant experience. It isn't right now, but the situation's far better than it was a few weeks ago (it was impossible to do anything non-trivial then :P)Cheers Piotrek
May 10 2010
W dniu 10.05.2010 21:02, Robert Clipsham pisze:You are not using a version of gdb with D support if s is not displayed as a string. This said, I've only ever looked at variables using print or a backtrace, could you try 'p s' and see what result it gives?(gdb) p s $1 = 578159222890430469 No luck :(If it's the same you aren't using a D capable version of gdb. This said, it should be working in that version of gdb, I guess there's some other issues there if this is the case.ProbablySo I assume you are working on hand patched version of gdb - not the unchanged one from the official repository?Does anyone can work with gdb on linux?I do, and it works great for me :)This said, if you have issues with it it's good to voice them to either the D community or the gdb devs if appropriate so we can work out any issues and make debugging D on linux/freebsd/os x etc a pleasant experience. It isn't right now, but the situation's far better than it was a few weeks ago (it was impossible to do anything non-trivial then :P)I try next gdb snapshot and then if it doesn't work I will fill bug report. Cheers Piotrek
May 10 2010
On Monday, 10 May 2010 at 19:25:05 UTC, Piotrek wrote:W dniu 10.05.2010 21:02, Robert Clipsham pisze:try this: (gdb) x/dwx &mystirng 0xbffff4f4: 0x0000003c <- size of string (gdb) 0xbffff4f8: 0xb7ca2540 <- ptr to the string (gdb) x/s 0xb7ca2540 0xb7ca2540: "this is my string" (gdb) regards.You are not using a version of gdb with D support if s is not displayed as a string. This said, I've only ever looked at variables using print or a backtrace, could you try 'p s' and see what result it gives?(gdb) p s $1 = 578159222890430469 No luck :(
Jun 01 2013
add this macro to your ~/.gdbinit define ps x/s *(unsigned long *)(((char *)&$arg0)+4) end then you can do: (gdb) ps myString 0xb7ca2540: "this is my string"(gdb) p s $1 = 578159222890430469 No luck :(try this: (gdb) x/dwx &mystirng 0xbffff4f4: 0x0000003c <- size of string (gdb) 0xbffff4f8: 0xb7ca2540 <- ptr to the string (gdb) x/s 0xb7ca2540 0xb7ca2540: "this is my string" (gdb)
Jun 01 2013
the post ist more than 3 years old Am 02.06.2013 07:04, schrieb sha0coder:add this macro to your ~/.gdbinit define ps x/s *(unsigned long *)(((char *)&$arg0)+4) end then you can do: (gdb) ps myString 0xb7ca2540: "this is my string"(gdb) p s $1 = 578159222890430469 No luck :(try this: (gdb) x/dwx &mystirng 0xbffff4f4: 0x0000003c <- size of string (gdb) 0xbffff4f8: 0xb7ca2540 <- ptr to the string (gdb) x/s 0xb7ca2540 0xb7ca2540: "this is my string" (gdb)
Jun 01 2013
And still, gdb doesn't recognize D strings. Thanks for the Macro! Am 02.06.2013 08:08, schrieb dennis luehring:the post ist more than 3 years old Am 02.06.2013 07:04, schrieb sha0coder:add this macro to your ~/.gdbinit define ps x/s *(unsigned long *)(((char *)&$arg0)+4) end then you can do: (gdb) ps myString 0xb7ca2540: "this is my string"(gdb) p s $1 = 578159222890430469 No luck :(try this: (gdb) x/dwx &mystirng 0xbffff4f4: 0x0000003c <- size of string (gdb) 0xbffff4f8: 0xb7ca2540 <- ptr to the string (gdb) x/s 0xb7ca2540 0xb7ca2540: "this is my string" (gdb)
Jun 02 2013
On Mon, 10 May 2010, Robert Clipsham wrote:On 10/05/10 19:48, Piotrek wrote:For what it's worth, I've still had lots of problems with gdb (from cvs) + dmd from svn. It's certainly LOTS better, but there's lots left to fix. Unfortunatly I haven't spent the time to try to reduce the problem down at all. I'll do that, but just haven't yet. Later, Brad(gdb) info locals i = 1 s = 578159222890430469 f = 9.55146781e-38 (gdb) show language The current source language is "auto; currently d".You are not using a version of gdb with D support if s is not displayed as a string. This said, I've only ever looked at variables using print or a backtrace, could you try 'p s' and see what result it gives? If it's the same you aren't using a D capable version of gdb. This said, it should be working in that version of gdb, I guess there's some other issues there if this is the case.Reading symbols from /home/pio/dev/d/projects/cb_test/hello...Segmentation faultThis is a gdb issue, not a D issue, you should report this issue to the gdb developers so they can add a test case to their test suite and fix the bug :)Does anyone can work with gdb on linux?I do, and it works great for me :) This said, if you have issues with it it's good to voice them to either the D community or the gdb devs if appropriate so we can work out any issues and make debugging D on linux/freebsd/os x etc a pleasant experience. It isn't right now, but the situation's far better than it was a few weeks ago (it was impossible to do anything non-trivial then :P)Cheers Piotrek
May 10 2010