[Lldb-commits] [PATCH] D62501: Implement GetSharedLibraryInfoAddress
António Afonso via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Tue Jun 4 07:36:09 PDT 2019
aadsm marked 2 inline comments as done.
aadsm added inline comments.
================
Comment at: lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp:2136
+ sizeof(phdr_entry), bytes_read);
+ if (!error.Success())
+ return LLDB_INVALID_ADDRESS;
----------------
labath wrote:
> Are you sure that ReadMemory doesn't return "success" on partial reads too ?
We correctly return a non-success response if ptrace failed. However, from what I could see ptrace was successfully reading 0's when the memory segment was not readable for instance. I'm not concern if we're reading 0's if the segment is not readable, or should I be?
================
Comment at: lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp:2168
+ return LLDB_INVALID_ADDRESS;
+ // Return the &DT_DEBUG->d_ptr which points to r_debug which contains the
+ // link_map.
----------------
labath wrote:
> The address of r_debug shouldn't ever change, right?
> Wouldn't it be better return &r_debug directly, instead of returning a pointer to a pointer?
It should not change but it might not be initialized yet. But the big reason is because `GetSharedLibraryInfoAddress` should return (which I'm planning to hook up to `qShlibInfoAddr`) the address of where the debug structure pointer is.
At least that's what I gather from reading the `ResolveRendezvousAddress` function, the documentation is not 100% clear (imho).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D62501/new/
https://reviews.llvm.org/D62501
More information about the lldb-commits
mailing list