-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Fully implement dbgshim so it doesn't depend on LD_LIBRARY_PATH (issue #650) #1141
Conversation
…e #650). It finds and uses the path coreclr is in to load dbi/dac. EnumProcessModules returns an array of module base addresses and GetModuleFileNameEx takes the base address and returns the module name string. Fixed directory separator in dbgshim.
if (inode != 0) | ||
{ | ||
bool dup = false; | ||
for (ProcessModules *entry = listHead; entry != NULL; entry = entry->Next) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it really possible to have shared library mapped to non-contiguous blocks of memory? If not, we can get rid of this loop and only check current list head.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is usually true except I did see a map like this:
7f18da0dc000-7f18da2db000 ---p 00025000 fc:00 1048889 /lib/x86_64-linux-gnu/libtinfo.so.5.9
7f18da2db000-7f18da2df000 r--p 00024000 fc:00 1048889 /lib/x86_64-linux-gnu/libtinfo.so.5.9
7f18da2df000-7f18da2e0000 rw-p 00028000 fc:00 1048889 /lib/x86_64-linux-gnu/libtinfo.so.5.9
7f18da2e0000-7f18da304000 r-xp 00000000 fc:00 1050720 /lib/x86_64-linux-gnu/ld-2.21.so
7f18da4e8000-7f18da4eb000 rw-p 00000000 00:00 0
7f18da4fa000-7f18da501000 r--s 00000000 fc:00 15999053 /usr/lib/x86_64-linux-gnu/gconv/gconv-modules.cache
7f18da501000-7f18da503000 rw-p 00000000 00:00 0
7f18da503000-7f18da504000 r--p 00023000 fc:00 1050720 /lib/x86_64-linux-gnu/ld-2.21.so
7f18da504000-7f18da505000 rw-p 00024000 fc:00 1050720 /lib/x86_64-linux-gnu/ld-2.21.so
7f18da505000-7f18da506000 rw-p 00000000 00:00 0
And I guess I was just being thorough.
mikem
From: Eugene Zemtsov [mailto:notifications@github.com]
Sent: Monday, June 15, 2015 3:10 PM
To: dotnet/coreclr
Cc: Mike McLaughlin
Subject: Re: [coreclr] Fully implement dbgshim so it doesn't depend on LD_LIBRARY_PATH (issue #650) (#1141)
In src/pal/src/thread/process.cpphttps://github.com//pull/1141#discussion_r32472765:
- int count = 0;
- ssize_t read;
- // Reading maps file line by line
- while ((read = getline(&line, &lineLen, mapsFile)) != -1)
- {
void *startAddress, *endAddress, *offset;
int devHi, devLo, inode;
char moduleName[PATH_MAX];
if (sscanf(line, "%p-%p %*[-rwxsp] %p %x:%x %d %s\n", &startAddress, &endAddress, &offset, &devHi, &devLo, &inode, moduleName) == 7)
{
if (inode != 0)
{
bool dup = false;
for (ProcessModules *entry = listHead; entry != NULL; entry = entry->Next)
Is it really possible to have shared library mapped to non-contiguous blocks of memory? If not, we get rid of this loop and only check current list head.
—
Reply to this email directly or view it on GitHubhttps://github.com//pull/1141/files#r32472765.
сс @noahfalk |
lgtm, albeit I didn't scrutinize too closely. Let me know if you think more scrutiny is worthwhile ; ) |
Fully implement dbgshim so it doesn't depend on LD_LIBRARY_PATH (issue #650)
It finds and uses the path coreclr is in to load dbi/dac.
EnumProcessModules returns an array of module base addresses and GetModuleFileNameEx
takes the base address and returns the module name string.
Fixed directory separator in dbgshim.