From: Julian Seward Date: Tue, 17 Feb 2015 13:46:26 +0000 (+0000) Subject: ML_(find_name_of_pdb_file): bit a bit more careful when grepping the X-Git-Tag: svn/VALGRIND_3_11_0~654 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3aa09eb3bf416036269e0d5984e102d4f48111e8;p=thirdparty%2Fvalgrind.git ML_(find_name_of_pdb_file): bit a bit more careful when grepping the output from /usr/bin/strings, so as to not get confused by substrings ".pdb" and ".PDB" when they don't appear at the end of a line. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14938 --- diff --git a/coregrind/m_debuginfo/readpdb.c b/coregrind/m_debuginfo/readpdb.c index be0cd3f467..1adfda29b9 100644 --- a/coregrind/m_debuginfo/readpdb.c +++ b/coregrind/m_debuginfo/readpdb.c @@ -2436,7 +2436,7 @@ HChar* ML_(find_name_of_pdb_file)( const HChar* pename ) do_cleanup = True; /* Make up the command to run, essentially: - sh -c "strings (pename) | egrep '\.pdb|\.PDB' > (tmpname)" + sh -c "strings (pename) | egrep '\.pdb$|\.PDB$' > (tmpname)" */ const HChar* sh = "/bin/sh"; const HChar* strings = "/usr/bin/strings"; @@ -2447,7 +2447,7 @@ HChar* ML_(find_name_of_pdb_file)( const HChar* pename ) + VG_(strlen)(egrep) + VG_(strlen)(tmpname) + 100/*misc*/; HChar* cmd = ML_(dinfo_zalloc)("di.readpe.fnopf.cmd", cmdlen); - VG_(sprintf)(cmd, "%s -c \"%s '%s' | %s '\\.pdb|\\.PDB' >> %s\"", + VG_(sprintf)(cmd, "%s -c \"%s '%s' | %s '\\.pdb$|\\.PDB$' >> %s\"", sh, strings, pename, egrep, tmpname); vg_assert(cmd[cmdlen-1] == 0); if (0) VG_(printf)("QQQQQQQQ: %s\n", cmd);