Make gdb-add-index better respect relative paths and bind mounts.
Make gdb-add-index better respect relative paths and bind mounts.

Without this, gdb-add-index incorrectly skips DSO dependencies if running from a symlink.  $(pwd) returns the path to your directory via the symlink, but ldd returns the "realpath".  Using dirname allows you to match a substring of the path returned by ldd.

BUG=none

Review URL: https://chromiumcodereview.appspot.com/10913264

git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@156968 0039d316-1c4b-4281-b951-d872f2087c98

krieger-od/nwjs_chromium.src,bright-sparks/chromium-spacewalk,Just-D/chromium-1,dushu1203/chromium.src,pozdnyakov/chromium-crosswalk,dushu1203/chromium.src,fujunwei/chromium-crosswalk,junmin-zhu/chromium-rivertrail,PeterWangIntel/chromium-crosswalk,Chilledheart/chromium,hgl888/chromium-crosswalk,anirudhSK/chromium,dushu1203/chromium.src,patrickm/chromium.src,mogoweb/chromium-crosswalk,ChromiumWebApps/chromium,hujiajie/pa-chromium,patrickm/chromium.src,mohamed--abdel-maksoud/chromium.src,Fireblend/chromium-crosswalk,Chilledheart/chromium,dushu1203/chromium.src,fujunwei/chromium-crosswalk,zcbenz/cefode-chromium,dednal/chromium.src,ltilve/chromium,Jonekee/chromium.src,ltilve/chromium,nacl-webkit/chrome_deps,markYoungH/chromium.src,TheTypoMaster/chromium-crosswalk,timopulkkinen/BubbleFish,M4sse/chromium.src,zcbenz/cefode-chromium,axinging/chromium-crosswalk,markYoungH/chromium.src,Jonekee/chromium.src,TheTypoMaster/chromium-crosswalk,junmin-zhu/chromium-rivertrail,pozdnyakov/chromium-crosswalk,junmin-zhu/chromium-rivertrail,PeterWangIntel/chromium-crosswalk,ChromiumWebApps/chromium,mogoweb/chromium-crosswalk,zcbenz/cefode-chromium,ondra-novak/chromium.src,Chilledheart/chromium,ChromiumWebApps/chromium,mohamed--abdel-maksoud/chromium.src,timopulkkinen/BubbleFish,jaruba/chromium.src,zcbenz/cefode-chromium,fujunwei/chromium-crosswalk,hgl888/chromium-crosswalk,chuan9/chromium-crosswalk,littlstar/chromium.src,hgl888/chromium-crosswalk,zcbenz/cefode-chromium,ondra-novak/chromium.src,nacl-webkit/chrome_deps,jaruba/chromium.src,mogoweb/chromium-crosswalk,nacl-webkit/chrome_deps,krieger-od/nwjs_chromium.src,chuan9/chromium-crosswalk,jaruba/chromium.src,Jonekee/chromium.src,crosswalk-project/chromium-crosswalk-efl,Chilledheart/chromium,pozdnyakov/chromium-crosswalk,chuan9/chromium-crosswalk,fujunwei/chromium-crosswalk,chuan9/chromium-crosswalk,pozdnyakov/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,Jonekee/chromium.src,hgl888/chromium-crosswalk-efl,littlstar/chromium.src,ChromiumWebApps/chromium,krieger-od/nwjs_chromium.src,TheTypoMaster/chromium-crosswalk,hgl888/chromium-crosswalk-efl,Jonekee/chromium.src,nacl-webkit/chrome_deps,Fireblend/chromium-crosswalk,anirudhSK/chromium,nacl-webkit/chrome_deps,dednal/chromium.src,fujunwei/chromium-crosswalk,bright-sparks/chromium-spacewalk,ltilve/chromium,markYoungH/chromium.src,mohamed--abdel-maksoud/chromium.src,Fireblend/chromium-crosswalk,timopulkkinen/BubbleFish,krieger-od/nwjs_chromium.src,pozdnyakov/chromium-crosswalk,ChromiumWebApps/chromium,Fireblend/chromium-crosswalk,dednal/chromium.src,mohamed--abdel-maksoud/chromium.src,Jonekee/chromium.src,chuan9/chromium-crosswalk,anirudhSK/chromium,M4sse/chromium.src,M4sse/chromium.src,timopulkkinen/BubbleFish,jaruba/chromium.src,timopulkkinen/BubbleFish,zcbenz/cefode-chromium,pozdnyakov/chromium-crosswalk,hujiajie/pa-chromium,patrickm/chromium.src,mogoweb/chromium-crosswalk,anirudhSK/chromium,Pluto-tv/chromium-crosswalk,Fireblend/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,axinging/chromium-crosswalk,ltilve/chromium,mohamed--abdel-maksoud/chromium.src,axinging/chromium-crosswalk,markYoungH/chromium.src,chuan9/chromium-crosswalk,dednal/chromium.src,markYoungH/chromium.src,Just-D/chromium-1,junmin-zhu/chromium-rivertrail,timopulkkinen/BubbleFish,hujiajie/pa-chromium,Pluto-tv/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,Chilledheart/chromium,bright-sparks/chromium-spacewalk,hgl888/chromium-crosswalk-efl,axinging/chromium-crosswalk,Pluto-tv/chromium-crosswalk,dednal/chromium.src,ltilve/chromium,markYoungH/chromium.src,jaruba/chromium.src,jaruba/chromium.src,ltilve/chromium,M4sse/chromium.src,nacl-webkit/chrome_deps,jaruba/chromium.src,PeterWangIntel/chromium-crosswalk,pozdnyakov/chromium-crosswalk,dushu1203/chromium.src,littlstar/chromium.src,hujiajie/pa-chromium,krieger-od/nwjs_chromium.src,junmin-zhu/chromium-rivertrail,hujiajie/pa-chromium,littlstar/chromium.src,Jonekee/chromium.src,jaruba/chromium.src,ondra-novak/chromium.src,dushu1203/chromium.src,markYoungH/chromium.src,ChromiumWebApps/chromium,axinging/chromium-crosswalk,ChromiumWebApps/chromium,littlstar/chromium.src,dushu1203/chromium.src,ltilve/chromium,junmin-zhu/chromium-rivertrail,Just-D/chromium-1,hujiajie/pa-chromium,hgl888/chromium-crosswalk-efl,Just-D/chromium-1,Pluto-tv/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,M4sse/chromium.src,timopulkkinen/BubbleFish,dushu1203/chromium.src,markYoungH/chromium.src,ondra-novak/chromium.src,Jonekee/chromium.src,hujiajie/pa-chromium,Fireblend/chromium-crosswalk,M4sse/chromium.src,PeterWangIntel/chromium-crosswalk,pozdnyakov/chromium-crosswalk,bright-sparks/chromium-spacewalk,ChromiumWebApps/chromium,Jonekee/chromium.src,hgl888/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,junmin-zhu/chromium-rivertrail,Jonekee/chromium.src,anirudhSK/chromium,hujiajie/pa-chromium,PeterWangIntel/chromium-crosswalk,markYoungH/chromium.src,axinging/chromium-crosswalk,Just-D/chromium-1,TheTypoMaster/chromium-crosswalk,timopulkkinen/BubbleFish,hgl888/chromium-crosswalk,dushu1203/chromium.src,hgl888/chromium-crosswalk-efl,krieger-od/nwjs_chromium.src,TheTypoMaster/chromium-crosswalk,hgl888/chromium-crosswalk-efl,mohamed--abdel-maksoud/chromium.src,krieger-od/nwjs_chromium.src,Chilledheart/chromium,hujiajie/pa-chromium,PeterWangIntel/chromium-crosswalk,zcbenz/cefode-chromium,mogoweb/chromium-crosswalk,pozdnyakov/chromium-crosswalk,patrickm/chromium.src,ChromiumWebApps/chromium,ondra-novak/chromium.src,chuan9/chromium-crosswalk,pozdnyakov/chromium-crosswalk,timopulkkinen/BubbleFish,crosswalk-project/chromium-crosswalk-efl,Pluto-tv/chromium-crosswalk,hgl888/chromium-crosswalk,hujiajie/pa-chromium,fujunwei/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,Pluto-tv/chromium-crosswalk,patrickm/chromium.src,krieger-od/nwjs_chromium.src,krieger-od/nwjs_chromium.src,zcbenz/cefode-chromium,ondra-novak/chromium.src,Just-D/chromium-1,hgl888/chromium-crosswalk-efl,anirudhSK/chromium,PeterWangIntel/chromium-crosswalk,mogoweb/chromium-crosswalk,zcbenz/cefode-chromium,dednal/chromium.src,mogoweb/chromium-crosswalk,hgl888/chromium-crosswalk-efl,Pluto-tv/chromium-crosswalk,fujunwei/chromium-crosswalk,dednal/chromium.src,bright-sparks/chromium-spacewalk,ondra-novak/chromium.src,axinging/chromium-crosswalk,ChromiumWebApps/chromium,hgl888/chromium-crosswalk,hgl888/chromium-crosswalk-efl,junmin-zhu/chromium-rivertrail,nacl-webkit/chrome_deps,pozdnyakov/chromium-crosswalk,patrickm/chromium.src,mogoweb/chromium-crosswalk,Chilledheart/chromium,Chilledheart/chromium,markYoungH/chromium.src,mogoweb/chromium-crosswalk,krieger-od/nwjs_chromium.src,TheTypoMaster/chromium-crosswalk,Just-D/chromium-1,M4sse/chromium.src,bright-sparks/chromium-spacewalk,Fireblend/chromium-crosswalk,mogoweb/chromium-crosswalk,M4sse/chromium.src,M4sse/chromium.src,axinging/chromium-crosswalk,jaruba/chromium.src,littlstar/chromium.src,anirudhSK/chromium,patrickm/chromium.src,bright-sparks/chromium-spacewalk,M4sse/chromium.src,anirudhSK/chromium,markYoungH/chromium.src,hgl888/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,anirudhSK/chromium,jaruba/chromium.src,ondra-novak/chromium.src,patrickm/chromium.src,nacl-webkit/chrome_deps,ltilve/chromium,littlstar/chromium.src,Just-D/chromium-1,chuan9/chromium-crosswalk,zcbenz/cefode-chromium,axinging/chromium-crosswalk,anirudhSK/chromium,dednal/chromium.src,bright-sparks/chromium-spacewalk,nacl-webkit/chrome_deps,patrickm/chromium.src,fujunwei/chromium-crosswalk,zcbenz/cefode-chromium,Fireblend/chromium-crosswalk,nacl-webkit/chrome_deps,dednal/chromium.src,bright-sparks/chromium-spacewalk,Chilledheart/chromium,junmin-zhu/chromium-rivertrail,dednal/chromium.src,M4sse/chromium.src,PeterWangIntel/chromium-crosswalk,dushu1203/chromium.src,Jonekee/chromium.src,junmin-zhu/chromium-rivertrail,timopulkkinen/BubbleFish,ondra-novak/chromium.src,crosswalk-project/chromium-crosswalk-efl,Pluto-tv/chromium-crosswalk,anirudhSK/chromium,axinging/chromium-crosswalk,ChromiumWebApps/chromium,Fireblend/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,hgl888/chromium-crosswalk-efl,crosswalk-project/chromium-crosswalk-efl,chuan9/chromium-crosswalk,Just-D/chromium-1,junmin-zhu/chromium-rivertrail,dushu1203/chromium.src,jaruba/chromium.src,anirudhSK/chromium,mohamed--abdel-maksoud/chromium.src,axinging/chromium-crosswalk,ltilve/chromium,Pluto-tv/chromium-crosswalk,littlstar/chromium.src,mohamed--abdel-maksoud/chromium.src,mohamed--abdel-maksoud/chromium.src,nacl-webkit/chrome_deps,ChromiumWebApps/chromium,mohamed--abdel-maksoud/chromium.src,crosswalk-project/chromium-crosswalk-efl,hujiajie/pa-chromium,hgl888/chromium-crosswalk,dednal/chromium.src,krieger-od/nwjs_chromium.src,timopulkkinen/BubbleFish,fujunwei/chromium-crosswalk