Path: utzoo!attcan!uunet!husc6!bloom-beacon!mit-eddie!uw-beaver!apollo!mrst!sdti!mjy From: mjy@sdti.UUCP (Michael J. Young) Newsgroups: comp.lang.c++ Subject: Disambiguating identifiers (was Re: ...Does C++ work with dbx...) Keywords: C++, dbx, ctags Message-ID: <269@sdti.UUCP> Date: 19 May 88 21:13:00 GMT References: <1158@daisy.UUCP> <7871@alice.UUCP> Reply-To: mjy@sdti.UUCP (0000-Michael J. Young) Distribution: na Organization: Software Development Technologies, Sudbury MA Lines: 42 In article <7871@alice.UUCP> shopiro@alice.UUCP writes: >I regularly use dbx to debug C++ programs. Setting breakpoints on line >numbers works fine. In order to set breakpoints on functions, or inspect >the values of variables, you need to know the ``mangled'' version of >the name you want to reference.... We've all had to deal with this problem in one way or another. One of the major advantages I see to native-code compilers is the debugging support (i.e., access functions and variables by their unmangled identifiers) that would come with it. >The next version of C++ will >have a canonical ``demangler'' that can be incorporated into future >debuggers. I don't have access to a real C++ source-level debugger (such as the one supplied with G++), but a colleague and I have been thinking about what it takes for a person to be able to unambiguously specify identifiers for setting breakpoints, inspecting variables, etc. I suppose the C++ disambiguating operator (::) can be used for many cases, but what about the following case: overload foo; int foo (int){...} int foo (float){...} int foo (int, int){...} Now say that you want to set a breakpoint at the entry to the third function. How would you tell a debugger which foo you are referring to without resorting to line numbers? The compiler disambiguates these on the basis of arguments rather than scope. How would a debugger do this? Using the output of cfront with a debugger such as dbx, one would simply (!) refer to "_fooFII__" (or something equally obvious). How would you do it with the GNU debugger? -- Mike Young - Software Development Technologies, Inc., Sudbury MA 01776 UUCP : {decvax,harvard,linus,mit-eddie}!necntc!necis!mrst!sdti!mjy Internet : mjy%sdti.uucp@harvard.harvard.edu Tel: +1 617 443 5779 "Bill & Opus in '88" -- Consider the alternatives!