www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 3389] New: gdb: using -gc is mandatory but not well documented

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3389

           Summary: gdb: using -gc is mandatory but not well documented
           Product: D
           Version: unspecified
          Platform: All
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: www.digitalmars.com
        AssignedTo: nobody puremagic.com
        ReportedBy: llucax gmail.com



PDT ---
-g is known to be broken when using GDB (I don't know if this is how it's
supposed to be or if it's a bug). -gc usually works (there are a few bugs
still), but it's not very well documented that when using GDB you should use
-gc (which is supposed to mean, "pretend to be C", so it's not very easy to
figure out that that flag should be used instead of -g).

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 12 2009
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3389


Robert Clipsham <robert octarineparrot.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |robert octarineparrot.com



13:37:35 BST ---
-g not working is how it's meant to be, at least until gdb adds support for the
D extensions to DWARF. I've hopefully fixed the remaining bugs with -gc (on
linux at least). My solution to this would be to add in a -gd, and make -g an
alias to -gc until better support for debug info is added to debuggers. This
way users get working debug output with -g, and don't blame it on a buggy dmd
:)

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Apr 01 2010
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3389




PDT ---
Seems reasonable.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Apr 28 2010
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3389


dawg dawgfoto.de changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |dawg dawgfoto.de
         Resolution|                            |FIXED


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 31 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3389


Leandro Lucarella <leandro.lucarella sociomantic.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |



2012-02-01 02:25:52 PST ---
Copying comment in bug 4149 and reopening because I don't think this is really
closed.

In that bug some standard DWARF issues were moved to -g, and now I think -g
works with debuggers not supporting D extensions.

*BUT*, in bug 4149 Walter agreed about this comment by Brad Roberts:

 Depends on if gc implies c, c++, or 'as much as is supported in the built-in
 debug format without extension'. 
 
 I'd argue for the last definition.  Given that dwarf supports it without
 extension, I'd argue that it should use it.  I'd argue that -g should be
 built-in + d extensions.
AFAIK this pull request works for -g instead of -gc, even when it uses standard DWARF features, which goes against that comment. Also there is the point made by Robert Clipsham in comment 1, which for me makes a lot of sense. At least this will be more familiar with people used to GCC command line arguments (which is probably 100% of the *nix world), where -g is the default for debug and you have, for example -ggdb for GDB extensions. AFAIK there is no clear direction about this and it would be nice to have one, so the debugging stuff is as consistent as possible. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Feb 01 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3389




Thats a wrong comparision because neither -g not -ggdb make the compiler
fake C++ debug information as C. The -gc flag is a hack to masquerade as
C which should not be the default if -g works for most platforms.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 01 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3389




GDB already has D specific extensions (demangling and arrays). Using -g makes
use of them, -gc does not.
There won't be D specific DWARF extensions any time soon.
What we wanted to add can be modeled by newer DWARF versions but adapting them
would break older debuggers.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 01 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3389


Brad Roberts <braddr puremagic.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
                 CC|                            |braddr puremagic.com
         Resolution|                            |WONTFIX



---
The bottom line is that -g needs to 'just work' with the standard debuggers on
the supported platforms.  Assuming that -g works, -gc is a left over appendage.
 A whole lot of progress has been made in a number of commits over the last
year. 

Some quick testing on linux shows that it works quite well with just -g now.

With that in mind, I'm resolving this bug report as wontfix since -gc isn't
mandatory any more.

Chances are that there's more bugs left, so please feel encouraged to distill
repro cases where -g doesn't "just work", file them, and we'll work on them.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 01 2012
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3389




2012-02-02 02:51:50 PST ---

 Thats a wrong comparision because neither -g not -ggdb make the compiler
 fake C++ debug information as C. The -gc flag is a hack to masquerade as
 C which should not be the default if -g works for most platforms.
That's not what Walter said (agreeing with Brad's comment) in the comment I pointed out. But it seems that's not longer the position about -g/-gc (at least for Brad). I don't care that much about what should be the meaning of -g/-gc as long as there is one that works (and will keep working) with standard debuggers.
 The bottom line is that -g needs to 'just work' with the standard debuggers on
 the supported platforms.  Assuming that -g works, -gc is a left over appendage.
  A whole lot of progress has been made in a number of commits over the last
 year. 
 
 Some quick testing on linux shows that it works quite well with just -g now.
 
 With that in mind, I'm resolving this bug report as wontfix since -gc isn't
 mandatory any more.
 
 Chances are that there's more bugs left, so please feel encouraged to distill
 repro cases where -g doesn't "just work", file them, and we'll work on them.
OK, so -gc should be just deprecated and there should be only -g, right? Will -gc be the same as -g? If not, why? -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Feb 02 2012