]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
ML_(find_name_of_pdb_file): bit a bit more careful when grepping the
authorJulian Seward <jseward@acm.org>
Tue, 17 Feb 2015 13:46:26 +0000 (13:46 +0000)
committerJulian Seward <jseward@acm.org>
Tue, 17 Feb 2015 13:46:26 +0000 (13:46 +0000)
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

coregrind/m_debuginfo/readpdb.c

index be0cd3f467fbdef0cf00128785f9f1c404b3d567..1adfda29b9341682ffc659e2251725de76489c76 100644 (file)
@@ -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);