This is the mail archive of the gdb-prs@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: gdb/922: Breakpoints give crash, bad behavior w/ C++, gcc 3.2 on Solaris


The following reply was made to PR gdb/922; it has been noted by GNATS.

From: Daniel Jacobowitz <drow@mvista.com>
To: gdb-gnats@sources.redhat.com
Cc:  
Subject: Re: gdb/922: Breakpoints give crash, bad behavior w/ C++, gcc 3.2 on Solaris
Date: Tue, 14 Jan 2003 11:35:39 -0500

 More information; the symbol reading crash is fixed, the "set language
 c++" bit is a known problem, and the bad breakpoint address is Solaris
 specific.
 
 ----- Forwarded message from Doug Dunlop <dunlop@cadence.com> -----
 
 Date: Tue, 14 Jan 2003 07:52:43 -0800
 From: "Doug Dunlop" <dunlop@cadence.com>
 Subject: RE: gdb/922: Breakpoints give crash, bad behavior w/ C++, gcc 3.2 on Solaris
 To: "Daniel Jacobowitz" <drow@mvista.com>
 
 I was able to get gdb+dejagnu-weekly-CVS-20030114 to build.
 Thanks for you guidance.
 
 You are right, this gdb eliminates the crash I was
 seeing.  Also, when using this gdb, if I say
 "set language c++", I am able to set the breakpoint.
 However, when I run the program, I continue to get these
 "Error accessing memory..." problems and these seem fatal.
 Here is an example session:
 
   /usr7/tools/gnu/dunlop/gdb+dejagnu-weekly-CVS-20030114/build/gdb/gdb ./run.x
   GNU gdb 2003-01-13-cvs
   Copyright 2003 Free Software Foundation, Inc.
   GDB is free software, covered by the GNU General Public License, and you are
   welcome to change it and/or distribute copies of it under certain conditions.
   Type "show copying" to see the conditions.
   There is absolutely no warranty for GDB.  Type "show warranty" for details.
   This GDB was configured as "sparc-sun-solaris2.7"...
   (gdb) set language c++
   (gdb) break stage1::addsub
   Breakpoint 1 at 0x30cdd4: file stage1.cpp, line 45.
   (gdb) run
   Starting program: /usr7/tools/gnu/gdbTrouble/3.2.1Compiler/systemc-2.0.1/examples/systemc/pipe/run.x 
   Warning:
   Cannot insert breakpoint 1.
   Error accessing memory address 0x30cdd4: I/O error.
   
   (gdb) where
   #0  0xff3b29c0 in ?? ()
   Cannot access memory at address 0x38
   (gdb) cont
   Continuing.
   Warning:
   Cannot insert breakpoint 1.
   Error accessing memory address 0x30cdd4: I/O error.
   
   (gdb) quit
   The program is running.  Exit anyway? (y or n) y
   
 So things are a little better, but I still can't debug with
 breakpoints.  The program (run.x) runs fine under the
 debugger if I don't try to set breakpoints.
 
 If it helps, here's a summary of the 12 combinations
 
 GDB CVS / break stage1::addub / no set language
   "the class stage1 does not have any method named addsub"
 GDB CVS / break stage1::addub / set language c++
   "Error accessing memory..." when trying to insert breakpoint during 'run'
 GDB CVS / break stage1::addub() / no set language
   "Error accessing memory..." when trying to insert breakpoint during 'run'
 GDB CVS / break stage1::addub() / set language c++
   "Error accessing memory..." when trying to insert breakpoint during 'run'
 GDB CVS / break stage1::addub(void) / no set language
   "Function "stage1::addsub(void)" not defined."
 GDB CVS / break stage1::addub(void) / set language c++
   "Function "stage1::addsub(void)" not defined."
 GDB 5.3 / break stage1::addub / no set language
   Crash
 GDB 5.3 / break stage1::addub / set language c++
   Crash
 GDB 5.3 / break stage1::addub() / no set language
   "Error accessing memory..." when trying to insert breakpoint during 'run'
 GDB 5.3 / break stage1::addub() / set language c++
   "Error accessing memory..." when trying to insert breakpoint during 'run'
 GDB 5.3 / break stage1::addub(void) / no set language
   "Function "stage1::addsub(void)" not defined."
 GDB 5.3 / break stage1::addub(void) / set language c++
   "Function "stage1::addsub(void)" not defined."
 
 -- Doug
 
 -----Original Message-----
 From: Daniel Jacobowitz [mailto:drow@mvista.com]
 Sent: Friday, January 10, 2003 6:21 PM
 To: Doug Dunlop
 Subject: Re: gdb/922: Breakpoints give crash, bad behavior w/ C++, gcc
 3.2 on Solaris
 
 
 On Fri, Jan 10, 2003 at 07:37:57AM -0800, Doug Dunlop wrote:
 > Hi,
 > 
 > A compressed version of the run.x executable is attached;
 > I hope you can read it.  Let me know if not.
 
 Could you try a CVS snapshot of GDB for me, please?  Some more
 comments:
 
 > > When I run the test case (see info in How-to-Repeat) and give gdb the command "break stage1::addsub" my session looks like:
 > > 
 > >   ...
 > >   There is absolutely no warranty for GDB.  Type "show warranty" for details.
 > >   This GDB was configured as "sparc-sun-solaris2.7"...
 > >   (gdb) break stage1::addsub
 > >   Bus error (core dumped)
 
 This command may still fail (more gracefully!) with current CVS
 snapshots; try using "set language c++" and then "break
 stage1::addsub".  Before you start the program it thinks you're in C
 mode and class lookup doesn't work right; this is a known bug in GDB.
 
 With that tweak I can successfully set the breakpoint.
 
 > > and the traceback from the resulting core file looks like:
 > > 
 > >   #0  finish_block (symbol=0x1010101, listhead=0x253a48, old_blocks=0x1010101, start=72340172838076673, end=72340172838076729, objfile=0x2d6e38)
 > >       at /net/humdinger/usr7/tools/gnu/gdb-5.3/gdb-5.3/gdb/buildsym.c:304
 > >   #1  0x000fb010 in process_one_symbol (type=36, desc=0, valu=56, name=0x5a1d4b "", section_offsets=0x244400, objfile=0x2d6e38)
 > >       at /net/humdinger/usr7/tools/gnu/gdb-5.3/gdb-5.3/gdb/dbxread.c:2782
 > >   #2  0x000fad70 in read_ofile_symtab (pst=0x7cadd0) at /net/humdinger/usr7/tools/gnu/gdb-5.3/gdb-5.3/gdb/dbxread.c:2626
 > >   #3  0x000fa83c in dbx_psymtab_to_symtab_1 (pst=0x7cadd0) at /net/humdinger/usr7/tools/gnu/gdb-5.3/gdb-5.3/gdb/dbxread.c:2454
 > >   #4  0x000fa8fc in dbx_psymtab_to_symtab (pst=0x7cadd0) at /net/humdinger/usr7/tools/gnu/gdb-5.3/gdb-5.3/gdb/dbxread.c:2495
 > >   #5  0x00075080 in psymtab_to_symtab (pst=0x7cadd0) at /net/humdinger/usr7/tools/gnu/gdb-5.3/gdb-5.3/gdb/symfile.c:375
 > >   #6  0x0007014c in lookup_symbol_aux (name=0xffbee548 "stage1", mangled_name=0x0, block=0x7cadd0, namespace=STRUCT_NAMESPACE, 
 > >       is_a_field_of_this=0x0, symtab=0x0) at /net/humdinger/usr7/tools/gnu/gdb-5.3/gdb-5.3/gdb/symtab.c:967
 > >   #7  0x0006fc14 in lookup_symbol (name=0xffbee548 "stage1", block=0x0, namespace=STRUCT_NAMESPACE, is_a_field_of_this=0x0, symtab=0x0)
 > >   ...
 
 Hmm, this is a crash in the symbol reader; works fine here.  I'd like
 to know if you see it in a CVS snapshot.
 
 > > If instead when I run the test case I give gdb the command "break stage1::addsub()" my session looks like:
 > > 
 > >   ...
 > >   There is absolutely no warranty for GDB.  Type "show warranty" for details.
 > >   This GDB was configured as "sparc-sun-solaris2.7"...
 > >   (gdb) break stage1::addsub()
 > >   Breakpoint 1 at 0x2fa754: file stage1.cpp, line 45.
 > >   (gdb) run
 > >   Starting program: /usr7/tools/gnu/gdbTrouble/3.2.1Compiler/systemc-2.0.1/examples/systemc/pipe/run.x 
 > >   Warning:
 > >   Cannot insert breakpoint 1.
 > >   Error accessing memory address 0x2fa754: I/O error.
 > >   The same program may be running in another process.
 > >   (gdb) where
 > >   #0  0xff3b29c0 in ?? ()
 > >   Cannot access memory at address 0x38
 > >   (gdb) cont
 > >   Continuing.
 > >   Warning:
 > >   Cannot insert breakpoint 1.
 > >   Error accessing memory address 0x2fa754: I/O error.
 > >   The same program may be running in another process.
 > >   (gdb) 
 > > 
 > > Finally if I try "break stage1::addsub(void)" I get an error message saying that that function is "not defined".
 
 This is odd, and I can't reproduce it without a Solaris system.  My
 first guess would be: do you ave a 64-bit application and a 32-bit
 built glibc?
 
 -- 
 Daniel Jacobowitz
 MontaVista Software                         Debian GNU/Linux Developer
 
 
 ----- End forwarded message -----
 
 -- 
 Daniel Jacobowitz
 MontaVista Software                         Debian GNU/Linux Developer


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]