[lldb-dev] Patch to Attach pid successfully from different dir

vignesh balu via lldb-dev lldb-dev at lists.llvm.org
Wed Apr 19 07:15:15 PDT 2017


Hi,
Firstly, I am new to the community, So please bear with my mistakes and
guide me to be on your wavelength.

While using lldb we found the small bug with attaching to the running
process.
"attach" works fine when we run the lldb on the same dir where we ran the
executable but not if the dir changes.

> cd lldb_temp/
> ./test &
[2] 39044
> cd ../
> /b/vignesh/lldb_daily_build/20170419_bkup/binaries/bin/lldb
(lldb) attach 39044
error: attach failed: unable to find executable for './test'

I see the lldb using the relative path instead of absolute path of the exe.
Modified the way sysctl gets the exe name to get the absolute path.

Attached the patch which does the work. I did my testing on Fbsd10.
Please let me know how to commit it

-regards,
vbalu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20170419/67005641/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Fix_for_attach_issue.patch
Type: application/octet-stream
Size: 1713 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20170419/67005641/attachment.obj>


More information about the lldb-dev mailing list