teknoraver / rpms / rpm

Forked from rpms/rpm 4 months ago
Clone

Blame rpm-4.4.2-debugopt.patch

Paul Nasrat bb1df7
--- rpm-4.4.2/tools/debugedit.c.dbgopt	2006-10-31 09:29:53.000000000 +0000
Paul Nasrat bb1df7
+++ rpm-4.4.2/tools/debugedit.c	2006-10-31 09:29:59.000000000 +0000
Paul Nasrat bb1df7
@@ -724,37 +724,57 @@
Paul Nasrat bb1df7
 		}
Paul Nasrat bb1df7
 	    }
Paul Nasrat bb1df7
 
Paul Nasrat bb1df7
-	    if (t->attr[i].attr == DW_AT_comp_dir) {
Paul Nasrat bb1df7
-		if (form == DW_FORM_strp &&
Paul Nasrat bb1df7
-	      debug_sections[DEBUG_STR].data)
Paul Nasrat bb1df7
-	    {
Paul Nasrat bb1df7
-	      char *dir;
Paul Nasrat bb1df7
-	      
Paul Nasrat bb1df7
-	      dir = debug_sections[DEBUG_STR].data
Paul Nasrat bb1df7
-		    + do_read_32_relocated (ptr);
Paul Nasrat bb1df7
-	      free (comp_dir);
Paul Nasrat bb1df7
-	      comp_dir = strdup (dir);
Paul Nasrat bb1df7
+	  if (t->attr[i].attr == DW_AT_comp_dir)
Paul Nasrat bb1df7
+	  {
Paul Nasrat bb1df7
+	      if ( form == DW_FORM_string )
Paul Nasrat bb1df7
+	      {
Paul Nasrat bb1df7
+		  free (comp_dir);
Paul Nasrat bb1df7
+		  comp_dir = strdup (ptr);
Paul Nasrat bb1df7
+		  
Paul Nasrat bb1df7
+		  if (phase == 1 && dest_dir && has_prefix (ptr, base_dir))
Paul Nasrat bb1df7
+		  {
Paul Nasrat bb1df7
+		      base_len = strlen (base_dir);
Paul Nasrat bb1df7
+		      dest_len = strlen (dest_dir);
Paul Nasrat bb1df7
+		      
Paul Nasrat bb1df7
+		      memcpy (ptr, dest_dir, dest_len);
Paul Nasrat bb1df7
+		      if (dest_len < base_len)
Paul Nasrat bb1df7
+		      {
Paul Nasrat bb1df7
+			  memset(ptr + dest_len, '/',
Paul Nasrat bb1df7
+				 base_len - dest_len);
Paul Nasrat bb1df7
+			  
Paul Nasrat bb1df7
+		      }
Paul Nasrat bb1df7
+		      elf_flagdata (debug_sections[DEBUG_INFO].elf_data,
Paul Nasrat bb1df7
+				    ELF_C_SET, ELF_F_DIRTY);
Paul Nasrat bb1df7
+		  }
Paul Nasrat bb1df7
+	      }
Paul Nasrat bb1df7
+	  
Paul Nasrat bb1df7
+	      else if (form == DW_FORM_strp &&
Paul Nasrat bb1df7
+		       debug_sections[DEBUG_STR].data)
Paul Nasrat bb1df7
+	      {
Paul Nasrat bb1df7
+		  char *dir;
Paul Nasrat bb1df7
 
Paul Nasrat bb1df7
-	      if (phase == 1 && dest_dir && has_prefix (dir, base_dir))
Paul Nasrat bb1df7
-		{
Paul Nasrat bb1df7
-		  base_len = strlen (base_dir);
Paul Nasrat bb1df7
-		  dest_len = strlen (dest_dir);
Paul Nasrat bb1df7
+		  dir = debug_sections[DEBUG_STR].data
Paul Nasrat bb1df7
+		      + do_read_32_relocated (ptr);
Paul Nasrat bb1df7
+
Paul Nasrat bb1df7
+		  free (comp_dir);
Paul Nasrat bb1df7
+		  comp_dir = strdup (dir);
Paul Nasrat bb1df7
+
Paul Nasrat bb1df7
+		  if (phase == 1 && dest_dir && has_prefix (dir, base_dir))
Paul Nasrat bb1df7
+		  {
Paul Nasrat bb1df7
+		      base_len = strlen (base_dir);
Paul Nasrat bb1df7
+		      dest_len = strlen (dest_dir);
Paul Nasrat bb1df7
 		  
Paul Nasrat bb1df7
-		  memcpy (dir, dest_dir, dest_len);
Paul Nasrat bb1df7
-		  if (dest_len < base_len)
Paul Nasrat bb1df7
-		    {
Paul Nasrat bb1df7
-		      memmove (dir + dest_len, dir + base_len,
Paul Nasrat bb1df7
-			       strlen (dir + base_len) + 1);
Paul Nasrat bb1df7
-		    }
Paul Nasrat bb1df7
-		  elf_flagdata (debug_sections[DEBUG_STR].elf_data,
Paul Nasrat bb1df7
-				ELF_C_SET, ELF_F_DIRTY);
Paul Nasrat bb1df7
-		}
Paul Nasrat bb1df7
-	    }
Paul Nasrat bb1df7
-		else if (form == DW_FORM_string) {
Paul Nasrat bb1df7
-			free(comp_dir);
Paul Nasrat bb1df7
-			comp_dir = strdup (ptr);			
Paul Nasrat bb1df7
-		}
Paul Nasrat bb1df7
-	    }
Paul Nasrat bb1df7
+		      memcpy (dir, dest_dir, dest_len);
Paul Nasrat bb1df7
+		      if (dest_len < base_len)
Paul Nasrat bb1df7
+		      {
Paul Nasrat bb1df7
+			  memmove (dir + dest_len, dir + base_len,
Paul Nasrat bb1df7
+				   strlen (dir + base_len) + 1);
Paul Nasrat bb1df7
+		      }
Paul Nasrat bb1df7
+		      elf_flagdata (debug_sections[DEBUG_STR].elf_data,
Paul Nasrat bb1df7
+				    ELF_C_SET, ELF_F_DIRTY);
Paul Nasrat bb1df7
+		  }
Paul Nasrat bb1df7
+	      }
Paul Nasrat bb1df7
+	  }
Paul Nasrat bb1df7
 	  else if ((t->tag == DW_TAG_compile_unit
Paul Nasrat bb1df7
 		    || t->tag == DW_TAG_partial_unit)
Paul Nasrat bb1df7
 		   && t->attr[i].attr == DW_AT_name