Re: [Lldb-commits] [PATCH] Add Read Thread to GDBRemoteCommunication.
Ewan, has your non-stop mode implementation been tested against gdbserver? On Jun 1, 2015 11:01 AM, "Greg Clayton" wrote: > My main concern with any threading is pairing the correct response to a > the person that sent the packet. Are async packets marked so they > absolutely can't be confused with any other response packets? I really > don't like the fact that there are no sequence numbers in the sent/received > packets because this makes it hard to know when you get the right response > if a previous packet times out. I recently added "qEcho" to support making > sure we stay on track and would like to ensure that any of the code added > above won't let any packets receive the wrong reply packet. > > > REPOSITORY > rL LLVM > > http://reviews.llvm.org/D10085 > > EMAIL PREFERENCES > http://reviews.llvm.org/settings/panel/emailpreferences/ > > > ___ lldb-commits mailing list lldb-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] Added utility function to get correct signal number from remote platform.
Whoops. On Mon, Jun 1, 2015 at 6:27 PM, Oleksiy Vyalov wrote: > > Comment at: test/lldbutil.py:956 > @@ +955,3 @@ > +continue > +process = lldb.SBProcess() > +if not process.IsValid(): > > target.GetProcess() ? > > http://reviews.llvm.org/D10171 > > EMAIL PREFERENCES > http://reviews.llvm.org/settings/panel/emailpreferences/ > > > ___ lldb-commits mailing list lldb-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r238794 - Fix a race condition where 2 threads might try to call Process::SetExitStatus() at the same time.
Author: gclayton Date: Mon Jun 1 18:14:09 2015 New Revision: 238794 URL: http://llvm.org/viewvc/llvm-project?rev=238794&view=rev Log: Fix a race condition where 2 threads might try to call Process::SetExitStatus() at the same time. The problem was the mutex was only protecting the setting of m_exit_string and m_exit_string, but this function relies on the m_private_state being set to eStateExited in order to prevent more than 1 client setting the exit status. We want to only allow the first caller to succeed. On MacOSX we have a thread that reaps the process we are debugging, and we also have a thread that monitors the debugserver process. When a process exists, the ProcessGDBRemote::AsyncThread() would set the exit status to the correct value and then another thread would reap the debugserver process and they would often both end up in Process::SetExitStatus() at the same time. With the mutex at the top we allow all variables to be set and the m_private_state to be set to eStateExited _before_ the other thread (debugserver reaped) can try to set th exist status to -1 and "lost connection to debugserver" being set as the exit status. This was probably an issue for lldb-server as well and could very well cleanup some tests that might have been expecting a specific exit status from the process being debugged. Modified: lldb/trunk/source/Target/Process.cpp Modified: lldb/trunk/source/Target/Process.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Process.cpp?rev=238794&r1=238793&r2=238794&view=diff == --- lldb/trunk/source/Target/Process.cpp (original) +++ lldb/trunk/source/Target/Process.cpp Mon Jun 1 18:14:09 2015 @@ -1429,6 +1429,9 @@ Process::GetExitDescription () bool Process::SetExitStatus (int status, const char *cstr) { +// Use a mutex to protect setting the exit status. +Mutex::Locker locker (m_exit_status_mutex); + Log *log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_STATE | LIBLLDB_LOG_PROCESS)); if (log) log->Printf("Process::SetExitStatus (status=%i (0x%8.8x), description=%s%s%s)", @@ -1444,17 +1447,12 @@ Process::SetExitStatus (int status, cons log->Printf("Process::SetExitStatus () ignoring exit status because state was already set to eStateExited"); return false; } - -// use a mutex to protect the status and string during updating -{ -Mutex::Locker locker (m_exit_status_mutex); -m_exit_status = status; -if (cstr) -m_exit_string = cstr; -else -m_exit_string.clear(); -} +m_exit_status = status; +if (cstr) +m_exit_string = cstr; +else +m_exit_string.clear(); // When we exit, we no longer need to the communication channel m_stdio_communication.StopReadThread(); ___ lldb-commits mailing list lldb-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r238771 - Dump error if dotest itself fails and no tests were run.
Author: chaoren Date: Mon Jun 1 14:06:01 2015 New Revision: 238771 URL: http://llvm.org/viewvc/llvm-project?rev=238771&view=rev Log: Dump error if dotest itself fails and no tests were run. Reviewers: zturner, clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D10163 Modified: lldb/trunk/test/dosep.py Modified: lldb/trunk/test/dosep.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/dosep.py?rev=238771&r1=238770&r2=238771&view=diff == --- lldb/trunk/test/dosep.py (original) +++ lldb/trunk/test/dosep.py Mon Jun 1 14:06:01 2015 @@ -125,7 +125,7 @@ def call_with_timeout(command, timeout, output = process.communicate() exit_status = process.returncode passes, failures = parse_test_results(output) -update_status(name, output if failures > 0 else None) +update_status(name, output if exit_status != 0 else None) return exit_status, passes, failures def process_dir(root, files, test_root, dotest_argv): @@ -388,8 +388,10 @@ Run lldb test suite using a separate pro touch(os.path.join(session_dir, "{}-{}".format(result, test_name))) print -print "Ran %d test suites (%d failed) (%f%%)" % (num_test_files, len(failed), 100.0*len(failed)/num_test_files) -print "Ran %d test cases (%d failed) (%f%%)" % (num_tests, all_fails, 100.0*all_fails/num_tests) +print "Ran %d test suites (%d failed) (%f%%)" % (num_test_files, len(failed), +(100.0 * len(failed) / num_test_files) if num_test_files > 0 else float('NaN')) +print "Ran %d test cases (%d failed) (%f%%)" % (num_tests, all_fails, +(100.0 * all_fails / num_tests) if num_tests > 0 else float('NaN')) if len(failed) > 0: failed.sort() print "Failing Tests (%d)" % len(failed) ___ lldb-commits mailing list lldb-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r238768 - Additional RenderScript debug features.
Author: domipheus Date: Mon Jun 1 13:23:41 2015 New Revision: 238768 URL: http://llvm.org/viewvc/llvm-project?rev=238768&view=rev Log: Additional RenderScript debug features. Base framework for inspecting RenderScript runtime details and helpers for various runtime actions on x86 and arm targets. Differential Revision: http://reviews.llvm.org/D10151 Modified: lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.h Modified: lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp?rev=238768&r1=238767&r2=238768&view=diff == --- lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp (original) +++ lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp Mon Jun 1 13:23:41 2015 @@ -15,6 +15,7 @@ #include "lldb/Core/Log.h" #include "lldb/Core/PluginManager.h" #include "lldb/Symbol/Symbol.h" +#include "lldb/Symbol/Type.h" #include "lldb/Target/Process.h" #include "lldb/Target/Target.h" #include "lldb/Interpreter/Args.h" @@ -22,6 +23,10 @@ #include "lldb/Interpreter/CommandInterpreter.h" #include "lldb/Interpreter/CommandReturnObject.h" #include "lldb/Interpreter/CommandObjectMultiword.h" +#include "lldb/Breakpoint/StoppointCallbackContext.h" +#include "lldb/Target/RegisterContext.h" + +#include "lldb/Symbol/VariableList.h" using namespace lldb; using namespace lldb_private; @@ -42,7 +47,7 @@ RenderScriptRuntime::CreateInstance(Proc void RenderScriptRuntime::Initialize() { -PluginManager::RegisterPlugin(GetPluginNameStatic(), "RenderScript language support", CreateInstance); +PluginManager::RegisterPlugin(GetPluginNameStatic(), "RenderScript language support", CreateInstance, GetCommandObject); } void @@ -69,6 +74,26 @@ RenderScriptRuntime::GetModuleKind(const { return eModuleKindKernelObj; } + +// Is this the main RS runtime library +const ConstString rs_lib("libRS.so"); +if (module_sp->GetFileSpec().GetFilename() == rs_lib) +{ +return eModuleKindLibRS; +} + +const ConstString rs_driverlib("libRSDriver.so"); +if (module_sp->GetFileSpec().GetFilename() == rs_driverlib) +{ +return eModuleKindDriver; +} + +const ConstString rs_cpureflib("libRSCPURef.so"); +if (module_sp->GetFileSpec().GetFilename() == rs_cpureflib) +{ +return eModuleKindImpl; +} + } return eModuleKindIgnored; } @@ -138,14 +163,339 @@ RenderScriptRuntime::CreateExceptionReso return resolver_sp; } + +const RenderScriptRuntime::HookDefn RenderScriptRuntime::s_runtimeHookDefns[] = +{ +//rsdScript +{"rsdScriptInit", "_Z13rsdScriptInitPKN7android12renderscript7ContextEPNS0_7ScriptCEPKcS7_PKhjj", 0, RenderScriptRuntime::eModuleKindDriver, &lldb_private::RenderScriptRuntime::CaptureScriptInit1}, +{"rsdScriptInvokeForEach", "_Z22rsdScriptInvokeForEachPKN7android12renderscript7ContextEPNS0_6ScriptEjPKNS0_10AllocationEPS6_PKvjPK12RsScriptCall", 0, RenderScriptRuntime::eModuleKindDriver, nullptr}, +{"rsdScriptInvokeForEachMulti", "_Z27rsdScriptInvokeForEachMultiPKN7android12renderscript7ContextEPNS0_6ScriptEjPPKNS0_10AllocationEjPS6_PKvjPK12RsScriptCall", 0, RenderScriptRuntime::eModuleKindDriver, nullptr}, +{"rsdScriptInvokeFunction", "_Z23rsdScriptInvokeFunctionPKN7android12renderscript7ContextEPNS0_6ScriptEjPKvj", 0, RenderScriptRuntime::eModuleKindDriver, nullptr}, +{"rsdScriptSetGlobalVar", "_Z21rsdScriptSetGlobalVarPKN7android12renderscript7ContextEPKNS0_6ScriptEjPvj", 0, RenderScriptRuntime::eModuleKindDriver, &lldb_private::RenderScriptRuntime::CaptureSetGlobalVar1}, + +//rsdAllocation +{"rsdAllocationInit", "_Z17rsdAllocationInitPKN7android12renderscript7ContextEPNS0_10AllocationEb", 0, RenderScriptRuntime::eModuleKindDriver, &lldb_private::RenderScriptRuntime::CaptureAllocationInit1}, +{"rsdAllocationRead2D", "_Z19rsdAllocationRead2DPKN7android12renderscript7ContextEPKNS0_10AllocationEjjj23RsAllocationCubemapFacejjPvjj", 0, RenderScriptRuntime::eModuleKindDriver, nullptr}, +}; +const size_t RenderScriptRuntime::s_runtimeHookCount = sizeof(s_runtimeHookDefns)/sizeof(s_runtimeHookDefns[0]); + + +bool +RenderScriptRuntime::HookCallback(void *baton, StoppointCallbackContext *ctx, lldb::user_id_t break_id, lldb::user_id_t break_loc_id) +{ +RuntimeHook* hook_info = (RuntimeHook*)baton; +ExecutionContext context(ctx->exe_ctx_ref); + +RenderScriptRuntime *lang_rt = (RenderScript
[Lldb-commits] [lldb] r238765 - Updated dosep.py to output progress and dump std{out, err} on test failure.
Author: chaoren Date: Mon Jun 1 12:49:25 2015 New Revision: 238765 URL: http://llvm.org/viewvc/llvm-project?rev=238765&view=rev Log: Updated dosep.py to output progress and dump std{out,err} on test failure. Reviewers: vharron, clayborg, zturner Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D10143 Modified: lldb/trunk/test/dosep.py Modified: lldb/trunk/test/dosep.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/dosep.py?rev=238765&r1=238764&r2=238765&view=diff == --- lldb/trunk/test/dosep.py (original) +++ lldb/trunk/test/dosep.py Mon Jun 1 12:49:25 2015 @@ -66,6 +66,28 @@ default_timeout = os.getenv("LLDB_TEST_T # Status codes for running command with timeout. eTimedOut, ePassed, eFailed = 124, 0, 1 +output_lock = None +test_counter = None +total_tests = None + +def setup_lock_and_counter(lock, counter, total): +global output_lock, test_counter, total_tests +output_lock = lock +test_counter = counter +total_tests = total + +def update_status(name = None, output = None): +global output_lock, test_counter, total_tests +with output_lock: +if output is not None: +print >> sys.stderr +print >> sys.stderr, 'Test suite %s failed' % name +print >> sys.stderr, 'stdout:\n' + output[0] +print >> sys.stderr, 'stderr:\n' + output[1] +sys.stderr.write("\r%*d out of %d test suites processed" % +(len(str(total_tests)), test_counter.value, total_tests)) +test_counter.value += 1 + def parse_test_results(output): passes = 0 failures = 0 @@ -84,7 +106,7 @@ def parse_test_results(output): pass return passes, failures -def call_with_timeout(command, timeout): +def call_with_timeout(command, timeout, name): """Run command with a timeout if possible.""" """-s QUIT will create a coredump if they are enabled on your system""" process = None @@ -103,6 +125,7 @@ def call_with_timeout(command, timeout): output = process.communicate() exit_status = process.returncode passes, failures = parse_test_results(output) +update_status(name, output if failures > 0 else None) return exit_status, passes, failures def process_dir(root, files, test_root, dotest_argv): @@ -132,7 +155,7 @@ def process_dir(root, files, test_root, timeout = os.getenv("LLDB_%s_TIMEOUT" % timeout_name) or default_timeout -exit_status, pass_count, fail_count = call_with_timeout(command, timeout) +exit_status, pass_count, fail_count = call_with_timeout(command, timeout, name) pass_sub_count = pass_sub_count + pass_count fail_sub_count = fail_sub_count + fail_count @@ -169,10 +192,19 @@ def walk_and_invoke(test_directory, test for root, dirs, files in os.walk(test_subdir, topdown=False): test_work_items.append((root, files, test_directory, dotest_argv)) +global output_lock, test_counter, total_tests +output_lock = multiprocessing.Lock() +total_tests = len(test_work_items) +test_counter = multiprocessing.Value('i', 0) +print >> sys.stderr, "Testing: %d tests, %d threads" % (total_tests, num_threads) +update_status() + # Run the items, either in a pool (for multicore speedup) or # calling each individually. if num_threads > 1: -pool = multiprocessing.Pool(num_threads) +pool = multiprocessing.Pool(num_threads, +initializer = setup_lock_and_counter, +initargs = (output_lock, test_counter, total_tests)) test_results = pool.map(process_dir_worker, test_work_items) else: test_results = [] @@ -355,6 +387,7 @@ Run lldb test suite using a separate pro test_name = os.path.splitext(xtime)[0] touch(os.path.join(session_dir, "{}-{}".format(result, test_name))) +print print "Ran %d test suites (%d failed) (%f%%)" % (num_test_files, len(failed), 100.0*len(failed)/num_test_files) print "Ran %d test cases (%d failed) (%f%%)" % (num_tests, all_fails, 100.0*all_fails/num_tests) if len(failed) > 0: ___ lldb-commits mailing list lldb-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r238764 - Fix types.py to actually be able to run check_padding_command() without erroring out.
Author: gclayton Date: Mon Jun 1 12:28:45 2015 New Revision: 238764 URL: http://llvm.org/viewvc/llvm-project?rev=238764&view=rev Log: Fix types.py to actually be able to run check_padding_command() without erroring out. Modified: lldb/trunk/examples/python/types.py Modified: lldb/trunk/examples/python/types.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/examples/python/types.py?rev=238764&r1=238763&r2=238764&view=diff == --- lldb/trunk/examples/python/types.py (original) +++ lldb/trunk/examples/python/types.py Mon Jun 1 12:28:45 2015 @@ -177,7 +177,7 @@ def check_padding_command (debugger, com # (courtesy of OptParse dealing with argument errors by throwing SystemExit) result.SetStatus (lldb.eReturnStatusFailed) return "option parsing failed" # returning a string is the same as returning an error whose description is the string -verify_types(options, debugger.GetSelectedTarget(), command_args) +verify_types(debugger.GetSelectedTarget(), options) @lldb.command("parse_all_struct_class_types") def parse_all_struct_class_types (debugger, command, result, dict): ___ lldb-commits mailing list lldb-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r238761 - Initialize 3 variables which were being used un-initialized.
Author: abidh Date: Mon Jun 1 12:08:30 2015 New Revision: 238761 URL: http://llvm.org/viewvc/llvm-project?rev=238761&view=rev Log: Initialize 3 variables which were being used un-initialized. No regression on testsuite. Comitted as obvious. Modified: lldb/trunk/source/Core/Scalar.cpp Modified: lldb/trunk/source/Core/Scalar.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Scalar.cpp?rev=238761&r1=238760&r2=238761&view=diff == --- lldb/trunk/source/Core/Scalar.cpp (original) +++ lldb/trunk/source/Core/Scalar.cpp Mon Jun 1 12:08:30 2015 @@ -1900,7 +1900,7 @@ Scalar::SetValueFromData (DataExtractor break; case lldb::eEncodingUint: { -lldb::offset_t offset; +lldb::offset_t offset = 0; switch (byte_size) { @@ -1916,7 +1916,7 @@ Scalar::SetValueFromData (DataExtractor break; case lldb::eEncodingSint: { -lldb::offset_t offset; +lldb::offset_t offset = 0; switch (byte_size) { @@ -1932,7 +1932,7 @@ Scalar::SetValueFromData (DataExtractor break; case lldb::eEncodingIEEE754: { -lldb::offset_t offset; +lldb::offset_t offset = 0; if (byte_size == sizeof (float)) operator=((float)data.GetFloat(&offset)); ___ lldb-commits mailing list lldb-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] Updated dosep.py to output progress and dump std{out, err} on test failure.
Looks ok, did you get a chance to run on Windows to verify that it still works? On Sun, May 31, 2015 at 9:30 PM Chaoren Lin wrote: > - Accidentally printed stdout again instead of stderr. > - Passing lock and counter by argument to work on Windows. > > > http://reviews.llvm.org/D10143 > > Files: > test/dosep.py > > Index: test/dosep.py > === > --- test/dosep.py > +++ test/dosep.py > @@ -66,6 +66,28 @@ > # Status codes for running command with timeout. > eTimedOut, ePassed, eFailed = 124, 0, 1 > > +output_lock = None > +test_counter = None > +total_tests = None > + > +def setup_lock_and_counter(lock, counter, total): > +global output_lock, test_counter, total_tests > +output_lock = lock > +test_counter = counter > +total_tests = total > + > +def update_status(name = None, output = None): > +global output_lock, test_counter, total_tests > +with output_lock: > +if output is not None: > +print >> sys.stderr > +print >> sys.stderr, 'Test suite %s failed' % name > +print >> sys.stderr, 'stdout:\n' + output[0] > +print >> sys.stderr, 'stderr:\n' + output[1] > +sys.stderr.write("\r%*d out of %d test suites processed" % > +(len(str(total_tests)), test_counter.value, total_tests)) > +test_counter.value += 1 > + > def parse_test_results(output): > passes = 0 > failures = 0 > @@ -84,7 +106,7 @@ > pass > return passes, failures > > -def call_with_timeout(command, timeout): > +def call_with_timeout(command, timeout, name): > """Run command with a timeout if possible.""" > """-s QUIT will create a coredump if they are enabled on your > system""" > process = None > @@ -103,6 +125,7 @@ > output = process.communicate() > exit_status = process.returncode > passes, failures = parse_test_results(output) > +update_status(name, output if failures > 0 else None) > return exit_status, passes, failures > > def process_dir(root, files, test_root, dotest_argv): > @@ -132,7 +155,7 @@ > > timeout = os.getenv("LLDB_%s_TIMEOUT" % timeout_name) or > default_timeout > > -exit_status, pass_count, fail_count = call_with_timeout(command, > timeout) > +exit_status, pass_count, fail_count = call_with_timeout(command, > timeout, name) > > pass_sub_count = pass_sub_count + pass_count > fail_sub_count = fail_sub_count + fail_count > @@ -169,10 +192,19 @@ > for root, dirs, files in os.walk(test_subdir, topdown=False): > test_work_items.append((root, files, test_directory, dotest_argv)) > > +global output_lock, test_counter, total_tests > +output_lock = multiprocessing.Lock() > +total_tests = len(test_work_items) > +test_counter = multiprocessing.Value('i', 0) > +print >> sys.stderr, "Testing: %d tests, %d threads" % (total_tests, > num_threads) > +update_status() > + > # Run the items, either in a pool (for multicore speedup) or > # calling each individually. > if num_threads > 1: > -pool = multiprocessing.Pool(num_threads) > +pool = multiprocessing.Pool(num_threads, > +initializer = setup_lock_and_counter, > +initargs = (output_lock, test_counter, total_tests)) > test_results = pool.map(process_dir_worker, test_work_items) > else: > test_results = [] > @@ -355,6 +387,7 @@ > test_name = os.path.splitext(xtime)[0] > touch(os.path.join(session_dir, "{}-{}".format(result, > test_name))) > > +print > print "Ran %d test suites (%d failed) (%f%%)" % (num_test_files, > len(failed), 100.0*len(failed)/num_test_files) > print "Ran %d test cases (%d failed) (%f%%)" % (num_tests, all_fails, > 100.0*all_fails/num_tests) > if len(failed) > 0: > > EMAIL PREFERENCES > http://reviews.llvm.org/settings/panel/emailpreferences/ > ___ lldb-commits mailing list lldb-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [lldb] r238752 - Refactor many file functions to use FileSpec over strings.
On 1 June 2015 at 11:24, Ed Maste wrote: > > Author: emaste > Date: Mon Jun 1 10:24:37 2015 > New Revision: 238752 > > URL: http://llvm.org/viewvc/llvm-project?rev=238752&view=rev > Log: > Refactor many file functions to use FileSpec over strings. > > This is the FreeBSD change for r238604. For better or worse FreeBSD/ProcessMonitor.cpp and Linux/ProcessMonitor.cpp have a large amount of identical code, and many changes to one apply directly to the other -- as is the case here. Longer term this will become less of an issue, as (a) Linux/ProcessMonitor.cpp will be deprecated and (b) FreeBSD will migrate to a Native{Process,Thread}FreeBSD implementation similar to Native{Process,Thread}Linux. In the interim I'd appreciate it if straightforward changes to Linux/ProcessMonitor.cpp can be applied to FreeBSD/ProcessMonitor.cpp as well though. I'd rather have an untested change committed to the FreeBSD ProcessMonitor implementation than to have the build left broken until I'm able to look at it. ___ lldb-commits mailing list lldb-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r238752 - Refactor many file functions to use FileSpec over strings.
Author: emaste Date: Mon Jun 1 10:24:37 2015 New Revision: 238752 URL: http://llvm.org/viewvc/llvm-project?rev=238752&view=rev Log: Refactor many file functions to use FileSpec over strings. This is the FreeBSD change for r238604. Modified: lldb/trunk/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp lldb/trunk/source/Plugins/Process/FreeBSD/ProcessMonitor.h Modified: lldb/trunk/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp?rev=238752&r1=238751&r2=238752&view=diff == --- lldb/trunk/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp (original) +++ lldb/trunk/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp Mon Jun 1 10:24:37 2015 @@ -771,17 +771,17 @@ ProcessMonitor::LaunchArgs::LaunchArgs(P lldb_private::Module *module, char const **argv, char const **envp, - const char *stdin_path, - const char *stdout_path, - const char *stderr_path, - const char *working_dir) + const FileSpec &stdin_file_spec, + const FileSpec &stdout_file_spec, + const FileSpec &stderr_file_spec, + const FileSpec &working_dir) : OperationArgs(monitor), m_module(module), m_argv(argv), m_envp(envp), - m_stdin_path(stdin_path), - m_stdout_path(stdout_path), - m_stderr_path(stderr_path), + m_stdin_file_spec(stdin_file_spec), + m_stdout_file_spec(stdout_file_spec), + m_stderr_file_spec(stderr_file_spec), m_working_dir(working_dir) { } ProcessMonitor::LaunchArgs::~LaunchArgs() @@ -810,10 +810,10 @@ ProcessMonitor::ProcessMonitor(ProcessPO Module *module, const char *argv[], const char *envp[], - const char *stdin_path, - const char *stdout_path, - const char *stderr_path, - const char *working_dir, + const FileSpec &stdin_file_spec, + const FileSpec &stdout_file_spec, + const FileSpec &stderr_file_spec, + const FileSpec &working_dir, const lldb_private::ProcessLaunchInfo & /* launch_info */, lldb_private::Error &error) : m_process(static_cast(process)), @@ -822,8 +822,10 @@ ProcessMonitor::ProcessMonitor(ProcessPO m_operation(0) { std::unique_ptr args(new LaunchArgs(this, module, argv, envp, - stdin_path, stdout_path, stderr_path, - working_dir)); +stdin_file_spec, +stdout_file_spec, +stderr_file_spec, +working_dir)); sem_init(&m_operation_pending, 0, 0); @@ -954,10 +956,10 @@ ProcessMonitor::Launch(LaunchArgs *args) ProcessFreeBSD &process = monitor->GetProcess(); const char **argv = args->m_argv; const char **envp = args->m_envp; -const char *stdin_path = args->m_stdin_path; -const char *stdout_path = args->m_stdout_path; -const char *stderr_path = args->m_stderr_path; -const char *working_dir = args->m_working_dir; +const FileSpec &stdin_file_spec = args->m_stdin_file_spec; +const FileSpec &stdout_file_spec = args->m_stdout_file_spec; +const FileSpec &stderr_file_spec = args->m_stderr_file_spec; +const FileSpec &working_dir = args->m_working_dir; lldb_utility::PseudoTerminal terminal; const size_t err_len = 1024; @@ -1009,22 +1011,21 @@ ProcessMonitor::Launch(LaunchArgs *args) // // FIXME: If two or more of the paths are the same we needlessly open // the same file multiple times. -if (stdin_path != NULL && stdin_path[0]) -if (!DupDescriptor(stdin_path, STDIN_FILENO, O_RDONLY)) +if (stdin_file_spec) +if (!DupDescriptor(stdin_file_spec, STDIN_FILENO, O_RDONLY)) exit(eDupStdinFailed); -if (stdout_path != NULL && stdout_path[0]) -if (!DupDescriptor(stdout_path, STDOUT_FILENO, O_WRONLY | O_CREAT)) +if (stdout_file_spec) +if (!DupDescriptor(stdout_file_spec, STDOUT_FILENO, O_WRONLY | O_CR