Message ID | gerrit.1571152703000.I1ace62a234458781e958980f3b425edf1490df27@gnutoolchain-gerrit.osci.io |
---|---|
State | New |
Headers | show |
Tom Tromey has posted comments on this change. Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/82 ...................................................................... Patch Set 1: Code-Review+2 Thank you for the patch. I'm sorry it took so long to review. This is a tricky area and I procrastinated a while. I think this patch is OK. In the long run, I think I'd prefer that we move the fullname out of the symtab and instead have a dedicated cache for it (perhaps in source_cache). Then we could compute both the user-facing name and the canonical ("real") name, and efficiently choose the one needed at any given point. However, that's reasonably involved and, I think, not required for this to land.
diff --git a/gdb/symtab.c b/gdb/symtab.c index 8a551f1..22c09aa 100644 --- a/gdb/symtab.c +++ b/gdb/symtab.c @@ -478,6 +478,9 @@ gdb_assert (IS_ABSOLUTE_PATH (real_path)); gdb_assert (IS_ABSOLUTE_PATH (name)); + gdb::unique_xmalloc_ptr<char> fullname_real_path + = gdb_realpath (fullname); + fullname = fullname_real_path.get (); if (FILENAME_CMP (real_path, fullname) == 0) { if (callback (s))