@@ -331,13 +331,13 @@ static std::vector<std::string> split(const std::string &str, const std::string
331
331
return ret;
332
332
}
333
333
334
- static std::string getDumpFileName (const Settings& settings, const std::string& filename)
334
+ static std::string getDumpFileName (const Settings& settings, const std::string& filename, std::string cfgHash = " " )
335
335
{
336
336
std::string extension;
337
- if (settings.dump || !settings.buildDir .empty ())
337
+ if (( settings.dump || !settings.buildDir . empty ()) && !cfgHash .empty ())
338
338
extension = " .dump" ;
339
339
else
340
- extension = " ." + std::to_string (settings. pid ) + " .dump" ;
340
+ extension = " ." + cfgHash + " .dump" ;
341
341
342
342
if (!settings.dump && !settings.buildDir .empty ())
343
343
return AnalyzerInformation::getAnalyzerInfoFile (settings.buildDir , filename, " " ) + extension;
@@ -352,11 +352,12 @@ static std::string getCtuInfoFileName(const std::string &dumpFile)
352
352
static void createDumpFile (const Settings& settings,
353
353
const FileWithDetails& file,
354
354
std::ofstream& fdump,
355
- std::string& dumpFile)
355
+ std::string& dumpFile,
356
+ std::string cfgHash = " " )
356
357
{
357
358
if (!settings.dump && settings.addons .empty ())
358
359
return ;
359
- dumpFile = getDumpFileName (settings, file.spath ());
360
+ dumpFile = getDumpFileName (settings, file.spath (), cfgHash );
360
361
361
362
fdump.open (dumpFile);
362
363
if (!fdump.is_open ())
@@ -1063,7 +1064,7 @@ unsigned int CppCheck::checkFile(const FileWithDetails& file, const std::string
1063
1064
// write dump file xml prolog
1064
1065
std::ofstream fdump;
1065
1066
std::string dumpFile;
1066
- createDumpFile (mSettings , file, fdump, dumpFile);
1067
+ createDumpFile (mSettings , file, fdump, dumpFile, cfgHash );
1067
1068
if (fdump.is_open ()) {
1068
1069
fdump << getLibraryDumpData ();
1069
1070
fdump << dumpProlog;
0 commit comments