This is the mail archive of the gdb-patches@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: [PATCH]: Fixes PR gdb/794.


> This problem is also reported in PR gdb/794.
> 
> I encountered a problem while trying to debug a PA64 (hppa64elf) executable 
> (src/temacs, a file generated during the building of emacs-21.2) in gdb-5.2.1.  
> While loading the libraries listed in the .dynamic section, gdb (pa64solib.c 
> (pa64_solib_add) would choke on "empty" entries (entries where all the members 
> of the dll_desc structure were set to 0).  The dld normally ignores/skips 
these 
> entries, but gdb was trying to parse them, generating a "pa64_solib_add, 
unable 
> to read shared library path." error.  So I patched the function to ignore 
> entries where the text base and size, and the data base and size were all 0.  
I 
> also fixed a typo in one of the nearby comments.  Unfortunately, I cannot get 
> expect to work on my system, so I was not able to generate a test case for 
this 
> bug.  What follows is the ChangeLog entry and the 'diff -up' patch for 
> gdb/pa64solib.c
> 
>  - Josh Martin

I'm sorry, this is what I get for not taking sufficient notes over the weekend.  
It turns out dld doesn't skip and "emtpy" entry, it stops on one.  What follows 
are the actual working ChangeLog and patch files.

 - Josh Martin

--------------------------------------
2002-10-09  Josh Martin  <timeslice@iname.com>

	* pa64solib.c (pa64_solib_add): Changed to stop loading on an
	empty library entry, just like dld does.  Fixed typo in comment.
	Fixes PR gdb/794.

--------------------------------------
--- pa64solib.c.old	Wed Oct  9 18:27:53 2002
+++ pa64solib.c	Wed Oct  9 20:01:21 2002
@@ -422,13 +422,19 @@ pa64_solib_add (char *arg_string, int fr
   if ((dld_cache.dld_flags & DT_HP_DEBUG_PRIVATE) == 0)
     warning ("The shared libraries were not privately mapped; setting 
a\nbreakpoint in a shared library will not work until you rerun the 
program.\n");
 
-  /* For each shaerd library, add it to the shared library list.  */
+  /* For each shared library, add it to the shared library list.  */
   for (dll_index = 1; ; dll_index++)
     {
       /* Read in the load module descriptor.  */
       if (dlgetmodinfo (dll_index, &dll_desc, sizeof (dll_desc),
 			pa64_target_read_memory, 0, dld_cache.load_map)
 	  == 0)
+	return;
+
+      /* Stop on an "empty" library entry.  I don't know why this
+         entry is here, but dld stops here so so should we.  */
+      if ((dll_desc.text_base == 0) && (dll_desc.text_size == 0) &&
+	  (dll_desc.data_base == 0) && (dll_desc.data_size == 0))
 	return;
 
       /* Get the name of the shared library.  */


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