[Lldb-commits] [PATCH] Skip symlinks to the original file when searching for debug info
jingham at apple.com
jingham at apple.com
Mon Feb 23 11:59:28 PST 2015
Shouldn't this be a method on FileSpec. It would be fine to back it with the llvm function, but it's weird to have to use a mixture of FileSpec & lower-level llvm file system calls.
Jim
> On Feb 23, 2015, at 10:54 AM, Pavel Labath <labath at google.com> wrote:
>
> Hi emaste, zturner,
>
> Symbols::LocateExecutableSymbolFile tries to locate the file in containing the debug info in a
> splitdebug configuration. It tries to skip over the original file in its search path, but it was
> easily fooled by symlinks. This changes the function to use llvm::sys::fs::equivalent, which can
> correctly compare symlinks.
>
> http://reviews.llvm.org/D7836
>
> Files:
> source/Host/common/Symbols.cpp
> test/functionalities/unwind/noreturn/TestNoreturnUnwind.py
>
> Index: source/Host/common/Symbols.cpp
> ===================================================================
> --- source/Host/common/Symbols.cpp
> +++ source/Host/common/Symbols.cpp
> @@ -87,7 +87,7 @@
> const std::string &filename = files[idx_file];
> FileSpec file_spec (filename.c_str(), true);
>
> - if (file_spec == module_spec.GetFileSpec())
> + if (llvm::sys::fs::equivalent (file_spec.GetPath(), module_spec.GetFileSpec().GetPath()))
> continue;
>
> if (file_spec.Exists())
> Index: test/functionalities/unwind/noreturn/TestNoreturnUnwind.py
> ===================================================================
> --- test/functionalities/unwind/noreturn/TestNoreturnUnwind.py
> +++ test/functionalities/unwind/noreturn/TestNoreturnUnwind.py
> @@ -44,7 +44,9 @@
> thread = process.GetThreadAtIndex(0)
> abort_frame_number = 0
> for f in thread.frames:
> - if f.GetFunctionName() == "abort":
> + # We use endswith() to look for abort() since some C libraries mangle the symbol into
> + # __GI_abort or similar.
> + if f.GetFunctionName().endswith("abort"):
> break
> abort_frame_number = abort_frame_number + 1
>
> EMAIL PREFERENCES
> http://reviews.llvm.org/settings/panel/emailpreferences/
> <D7836.20523.patch>_______________________________________________
> lldb-commits mailing list
> lldb-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits
More information about the lldb-commits
mailing list