rpms/bug-buddy/devel bug-buddy-build-id.patch, NONE, 1.1 bug-buddy.spec, 1.120, 1.121

Matthias Clasen mclasen at fedoraproject.org
Sun Apr 5 04:32:08 UTC 2009


Author: mclasen

Update of /cvs/pkgs/rpms/bug-buddy/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv14148

Modified Files:
	bug-buddy.spec 
Added Files:
	bug-buddy-build-id.patch 
Log Message:
support build-id


bug-buddy-build-id.patch:

--- NEW FILE bug-buddy-build-id.patch ---
diff -up bug-buddy-2.26.0/gnome-breakpad/gnome-breakpad.cc.build-id bug-buddy-2.26.0/gnome-breakpad/gnome-breakpad.cc
--- bug-buddy-2.26.0/gnome-breakpad/gnome-breakpad.cc.build-id	2009-02-26 19:56:50.000000000 -0500
+++ bug-buddy-2.26.0/gnome-breakpad/gnome-breakpad.cc	2009-03-17 18:23:24.376646444 -0400
@@ -263,6 +263,29 @@ find_in_debug_path (const char *filename
 	return result;
 }
 
+static gboolean
+find_build_id_file (const char *build_id, unsigned int length)
+{
+	char *build_id_abspath;
+	gboolean result = false;
+	int i;
+
+	/* build_id is a 20-byte bitstring. gdb will look for a file named
+	   /usr/lib/debug.build-id/xx/yyy...y.debug, where 'xx' is the first 2
+	   hex characters of the buildid bit string and yyy...y is the hex
+           representation of the rest of the bit string. */
+	GString *s = g_string_new(NULL);
+	g_string_append_printf(s, "%02x/", (unsigned char)build_id[0]);
+	for (i = 1; i < length; i++)
+		g_string_append_printf(s, "%02x", (unsigned char)build_id[i]);
+	g_string_append(s, ".debug");
+
+	build_id_abspath = g_build_filename("/usr", "lib", "debug", ".build-id", s->str, NULL);
+	result = g_file_test(build_id_abspath, G_FILE_TEST_EXISTS);
+	g_free(build_id_abspath);
+	g_string_free(s, TRUE);
+	return result;
+}
 
 static gboolean
 elf_has_debug_symbols (const char *filename)
@@ -310,6 +333,23 @@ elf_has_debug_symbols (const char *filen
 			}
 		}
               }
+                /* Check for .note.gnu.build-id separate debug file */
+		if (shdr.sh_type == SHT_NOTE) {
+			name = elf_strptr(elf, elf_header.e_shstrndx, shdr.sh_name);
+			if (strcmp (name, ".note.gnu.build-id") == 0) {
+				Elf_Data *edata;
+				edata = elf_getdata(section, NULL);
+				if (edata != NULL) {
+					GElf_Nhdr nhdr;
+					size_t off, noff, doff;
+					off = gelf_getnote(edata, 0, &nhdr, &noff, &doff);
+					if ((off > 0) && find_build_id_file((const char*)edata->d_buf + doff, nhdr.n_descsz)) {
+						elf_end (elf);
+						return true;
+					}
+				}
+			}
+		}
        }
 
        /* no symtab neither debug file present */


Index: bug-buddy.spec
===================================================================
RCS file: /cvs/pkgs/rpms/bug-buddy/devel/bug-buddy.spec,v
retrieving revision 1.120
retrieving revision 1.121
diff -u -r1.120 -r1.121
--- bug-buddy.spec	17 Mar 2009 04:44:41 -0000	1.120
+++ bug-buddy.spec	5 Apr 2009 04:31:37 -0000	1.121
@@ -6,7 +6,7 @@
 
 Name: bug-buddy
 Version: 2.26.0
-Release: 1%{?dist}
+Release: 2%{?dist}
 Epoch: 1
 Summary: Crash reporting utility for the GNOME desktop
 License: GPLv2 and BSD
@@ -51,6 +51,7 @@
 Requires(postun): desktop-file-utils >= %{desktop_file_utils_version}
 
 Patch0: bug-buddy-c++.patch
+Patch1: bug-buddy-build-id.patch
 
 %description
 Bug-buddy is a crash reporting utility for the GNOME desktop.
@@ -61,6 +62,7 @@
 %prep
 %setup -q
 %patch0 -p1 -b .c++
+%patch1 -p1 -b .build-id
 
 %build
 %configure --disable-scrollkeeper
@@ -142,6 +144,9 @@
 %{_sysconfdir}/gconf/schemas/*
 
 %changelog
+* Sun Apr  5 2009 Matthias Clasen <mclasen at redhat.com> - 1:2.26.0-2
+- Support build-id (#490778)
+
 * Tue Mar 17 2009 Matthias Clasen <mclasen at redhat.com> - 1:2.26.0-1
 - Update to 2.26.0
 




More information about the fedora-extras-commits mailing list