MI fix allowing multiple logging instances of lldb-mi to run simultaneously.
authorIlia K <ki.stfu@gmail.com>
Thu, 23 Apr 2015 12:48:42 +0000 (12:48 +0000)
committerIlia K <ki.stfu@gmail.com>
Thu, 23 Apr 2015 12:48:42 +0000 (12:48 +0000)
commit3b0494c304c9d9e88def84f2b1f2a1352727e8b4
treee24b22cb15ec38e34ad7c2a46a7d3a14edec281a
parent2165de8894a347895160bf3aca48d5324e725adc
MI fix allowing multiple logging instances of lldb-mi to run simultaneously.

Summary:
Currently if two instances of lldb-mi are running with logging enabled using '--log' the log file conflicts. This produces the following error
MI: Error: File Handler. Error Permission denied opening 'C:\Users\Ewan\LLVM\build\Debug\bin\lldb-mi-log.txt'

Fixed in this patch by renaming lldb-mi-log.txt based on the date, e.g. lldb-mi-log.txt-20150316163631.log, and moving the file into the temp directory by using the --log-dir option.

Regrading previous review comments the P_tmpdir macro is defined in Windows but always points to "\", which doesn't help much. Also when using the Windows API for GetTempPath() dynamic memory seems much more messy.

Patch from ewan@codeplay.com

Reviewers: abidh, EwanCrawford

Subscribers: zturner, lldb-commits, deepak2427

Differential Revision: http://reviews.llvm.org/D9054

llvm-svn: 235589
lldb/test/tools/lldb-mi/startup_options/TestMiStartupOptions.py
lldb/tools/lldb-mi/MICmnLogMediumFile.cpp
lldb/tools/lldb-mi/MICmnLogMediumFile.h
lldb/tools/lldb-mi/MICmnResources.cpp
lldb/tools/lldb-mi/MICmnResources.h
lldb/tools/lldb-mi/MIDriverMgr.cpp
lldb/tools/lldb-mi/MIUtilDateTimeStd.cpp
lldb/tools/lldb-mi/MIUtilDateTimeStd.h
lldb/tools/lldb-mi/MIUtilSystemWindows.cpp