Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* Re: [RFA] Fix gdb.base/gdb1250.exp to work when abort() is in a shared library
@ 2004-02-23  6:04 Michael Elizabeth Chastain
  2004-02-23  6:26 ` Fred Fish
  0 siblings, 1 reply; 5+ messages in thread
From: Michael Elizabeth Chastain @ 2004-02-23  6:04 UTC (permalink / raw)
  To: fnf; +Cc: gdb-patches

I think this would be a bad change.  It's entirely reasonable for a user
to set a breakpoint on 'abort' or 'exit' or some other libc function in
a .gdbinit file or at the beginning of a gdb session.

On native i686-pc-linux-gnu, this used to work and then stopped
working with a PLT optimization in binutils HEAD.

Michael C

+ 2004-02-22  Fred Fish  <fnf@redhat.com>
+ 
+ 	* gdb.base/gdb1250.exp: Run to main before trying to
+ 	run to abort.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [RFA] Fix gdb.base/gdb1250.exp to work when abort() is in a shared library
  2004-02-23  6:04 [RFA] Fix gdb.base/gdb1250.exp to work when abort() is in a shared library Michael Elizabeth Chastain
@ 2004-02-23  6:26 ` Fred Fish
  2004-02-23 13:57   ` Daniel Jacobowitz
  2004-02-23 13:58   ` Daniel Jacobowitz
  0 siblings, 2 replies; 5+ messages in thread
From: Fred Fish @ 2004-02-23  6:26 UTC (permalink / raw)
  To: Michael Elizabeth Chastain, fnf; +Cc: gdb-patches

On Sunday 22 February 2004 23:04, Michael Elizabeth Chastain wrote:
> On native i686-pc-linux-gnu, this used to work and then stopped
> working with a PLT optimization in binutils HEAD.

Thanks for the history on why this doesn't currently work.  Most of my
shared library work with gdb was from way back in the days when I'm
pretty sure that you couldn't set breakpoints on symbols in shared
libraries that had not yet been loaded, but perhaps I'm
misremembering.

Perhaps it would make sense to go ahead and install this change and
then have a separate test that specifically checks that gdb can set a
breakpoint on symbols expected to be in a shared library.

-Fred



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [RFA] Fix gdb.base/gdb1250.exp to work when abort() is in a shared library
  2004-02-23  6:26 ` Fred Fish
@ 2004-02-23 13:57   ` Daniel Jacobowitz
  2004-02-23 13:58   ` Daniel Jacobowitz
  1 sibling, 0 replies; 5+ messages in thread
From: Daniel Jacobowitz @ 2004-02-23 13:57 UTC (permalink / raw)
  To: fnf; +Cc: Michael Elizabeth Chastain, gdb-patches

On Sun, Feb 22, 2004 at 11:26:33PM -0700, Fred Fish wrote:
> On Sunday 22 February 2004 23:04, Michael Elizabeth Chastain wrote:
> > On native i686-pc-linux-gnu, this used to work and then stopped
> > working with a PLT optimization in binutils HEAD.
> 
> Thanks for the history on why this doesn't currently work.  Most of my
> shared library work with gdb was from way back in the days when I'm
> pretty sure that you couldn't set breakpoints on symbols in shared
> libraries that had not yet been loaded, but perhaps I'm
> misremembering.
> 
> Perhaps it would make sense to go ahead and install this change and
> then have a separate test that specifically checks that gdb can set a
> breakpoint on symbols expected to be in a shared library.

I believe that Jeff submitted a patch to use pending breakpoints in
this test, which also fixes the issue.  Did that get lost?

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [RFA] Fix gdb.base/gdb1250.exp to work when abort() is in a shared library
  2004-02-23  6:26 ` Fred Fish
  2004-02-23 13:57   ` Daniel Jacobowitz
@ 2004-02-23 13:58   ` Daniel Jacobowitz
  1 sibling, 0 replies; 5+ messages in thread
From: Daniel Jacobowitz @ 2004-02-23 13:58 UTC (permalink / raw)
  To: fnf; +Cc: Michael Elizabeth Chastain, gdb-patches

On Sun, Feb 22, 2004 at 11:26:33PM -0700, Fred Fish wrote:
> On Sunday 22 February 2004 23:04, Michael Elizabeth Chastain wrote:
> > On native i686-pc-linux-gnu, this used to work and then stopped
> > working with a PLT optimization in binutils HEAD.
> 
> Thanks for the history on why this doesn't currently work.  Most of my
> shared library work with gdb was from way back in the days when I'm
> pretty sure that you couldn't set breakpoints on symbols in shared
> libraries that had not yet been loaded, but perhaps I'm
> misremembering.
> 
> Perhaps it would make sense to go ahead and install this change and
> then have a separate test that specifically checks that gdb can set a
> breakpoint on symbols expected to be in a shared library.

I stand corrected.  The patch I was thinking of was from Michael, and
was waiting on me (or someone else) to do a bit of TCL dancing.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [RFA] Fix gdb.base/gdb1250.exp to work when abort() is in a shared library
@ 2004-02-23  5:57 Fred Fish
  0 siblings, 0 replies; 5+ messages in thread
From: Fred Fish @ 2004-02-23  5:57 UTC (permalink / raw)
  To: gdb-patches; +Cc: fnf

The gdb1250.exp test tries to run directly to abort(), which fails if
abort() is in a shared library that hasn't yet been loaded.  For
example the the i686-pc-linux-gnu native test fails:

	FAIL: gdb.base/gdb1250.exp: setting breakpoint at abort
	ERROR: couldn't run to breakpoint

By first running to main, the shared libc gets loaded and then the
run to abort() works.  Here is a patch.

-Fred


+ 2004-02-22  Fred Fish  <fnf@redhat.com>
+ 
+ 	* gdb.base/gdb1250.exp: Run to main before trying to
+ 	run to abort.
+ 

Index: gdb.base/gdb1250.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/gdb1250.exp,v
retrieving revision 1.1
diff -c -p -r1.1 gdb1250.exp
*** gdb.base/gdb1250.exp	15 Jul 2003 16:28:21 -0000	1.1
--- gdb.base/gdb1250.exp	23 Feb 2004 05:54:30 -0000
***************
*** 1,4 ****
! # Copyright 2003 Free Software Foundation, Inc.
  
  # This program is free software; you can redistribute it and/or modify
  # it under the terms of the GNU General Public License as published by
--- 1,4 ----
! # Copyright 2003, 2004 Free Software Foundation, Inc.
  
  # This program is free software; you can redistribute it and/or modify
  # it under the terms of the GNU General Public License as published by
*************** gdb_exit
*** 41,46 ****
--- 41,55 ----
  gdb_start
  gdb_reinitialize_dir $srcdir/$subdir
  gdb_load ${binfile}
+ 
+ # First run to main so that any shared libc gets loaded.  That is
+ # probably where abort() lives and gdb won't know how to find it to
+ # set a breakpoint there until the shared library symbols are read in.
+ 
+ if ![runto_main] then {
+     perror "couldn't run to main"
+     continue
+ }
  
  if ![runto abort] then {
      perror "couldn't run to breakpoint"



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2004-02-23 13:58 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-02-23  6:04 [RFA] Fix gdb.base/gdb1250.exp to work when abort() is in a shared library Michael Elizabeth Chastain
2004-02-23  6:26 ` Fred Fish
2004-02-23 13:57   ` Daniel Jacobowitz
2004-02-23 13:58   ` Daniel Jacobowitz
  -- strict thread matches above, loose matches on Subject: below --
2004-02-23  5:57 Fred Fish

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox