This is the mail archive of the gdb-patches@sourceware.org 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: Prelink.exp troubles


On Mar  7, 2006, Daniel Jacobowitz <drow@false.org> wrote:

> On Tue, Mar 07, 2006 at 02:02:40AM -0300, Alexandre Oliva wrote:

>> Here's what I'm checking in, in the hopes that the archoring you
>> suggested above is not needed, otherwise I'll take care of it in a
>> subsequent patch.

> Please fix the anchoring.

In the following patch, that I'm checking in as obvious, I fix
anchoring and also tidy up some code added in the original prelink
patch, such that it's absolutely obvious that the l_addr field is
properly initialized in all cases.

for gdb/ChangeLog
from  Alexandre Oliva  <aoliva@redhat.com>

	* solib-svr4.c (svr4_current_sos): Move up initialization of
	l_addr, such that it clearly covers all cases.

for gdb/testsuite/ChangeLog
from  Alexandre Oliva  <aoliva@redhat.com>

	* gdb.base/prelink.exp: Anchor tested-for regular expression
	on gdb prompt.

Index: gdb/solib-svr4.c
===================================================================
RCS file: /cvs/src/src/gdb/solib-svr4.c,v
retrieving revision 1.56
diff -u -p -r1.56 solib-svr4.c
--- gdb/solib-svr4.c 28 Feb 2006 04:28:47 -0000 1.56
+++ gdb/solib-svr4.c 9 Mar 2006 00:07:26 -0000
@@ -704,6 +704,7 @@ svr4_current_sos (void)
       new->lm_info = xmalloc (sizeof (struct lm_info));
       make_cleanup (xfree, new->lm_info);
 
+      new->lm_info->l_addr = (CORE_ADDR)-1;
       new->lm_info->lm = xzalloc (lmo->link_map_size);
       make_cleanup (xfree, new->lm_info->lm);
 
@@ -744,8 +745,6 @@ svr4_current_sos (void)
 	    free_so (new);
 	  else
 	    {
-	      new->lm_info->l_addr = (CORE_ADDR)-1;
-
 	      new->next = 0;
 	      *link_ptr = new;
 	      link_ptr = &new->next;
Index: gdb/testsuite/gdb.base/prelink.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/prelink.exp,v
retrieving revision 1.2
diff -u -p -r1.2 prelink.exp
--- gdb/testsuite/gdb.base/prelink.exp 7 Mar 2006 05:05:29 -0000 1.2
+++ gdb/testsuite/gdb.base/prelink.exp 9 Mar 2006 00:07:26 -0000
@@ -103,8 +103,9 @@ gdb_reinitialize_dir $srcdir/$subdir
 gdb_load ${binfile}
 
 set test "prelink"
+global gdb_prompt
 gdb_test_multiple "core-file $objdir/$subdir/prelink.core" "$test" {
-    -re "warning: \.dynamic section.*not at the expected address.*warning: difference.*caused by prelink, adjusting expectations." {
+    -re "warning: \.dynamic section.*not at the expected address.*warning: difference.*caused by prelink, adjusting expectations.*$gdb_prompt $" {
 	pass "$test"
     }
 }
-- 
Alexandre Oliva         http://www.lsd.ic.unicamp.br/~oliva/
Secretary for FSF Latin America        http://www.fsfla.org/
Red Hat Compiler Engineer   aoliva@{redhat.com, gcc.gnu.org}
Free Software Evangelist  oliva@{lsd.ic.unicamp.br, gnu.org}

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