home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / gnu / gdb / bug / 964 < prev    next >
Encoding:
Text File  |  1992-08-12  |  6.0 KB  |  161 lines

  1. Newsgroups: gnu.gdb.bug
  2. Path: sparky!uunet!cis.ohio-state.edu!citron.sw.stratus.com!pfieland
  3. From: pfieland@citron.sw.stratus.com (Peggy Fieland)
  4. Subject: (none)
  5. Message-ID: <9208121833.AA15565@citron.sw.stratus.com>
  6. Sender: gnulists@ai.mit.edu
  7. Organization: GNUs Not Usenet
  8. Distribution: gnu
  9. Date: Wed, 12 Aug 1992 18:33:39 GMT
  10. Approved: bug-gdb@prep.ai.mit.edu
  11. Lines: 148
  12.  
  13. I have been having difficulties with the symbol-file command.
  14. Under certain circumstances, when using the symbol-file command,
  15. gdb is unable to reset a breakpoint, or resets it in the wrong place.
  16.  
  17. I have experienced variations of this problem with gdb-4.6 on a
  18. Sun Sparc and on Stratus's i860 gdb.  Unfortunately, this is
  19. one of those frustrating bugs where the attempt to debug it
  20. affects the behaviour (leading me to believe that the underlying
  21. problem is uninitialized data, or pointer into freed/re-used
  22. storage...).
  23.  
  24. Note that I DIDN'T have this problem with any of the earlier versions
  25. of gdb that I tried this on.
  26.  
  27. Here is the test program I used:
  28. /* test miscellaneous commands */
  29.  
  30. #include <stdio.h> 
  31. main() { 
  32. int i1, i2, i3; 
  33.  
  34.  i1 = 0;
  35.  i2 = 1;
  36.  i3 = 2;
  37.  
  38.  printf("ints: %d, %d, %d\n", i1, i2, i3);
  39. }
  40.  
  41. Here is what happened on a Sun Sparc:
  42. cyclonic-~% gdb46 misc
  43. GDB is free software and you are welcome to distribute copies of it
  44.  under certain conditions; type "show copying" to see the conditions.
  45. There is absolutely no warranty for GDB; type "show warranty" for details.
  46. GDB 4.6, Copyright 1992 Free Software Foundation, Inc...
  47. (gdb) break 7
  48. Breakpoint 1 at 0x229c: file misc.c, line 7.
  49. (gdb) run
  50. Starting program: /tmp_mnt/net/citron/home/citron/pfieland/misc
  51.  
  52. Breakpoint 1, main () at misc.c:7
  53. 7        i1 = 0;
  54. (gdb) exec-file misc
  55. A program is being debugged already.  Kill it? (y or n) y
  56. (gdb) symbol-file
  57. Discard symbol table from `/tmp_mnt/net/citron/home/citron/pfieland/misc'? (y or n) y
  58. No symbol file now.
  59. (gdb) symbol-file misc
  60. Reading symbols from misc...Error in re-setting breakpoint 1:
  61. No line 7 in file "(null)".
  62. done.
  63. (gdb)
  64.  
  65. As the following debugging session indicates, the information pointed to by
  66. the breakpoint structure b.symtab has been set to zero (in the Sparc case)
  67. or to new data (in the Stratus i860 case) (sorry, I  couldn't capture the
  68. Stratus case -- later attempts to debug gdb either caused the problem to
  69. disappear or the network to kick me off the machine :-(.)
  70.  
  71. (Sun Sparc)
  72.  
  73. cyclonic-~% gdb gdb46
  74. GDB is free software and you are welcome to distribute copies of it
  75.  under certain conditions; type "show copying" to see the conditions.
  76. There is absolutely no warranty for GDB; type "show warranty" for details.
  77. GDB 4.5, Copyright 1992 Free Software Foundation, Inc...
  78. (gdb) directory /net/citron/home/tools/gdb-4.6/gdb
  79. /net/citron/home/tools/gdb-4.6/gdb: No such file or directory.
  80. (gdb) set prompt TOP>
  81. TOP> break breakpoint_re_set_one
  82. Breakpoint 1 at 0xb5d8: file ../../../gdb-4.6/gdb/breakpoint.c, line 2182.
  83. TOP> r misc
  84. Starting program: /home/tools/bin/gdb46 misc
  85. GDB is free software and you are welcome to distribute copies of it
  86.  under certain conditions; type "show copying" to see the conditions.
  87. There is absolutely no warranty for GDB; type "show warranty" for details.
  88. GDB 4.6, Copyright 1992 Free Software Foundation, Inc...
  89. (gdb) b 7
  90. Breakpoint 1 at 0x229c: file misc.c, line 7.
  91. (gdb) r
  92. Starting program: /tmp_mnt/net/citron/home/citron/pfieland/misc
  93.  
  94. Breakpoint 1, breakpoint_re_set_one (bint=0x153908 "") at ../../../gdb-4.6/gdb/breakpoint.c:2182
  95. ../../../gdb-4.6/gdb/breakpoint.c:2182: No such file or directory.
  96. TOP> c
  97. Continuing.
  98.  
  99. Breakpoint 1, breakpoint_re_set_one (bint=0x153888 "") at ../../../gdb-4.6/gdb/breakpoint.c:2182
  100. ../../../gdb-4.6/gdb/breakpoint.c:2182: No such file or directory.
  101. TOP> directory /net/citron/home/tools/gnu/gdb-4.6/gdb
  102. Source directories searched: /net/citron/home/tools/gnu/gdb-4.6/gdb:$cdir:$cwd
  103. TOP> c
  104. Continuing.
  105.  
  106. Breakpoint 1, main () at misc.c:7
  107. 7        i1 = 0;
  108. (gdb) exec-file misc
  109. A program is being debugged already.  Kill it? (y or n) y
  110. (gdb) symbol-file
  111. Discard symbol table from `/tmp_mnt/net/citron/home/citron/pfieland/misc'? (y or n) y
  112. No symbol file now.
  113. (gdb) symbol-file misc
  114. Reading symbols from misc...
  115. Breakpoint 1, breakpoint_re_set_one (bint=0x153888 "") at ../../../gdb-4.6/gdb/breakpoint.c:2182
  116. 2182      struct breakpoint *b = (struct breakpoint *)bint;  /* get past catch_errs */
  117. TOP> n
  118. 2188      switch (b->type)
  119. TOP> p *b
  120. $1 = {next = 0x153808, type = bp_breakpoint, enable = enabled, disposition = donttouch, number = 1,
  121.   address = 8860, line_number = 7, symtab = 0x15c4b8, silent = 0 '\000', ignore_count = 0,
  122.   shadow_contents = {"\37777777700'\37777777677\37777777774\000\000\000\000\000\000"}, inserted = 0 '\000',
  123.   duplicate = 0 '\000', commands = 0x0, frame = 0, cond = 0x0, addr_string = 0x144fc8 "7",
  124.   cond_string = 0x0, exp = 0x0, exp_valid_block = 0x0, val = 0x0}
  125. TOP> p *b.symtab
  126. $2 = {next = 0x0, blockvector = 0x0, linetable = 0x0, filename = 0x0, dirname = 0x0,
  127.   free_code = free_nothing, free_ptr = 0x0, nlines = 0, line_charpos = 0x0, language = language_unknown,
  128.   version = 0x0, fullname = 0x0, objfile = 0x0}
  129. TOP> c
  130. Continuing.
  131. Error in re-setting breakpoint 1:
  132. No line 7 in file "(null)".
  133.  
  134. Here is what happens on Stratus i860:
  135.  
  136. maestro-testsrc% ~/gdb46 misc
  137. GDB is free software and you are welcome to distribute copies of it
  138.  under certain conditions; type "show copying" to see the conditions.
  139. There is absolutely no warranty for GDB; type "show warranty" for details.
  140. GDB 4.6, Copyright 1992 Free Software Foundation, Inc...
  141. Setting up the environment for debugging gdb.
  142. (gdb) b 7
  143. Breakpoint 1 at 0x1464: file ../source/misc.c, line 7.
  144. (gdb) r
  145. Starting program: /home3/Languages/regression/gdb/other/testsrc/misc
  146.  
  147. Breakpoint 1, main () at ../source/misc.c:7
  148. 7        i1 = 0;
  149. (gdb) exec-file misc
  150. A program is being debugged already.  Kill it? (y or n) y
  151. (gdb) symbol-file
  152. Discard symbol table from `/home3/Languages/regression/gdb/other/testsrc/misc'? (y or n) y
  153. No symbol file now.
  154. (gdb) symbol-file misc
  155. Reading symbols from misc...Breakpoint 1 at 0x135a10: file _edata, line 7.
  156. done.
  157. (gdb)
  158.  
  159. Peggy
  160.  
  161.