On 2013-03-03 21:02, Dimitry Andric wrote:
On 2013-03-03 17:36, Andriy Gapon wrote:
on 03/03/2013 17:45 Dimitry Andric said the following:
...
So to fix this inconsistency, we could either change dw_read() to use
the full name instead of the basename, or change sort_iidescs() to use
the basename instead of the full name.

The only upstream I have been able to find, Illumos, had the same code
as FreeBSD for both of these functions, so it is likely they never
noticed it before...

My preference would be to remove the basename() call from dw_read(), as
in the attached diff.  That seems to fix the problem here; the diff of
ctfdump output before and after becomes:

Actually, that way of fixing breaks it for gcc, so it should really be
fixed in sort_iidescs() instead.  See attached diff; I verified it works
for both gcc-compiled and clang-compiled objects.
Index: cddl/contrib/opensolaris/tools/ctf/cvt/output.c
===================================================================
--- cddl/contrib/opensolaris/tools/ctf/cvt/output.c	(revision 247448)
+++ cddl/contrib/opensolaris/tools/ctf/cvt/output.c	(working copy)
@@ -363,6 +363,7 @@ sort_iidescs(Elf *elf, const char *file, tdata_t *
 
 	for (i = 0; i < nent; i++) {
 		GElf_Sym sym;
+		char *bname;
 		iidesc_t **tolist;
 		GElf_Sym ssym;
 		iidesc_match_t smatch;
@@ -377,6 +378,8 @@ sort_iidescs(Elf *elf, const char *file, tdata_t *
 
 		switch (GELF_ST_TYPE(sym.st_info)) {
 		case STT_FILE:
+			bname = strrchr(match.iim_name, '/');
+			bname = bname == NULL ? match.iim_name : bname + 1;
 			match.iim_file = match.iim_name;
 			continue;
 		case STT_OBJECT:
_______________________________________________
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"

Reply via email to