home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / lang / cplus / 18981 < prev    next >
Encoding:
Text File  |  1993-01-11  |  2.8 KB  |  73 lines

  1. Newsgroups: comp.lang.c++
  2. Path: sparky!uunet!europa.asd.contel.com!darwin.sura.net!newsserver.jvnc.net!newsserver.technet.sg!nuscc!papaya!suresh
  3. From: suresh@papaya.iss.nus.sg (Suresh Thennarangam - Research Scholar)
  4. Subject: Re: Help: using GDB to debug G++-compiled programs
  5. Message-ID: <1993Jan12.014848.14135@nuscc.nus.sg>
  6. Sender: usenet@nuscc.nus.sg
  7. Reply-To: suresh@iss.nus.sg (Suresh Thennarangam - Research Scholar)
  8. Organization: Institute Of Systems Science, NUS
  9. References: <1993Jan11.122250.23513@iti.gov.sg>
  10. Date: Tue, 12 Jan 1993 01:48:48 GMT
  11. Lines: 60
  12.  
  13. In article <1993Jan11.122250.23513@iti.gov.sg> cmlow@iti.gov.sg (Low Chee Meng (KSL)) writes:
  14. >Hi,
  15. >
  16. >I'm currently using GDB to debug a C++ program (compiled with
  17. >-g flag with G++). One thing I couldn't figure out how to do is to
  18. >execute some method call inside GDB, eg:
  19. >
  20. >gdb> print someObj.someMethod(someArgs....)
  21. >   or
  22. >gdb> set someVar = someObjPtr->someMetthod(....)
  23. >
  24. >GDB would always return back something like "there's no component
  25. >named someMethod", even though someMethod is a valid method of
  26. >the class to which someObj belongs to.
  27. >
  28. >Is there something I have to do make the above work? has anyone ever
  29. >had success getting GDB to execute any method call?
  30. >
  31. >I'm current using GDB 4.6 and GCC 2.2.2 on Sun OS.
  32. >
  33. >Thanks in advance for any help,
  34. >
  35. >Chee Meng
  36. >---------------------------------------------------------------------
  37. >Chee-Meng Low (cmlow@iti.gov.sg) (fax: 65-777-3043)
  38. >Knowledge Systems Lab, Information Technology Institute, Singapore
  39. >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  40.  
  41. Some native object code format's are not rich enough to hold
  42. sufficient information for debugging C++ programs as well as one
  43. would desire. The SUN OS 4.1 environment does put guite a lot of 
  44. debugging info.  but you can use the -ggdb option to include 
  45. extra debugging info.  which only gdb can use.
  46.  
  47. Compile using  the option g++ -ggdb
  48.  
  49. g++ -ggdb myC++.C -o myOut
  50.  
  51. This will solve your current problem.
  52.  
  53. Note that even then you may not be able to access inline methods
  54. unless you move their declaration outside the class definition.
  55.  
  56. Also FYI: there are newsgroups called gnu.g++.help and gnu.gcc.help.
  57.  
  58.  
  59.     __
  60.    (_   / /  o_   o  o |_
  61.    __)/(_( __) (_(_ /_)| )_
  62.  
  63. ***************************************************************************
  64. * Suresh Thennarangam               *  EMail: suresh@iss.nus.sg(Internet) *
  65. * Research Scholar                  *         ISSST@NUSVM.BITNET          *
  66. * Institute Of Systems Science      *  Tel:  (065) 772 2588.              *
  67. * National University Of Singapore  *  Facs.: (065) 778 2571              *
  68. * Heng Mui Keng Terrace             *  Telex: ISSNUS RS 39988             *
  69. * Singapore 0511.                   *                                     *
  70. ***************************************************************************
  71.  
  72.  
  73.