home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: sparky!uunet!europa.asd.contel.com!darwin.sura.net!newsserver.jvnc.net!newsserver.technet.sg!nuscc!papaya!suresh
- From: suresh@papaya.iss.nus.sg (Suresh Thennarangam - Research Scholar)
- Subject: Re: Help: using GDB to debug G++-compiled programs
- Message-ID: <1993Jan12.014848.14135@nuscc.nus.sg>
- Sender: usenet@nuscc.nus.sg
- Reply-To: suresh@iss.nus.sg (Suresh Thennarangam - Research Scholar)
- Organization: Institute Of Systems Science, NUS
- References: <1993Jan11.122250.23513@iti.gov.sg>
- Date: Tue, 12 Jan 1993 01:48:48 GMT
- Lines: 60
-
- In article <1993Jan11.122250.23513@iti.gov.sg> cmlow@iti.gov.sg (Low Chee Meng (KSL)) writes:
- >Hi,
- >
- >I'm currently using GDB to debug a C++ program (compiled with
- >-g flag with G++). One thing I couldn't figure out how to do is to
- >execute some method call inside GDB, eg:
- >
- >gdb> print someObj.someMethod(someArgs....)
- > or
- >gdb> set someVar = someObjPtr->someMetthod(....)
- >
- >GDB would always return back something like "there's no component
- >named someMethod", even though someMethod is a valid method of
- >the class to which someObj belongs to.
- >
- >Is there something I have to do make the above work? has anyone ever
- >had success getting GDB to execute any method call?
- >
- >I'm current using GDB 4.6 and GCC 2.2.2 on Sun OS.
- >
- >Thanks in advance for any help,
- >
- >Chee Meng
- >---------------------------------------------------------------------
- >Chee-Meng Low (cmlow@iti.gov.sg) (fax: 65-777-3043)
- >Knowledge Systems Lab, Information Technology Institute, Singapore
- >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-
- Some native object code format's are not rich enough to hold
- sufficient information for debugging C++ programs as well as one
- would desire. The SUN OS 4.1 environment does put guite a lot of
- debugging info. but you can use the -ggdb option to include
- extra debugging info. which only gdb can use.
-
- Compile using the option g++ -ggdb
-
- g++ -ggdb myC++.C -o myOut
-
- This will solve your current problem.
-
- Note that even then you may not be able to access inline methods
- unless you move their declaration outside the class definition.
-
- Also FYI: there are newsgroups called gnu.g++.help and gnu.gcc.help.
-
-
- __
- (_ / / o_ o o |_
- __)/(_( __) (_(_ /_)| )_
-
- ***************************************************************************
- * Suresh Thennarangam * EMail: suresh@iss.nus.sg(Internet) *
- * Research Scholar * ISSST@NUSVM.BITNET *
- * Institute Of Systems Science * Tel: (065) 772 2588. *
- * National University Of Singapore * Facs.: (065) 778 2571 *
- * Heng Mui Keng Terrace * Telex: ISSNUS RS 39988 *
- * Singapore 0511. * *
- ***************************************************************************
-
-
-