home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / gnu / gdb / bug / 924 < prev    next >
Encoding:
Text File  |  1992-07-30  |  2.2 KB  |  81 lines

  1. Newsgroups: gnu.gdb.bug
  2. Path: sparky!uunet!cis.ohio-state.edu!gmd.DE!tietz
  3. From: tietz@gmd.DE (Christoph Tietz)
  4. Subject: gdb-4.6 crashes on trivial program
  5. Message-ID: <tietz.712510572@gmd.de>
  6. Sender: gnulists@ai.mit.edu
  7. Organization: GMD, Sankt Augustin, Germany
  8. Distribution: gnu
  9. Date: Thu, 30 Jul 1992 15:36:12 GMT
  10. Approved: bug-gdb@prep.ai.mit.edu
  11. Lines: 68
  12.  
  13. // This may look like C code, but it is really -*- C++ -*-
  14. //
  15. // Compiling with g++-2.2.2, linked with libg++-2.2 on a
  16. // SUN4 (SPARCstation IPX) running SunOS 4.1.2:
  17. //
  18. // g++ -pipe -g -I/vol/gnu/lib/g++2-include -o qwrst qwrst.cc -lg++2
  19. //
  20. // Using gdb-4.6:
  21. //
  22. // The attempt to "debug" the following program crashes gdb:
  23. // Set a breakpoint at the first line of function funcA (e.g. break funcA)
  24. // and let the program run :-(
  25.  
  26. #include <stream.h>
  27.  
  28. class Dings {
  29. public:
  30.   virtual void bums ();
  31. };
  32.  
  33. void Dings::bums () {}
  34.  
  35. typedef void (Dings::*dingsMem)();
  36.  
  37. void funcA (dingsMem a) {
  38.   cout << "funcA\n";
  39. }
  40.  
  41. main () {
  42.   Dings a;
  43.  
  44.   funcA (a.bums);
  45. }
  46.  
  47. ------------------------------ snip here --------------------------------------
  48.  
  49. A session of gdb with gdb looks as follows:
  50.  
  51. Starting program: /vol/gnu/bin/gdb qwrst
  52. GDB is free software and you are welcome to distribute copies of it
  53.  under certain conditions; type "show copying" to see the conditions.
  54. There is absolutely no warranty for GDB; type "show warranty" for details.
  55. GDB 4.6, Copyright 1992 Free Software Foundation, Inc...
  56. gdb_qwrst> break funcA
  57. Breakpoint 1 at 0x22b0: file qwrst.cc, line 22.
  58. Current Language:  auto; currently c++
  59. Type checking:     auto; currently off
  60. Range checking:    auto; currently off
  61. gdb_qwrst> run
  62. Starting program: /tmp_mnt/home/tietz/sesame/qwrst 
  63.  
  64.  
  65. Program received signal 11, Segmentation fault
  66. 0x1cca4 in val_print ()
  67. gdb_qwrst> where
  68. #0  0x1cca4 in val_print ()
  69. #1  0x21798 in print_frame_args ()
  70. #2  0xdb68 in print_frame_info ()
  71. #3  0xd9a4 in print_stack_frame ()
  72. #4  0x30300 in normal_stop ()
  73. #5  0x2f0f0 in child_create_inferior ()
  74. #6  0x2b770 in tty_command ()
  75. #7  0x3940 in execute_command ()
  76. #8  0x3af4 in execute_command ()
  77. #9  0x3740 in main ()
  78.  
  79.                           Christoph Tietz (tietz@gmd.de or tietz@zi.gmd.dbp.de)
  80.  
  81.