Re: [Lldb-commits] [PATCH] D11519: [MIPS] Use qfThreadID if qC packet is not supported by target

2015-08-10 Thread Jaydeep Patil via lldb-commits
jaydeep added inline comments.


Comment at: 
source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp:1463-1465
@@ +1462,5 @@
+
+// If we don't get a response for $qC, check if $qfThreadID gives us a 
result.
+if (m_curr_pid == LLDB_INVALID_PROCESS_ID && ostype == 
llvm::Triple::UnknownOS)
+{
+std::vector thread_ids;

clayborg wrote:
> How does checking the "ostype" with unknown help us to determine if this is 
> an OS where pid == tid? What if the user makes their target with:
> 
> ```
> (lldb) target create --arch x86_64-pc-linux ...
> ```
> 
> Then this code doesn't trigger?
In this case the target we are connected to is a bare-iron which does not 
support qC packet. Here pid == tid and only way to get this is using 
qfThreadID. If arch is likely to be unset during many of these calls then we 
need to find alternate way to implement this.




Repository:
  rL LLVM

http://reviews.llvm.org/D11519



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D11930: [MIPS]Handle floating point and aggregate return types in SysV-mips [32 bit] ABI

2015-08-10 Thread Bhushan Attarde via lldb-commits
bhushan created this revision.
bhushan added a reviewer: clayborg.
bhushan added subscribers: lldb-commits, jaydeep, sagar, nitesh.jain, 
mohit.bhakkad.
bhushan set the repository for this revision to rL LLVM.

This patch adds support of floating point and aggregate return types in 
GetReturnValueObjectImpl() for mips32

Repository:
  rL LLVM

http://reviews.llvm.org/D11930

Files:
  source/Plugins/ABI/SysV-mips/ABISysV_mips.cpp

Index: source/Plugins/ABI/SysV-mips/ABISysV_mips.cpp
===
--- source/Plugins/ABI/SysV-mips/ABISysV_mips.cpp
+++ source/Plugins/ABI/SysV-mips/ABISysV_mips.cpp
@@ -424,14 +424,15 @@
 return return_valobj_sp;
 
 bool is_signed;
+bool is_complex;
+uint32_t count;
 
 // In MIPS register "r2" (v0) holds the integer function return values
 const RegisterInfo *r2_reg_info = reg_ctx->GetRegisterInfoByName("r2", 0);
+size_t bit_width = return_clang_type.GetBitSize(&thread);
 
 if (return_clang_type.IsIntegerType (is_signed))
 {
-size_t bit_width = return_clang_type.GetBitSize(&thread);
-
 switch (bit_width)
 {
 default:
@@ -473,6 +474,52 @@
 uint32_t ptr = 
thread.GetRegisterContext()->ReadRegisterAsUnsigned(r2_reg_info, 0) & 
UINT32_MAX;
 value.GetScalar() = ptr;
 }
+else if (return_clang_type.IsAggregateType ())
+{
+// Structure/Vector is always passed in memory and pointer to that 
memory is passed in r2. 
+uint64_t mem_address = 
reg_ctx->ReadRegisterAsUnsigned(reg_ctx->GetRegisterInfoByName("r2", 0), 0);
+// We have got the address. Create a memory object out of it
+return_valobj_sp = ValueObjectMemory::Create (&thread,
+  "",
+  Address (mem_address, 
NULL),
+  return_clang_type);
+return return_valobj_sp;
+}
+else if (return_clang_type.IsFloatingPointType (count, is_complex))
+{
+const RegisterInfo *f0_info = reg_ctx->GetRegisterInfoByName("f0", 0);
+const RegisterInfo *f1_info = reg_ctx->GetRegisterInfoByName("f1", 0);
+
+if (count == 1 && !is_complex)
+{
+switch (bit_width)
+{
+default:
+return return_valobj_sp;
+case 64:
+{
+static_assert(sizeof(double) == sizeof(uint64_t), "");
+uint64_t raw_value;
+raw_value = reg_ctx->ReadRegisterAsUnsigned(f0_info, 0) & 
UINT32_MAX;
+raw_value |= 
((uint64_t)(reg_ctx->ReadRegisterAsUnsigned(f1_info, 0) & UINT32_MAX)) << 32;
+value.GetScalar() = *reinterpret_cast(&raw_value);
+break;
+}
+case 32:
+{
+static_assert(sizeof(float) == sizeof(uint32_t), "");
+uint32_t raw_value = 
reg_ctx->ReadRegisterAsUnsigned(f0_info, 0) & UINT32_MAX;
+value.GetScalar() = *reinterpret_cast(&raw_value);
+break;
+}
+}
+}
+else
+{
+// not handled yet
+return return_valobj_sp;
+}
+}
 else
 {
 // not handled yet


Index: source/Plugins/ABI/SysV-mips/ABISysV_mips.cpp
===
--- source/Plugins/ABI/SysV-mips/ABISysV_mips.cpp
+++ source/Plugins/ABI/SysV-mips/ABISysV_mips.cpp
@@ -424,14 +424,15 @@
 return return_valobj_sp;
 
 bool is_signed;
+bool is_complex;
+uint32_t count;
 
 // In MIPS register "r2" (v0) holds the integer function return values
 const RegisterInfo *r2_reg_info = reg_ctx->GetRegisterInfoByName("r2", 0);
+size_t bit_width = return_clang_type.GetBitSize(&thread);
 
 if (return_clang_type.IsIntegerType (is_signed))
 {
-size_t bit_width = return_clang_type.GetBitSize(&thread);
-
 switch (bit_width)
 {
 default:
@@ -473,6 +474,52 @@
 uint32_t ptr = thread.GetRegisterContext()->ReadRegisterAsUnsigned(r2_reg_info, 0) & UINT32_MAX;
 value.GetScalar() = ptr;
 }
+else if (return_clang_type.IsAggregateType ())
+{
+// Structure/Vector is always passed in memory and pointer to that memory is passed in r2. 
+uint64_t mem_address = reg_ctx->ReadRegisterAsUnsigned(reg_ctx->GetRegisterInfoByName("r2", 0), 0);
+// We have got the address. Create a memory object out of it
+return_valobj_sp = ValueObjectMemory::Create (&thread,
+  "",
+  Address (mem_address, NULL),
+ 

Re: [Lldb-commits] [PATCH] D11574: Add size field to library load event

2015-08-10 Thread Ilia K via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL244573: Add size field to library load event (MI) (authored 
by ki.stfu).

Changed prior to commit:
  http://reviews.llvm.org/D11574?vs=31038&id=31772#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D11574

Files:
  lldb/trunk/test/tools/lldb-mi/TestMiLibraryLoaded.py
  lldb/trunk/tools/lldb-mi/MICmnLLDBDebuggerHandleEvents.cpp
  lldb/trunk/tools/lldb-mi/MIExtensions.txt

Index: lldb/trunk/tools/lldb-mi/MIExtensions.txt
===
--- lldb/trunk/tools/lldb-mi/MIExtensions.txt
+++ lldb/trunk/tools/lldb-mi/MIExtensions.txt
@@ -83,14 +83,15 @@
 
 # =library-loaded notification
 
-The =library-loaded notification has 3 extra fields:
+The =library-loaded notification has 4 extra fields:
 symbols-loaded - indicates that there are symbols for the loaded library
 symbols-path   - if symbols are exist then it contains a path for symbols 
of the loaded library
 loaded_addr- contains an address of the loaded library or "-" if 
address isn't resolved yet
+size   - contains the size in bytes of the section loaded at 
'loaded_addr'
 
 For example:
-
=library-loaded,id="/Users/IliaK/p/hello",target-name="/Users/IliaK/p/hello",host-name="/Users/IliaK/p/hello",symbols-loaded="1",symbols-path="/Users/IliaK/p/hello.dSYM/Contents/Resources/DWARF/hello",loaded_addr="-"
-
=library-loaded,id="/usr/lib/dyld",target-name="/usr/lib/dyld",host-name="/usr/lib/dyld",symbols-loaded="0",loaded_addr="0x7fff5fc0"
+
=library-loaded,id="/Users/IliaK/p/hello",target-name="/Users/IliaK/p/hello",host-name="/Users/IliaK/p/hello",symbols-loaded="1",symbols-path="/Users/IliaK/p/hello.dSYM/Contents/Resources/DWARF/hello",loaded_addr="-",size="4096"
+
=library-loaded,id="/usr/lib/dyld",target-name="/usr/lib/dyld",host-name="/usr/lib/dyld",symbols-loaded="0",loaded_addr="0x7fff5fc0",size="4096"
 
 # -target-attach
 
Index: lldb/trunk/tools/lldb-mi/MICmnLLDBDebuggerHandleEvents.cpp
===
--- lldb/trunk/tools/lldb-mi/MICmnLLDBDebuggerHandleEvents.cpp
+++ lldb/trunk/tools/lldb-mi/MICmnLLDBDebuggerHandleEvents.cpp
@@ -688,17 +688,17 @@
 std::unique_ptr apPath(new char[PATH_MAX]);
 vModule.GetFileSpec().GetPath(apPath.get(), PATH_MAX);
 const CMIUtilString strTargetPath(apPath.get());
-const CMICmnMIValueConst miValueConst(strTargetPath);
+const CMICmnMIValueConst miValueConst(strTargetPath.AddSlashes());
 const CMICmnMIValueResult miValueResult("id", miValueConst);
 vwrMiOutOfBandRecord.Add(miValueResult);
 // Build "target-name" field
-const CMICmnMIValueConst miValueConst2(strTargetPath);
+const CMICmnMIValueConst miValueConst2(strTargetPath.AddSlashes());
 const CMICmnMIValueResult miValueResult2("target-name", miValueConst2);
 vwrMiOutOfBandRecord.Add(miValueResult2);
 // Build "host-name" field
 vModule.GetPlatformFileSpec().GetPath(apPath.get(), PATH_MAX);
 const CMIUtilString strHostPath(apPath.get());
-const CMICmnMIValueConst miValueConst3(strHostPath);
+const CMICmnMIValueConst miValueConst3(strHostPath.AddSlashes());
 const CMICmnMIValueResult miValueResult3("host-name", miValueConst3);
 vwrMiOutOfBandRecord.Add(miValueResult3);
 
@@ -715,19 +715,26 @@
 // Build "symbols-path" field
 if (bSymbolsLoaded)
 {
-const CMICmnMIValueConst miValueConst5(strSymbolsPath);
+const CMICmnMIValueConst 
miValueConst5(strSymbolsPath.AddSlashes());
 const CMICmnMIValueResult miValueResult5("symbols-path", 
miValueConst5);
 vwrMiOutOfBandRecord.Add(miValueResult5);
 }
 // Build "loaded_addr" field
-const lldb::SBAddress sbAddress(vModule.GetObjectFileHeaderAddress());
+lldb::SBAddress sbAddress(vModule.GetObjectFileHeaderAddress());
 CMICmnLLDBDebugSessionInfo 
&rSessionInfo(CMICmnLLDBDebugSessionInfo::Instance());
 const lldb::addr_t 
nLoadAddress(sbAddress.GetLoadAddress(rSessionInfo.GetTarget()));
 const CMIUtilString strLoadedAddr(nLoadAddress != LLDB_INVALID_ADDRESS 
?
   CMIUtilString::Format("0x%016" 
PRIx64, nLoadAddress) : "-");
 const CMICmnMIValueConst miValueConst6(strLoadedAddr);
 const CMICmnMIValueResult miValueResult6("loaded_addr", miValueConst6);
 vwrMiOutOfBandRecord.Add(miValueResult6);
+
+// Build "size" field
+lldb::SBSection sbSection = sbAddress.GetSection();
+const CMIUtilString strSize(CMIUtilString::Format("%" PRIu64, 
sbSection.GetByteSize()));
+const CMICmnMIValueConst miValueConst7(strSize);
+const CMICmnMIValueResult miValueResult7("size", miValueConst7);
+vwrMiOutOfBandRecord.Add(miValueResult7);
 }
 
 return bOk;
Index: lldb/trunk/

[Lldb-commits] [lldb] r244573 - Add size field to library load event (MI)

2015-08-10 Thread Ilia K via lldb-commits
Author: ki.stfu
Date: Tue Aug 11 01:07:14 2015
New Revision: 244573

URL: http://llvm.org/viewvc/llvm-project?rev=244573&view=rev
Log:
Add size field to library load event (MI)

Summary:
(This revision supersedes the abandon: http://reviews.llvm.org/D9716)
Size field is used to let the debugger attribute an address to a specific 
library when symbols are not available. 
For example:
OpenGLESApp4.app!Cube_draw() Line 74C
OpenGLESApp4.app!-[GameViewController 
glkView:drawInRect:](GameViewController * self, SEL _cmd, GLKView * view, 
CGRect rect) Line 89C++
GLKit!
QuartzCore!   
QuartzCore!   
QuartzCore!   
QuartzCore!   
QuartzCore!   
UIKit!
UIKit!
UIKit!
UIKit!
FrontBoardServices!   
CoreFoundation!   

Patch from paul...@microsoft.com

Reviewers: ChuckR, abidh, ki.stfu

Subscribers: greggm, lldb-commits

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


Modified:
lldb/trunk/test/tools/lldb-mi/TestMiLibraryLoaded.py
lldb/trunk/tools/lldb-mi/MICmnLLDBDebuggerHandleEvents.cpp
lldb/trunk/tools/lldb-mi/MIExtensions.txt

Modified: lldb/trunk/test/tools/lldb-mi/TestMiLibraryLoaded.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/tools/lldb-mi/TestMiLibraryLoaded.py?rev=244573&r1=244572&r2=244573&view=diff
==
--- lldb/trunk/test/tools/lldb-mi/TestMiLibraryLoaded.py (original)
+++ lldb/trunk/test/tools/lldb-mi/TestMiLibraryLoaded.py Tue Aug 11 01:07:14 
2015
@@ -26,10 +26,9 @@ class MiLibraryLoadedTestCase(lldbmi_tes
 import os
 path = os.path.join(os.getcwd(), self.myexe)
 symbols_path = os.path.join(path + ".dSYM", "Contents", "Resources", 
"DWARF", self.myexe)
-self.expect([
-
"=library-loaded,id=\"%s\",target-name=\"%s\",host-name=\"%s\",symbols-loaded=\"1\",symbols-path=\"%s\",loaded_addr=\"-\""
 % (path, path, path, symbols_path),
-
"=library-loaded,id=\"%s\",target-name=\"%s\",host-name=\"%s\",symbols-loaded=\"0\",loaded_addr=\"-\""
 % (path, path, path)
-], exactly = True)
+def add_slashes(x): return x.replace("\\", "").replace("\"", 
"\\\"").replace("\'", "\\\'").replace("\0", "\\\0")
+self.expect([ 
"=library-loaded,id=\"%s\",target-name=\"%s\",host-name=\"%s\",symbols-loaded=\"1\",symbols-path=\"%s\",loaded_addr=\"-\",size=\"[0-9]+\""
 % (add_slashes(path), add_slashes(path), add_slashes(path), 
add_slashes(symbols_path)),
+  
"=library-loaded,id=\"%s\",target-name=\"%s\",host-name=\"%s\",symbols-loaded=\"0\",loaded_addr=\"-\",size=\"[0-9]+\""
 % (add_slashes(path), add_slashes(path), add_slashes(path)) ])
 
 if __name__ == '__main__':
 unittest2.main()

Modified: lldb/trunk/tools/lldb-mi/MICmnLLDBDebuggerHandleEvents.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MICmnLLDBDebuggerHandleEvents.cpp?rev=244573&r1=244572&r2=244573&view=diff
==
--- lldb/trunk/tools/lldb-mi/MICmnLLDBDebuggerHandleEvents.cpp (original)
+++ lldb/trunk/tools/lldb-mi/MICmnLLDBDebuggerHandleEvents.cpp Tue Aug 11 
01:07:14 2015
@@ -688,17 +688,17 @@ CMICmnLLDBDebuggerHandleEvents::MiHelpGe
 std::unique_ptr apPath(new char[PATH_MAX]);
 vModule.GetFileSpec().GetPath(apPath.get(), PATH_MAX);
 const CMIUtilString strTargetPath(apPath.get());
-const CMICmnMIValueConst miValueConst(strTargetPath);
+const CMICmnMIValueConst miValueConst(strTargetPath.AddSlashes());
 const CMICmnMIValueResult miValueResult("id", miValueConst);
 vwrMiOutOfBandRecord.Add(miValueResult);
 // Build "target-name" field
-const CMICmnMIValueConst miValueConst2(strTargetPath);
+const CMICmnMIValueConst miValueConst2(strTargetPath.AddSlashes());
 const CMICmnMIValueResult miValueResult2("target-name", miValueConst2);
 vwrMiOutOfBandRecord.Add(miValueResult2);
 // Build "host-name" field
 vModule.GetPlatformFileSpec().GetPath(apPath.get(), PATH_MAX);
 const CMIUtilString strHostPath(apPath.get());
-const CMICmnMIValueConst miValueConst3(strHostPath);
+const CMICmnMIValueConst miValueConst3(strHostPath.AddSlashes());
 const CMICmnMIValueResult miValueResult3("host-name", miValueConst3);
 vwrMiOutOfBandRecord.Add(miValueResult3);
 
@@ -715,12 +715,12 @@ CMICmnLLDBDebuggerHandleEvents::MiHelpGe
 // Build "symbols-path" field
 if (bSymbolsLoaded)
 {
-const CMICmnMIValueConst miValueConst5(strSymbolsPath);
+const CMICmnMIValueConst 
miValueConst5(strSymbolsPath.AddSlashes());
 const CMICmnMIValueResult miValueResult5("symbols-path", 
miValueConst5);
 vwrMiOutOfBandRecord.Add(miValueResult5);
 }
 // Build "loaded_addr" field
- 

Re: [Lldb-commits] [PATCH] D11672: [MIPS] Handle false positives for MIPS hardware watchpoints

2015-08-10 Thread Jaydeep Patil via lldb-commits
jaydeep added a comment.

Could you please find some time to review this?
Thanks.


Repository:
  rL LLVM

http://reviews.llvm.org/D11672



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D11747: [MIPS] Support standard GDB remote stop reply packet for watchpoint

2015-08-10 Thread Jaydeep Patil via lldb-commits
jaydeep added a comment.

Could you please find some time to review this?
Thanks.


Repository:
  rL LLVM

http://reviews.llvm.org/D11747



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [lldb] r244514 - Revert r244308 since it's introducing test regressions on Linux:

2015-08-10 Thread Jason Molenda via lldb-commits
I wouldn't be surprised if most of this is similar to the problem I emailed 
yesterday ("TOT svn lldb crashes trying to print argc on TOT lldb, maybe 
fallout from r244308 - [LLDB][MIPS] Fix offsets of all register sets and add 
MSA regset and FRE=1 mode support") where lldb could hit an llvm APInt assert 
when trying to evaluate dwarf location expressions.

J

On Aug 10, 2015, at 2:49 PM, Oleksiy Vyalov via lldb-commits 
 wrote:

> Author: ovyalov
> Date: Mon Aug 10 16:49:50 2015
> New Revision: 244514
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=244514&view=rev
> Log:
> Revert r244308 since it's introducing test regressions on Linux:
> - TestLldbGdbServer.py both clang & gcc, i386 and x86_64
> - TestConstVariables.py gcc, i386 and x86_64
> - 112 failures clang, i386
> 
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D11574: Add size field to library load event

2015-08-10 Thread Ilia K via lldb-commits
ki.stfu added a comment.

In http://reviews.llvm.org/D11574#220627, @paulmaybee wrote:

> Can you please check in in for me. Thanks.


Ok, tomorrow.


http://reviews.llvm.org/D11574



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D11910: Refactor dosep to use list comprehension. NFC.

2015-08-10 Thread Chaoren Lin via lldb-commits
chaoren updated this revision to Diff 31708.
chaoren added a comment.

Accidentally removed timed_out tests from failed tests.


http://reviews.llvm.org/D11910

Files:
  test/dosep.py

Index: test/dosep.py
===
--- test/dosep.py
+++ test/dosep.py
@@ -153,15 +153,11 @@
 report_test_pass(name, output[1])
 else:
 report_test_failure(name, command, output[1])
-return exit_status, passes, failures
+return name, exit_status, passes, failures
 
 def process_dir(root, files, test_root, dotest_argv):
 """Examine a directory for tests, and invoke any found within it."""
-timed_out = []
-failed = []
-passed = []
-pass_sub_count = 0
-fail_sub_count = 0
+results = []
 for name in files:
 script_file = os.path.join(test_root, "dotest.py")
 command = ([sys.executable, script_file] +
@@ -172,27 +168,27 @@
 
 timeout = os.getenv("LLDB_%s_TIMEOUT" % timeout_name) or getDefaultTimeout(dotest_options.lldb_platform_name)
 
-exit_status, pass_count, fail_count = call_with_timeout(command, timeout, name)
+results.append(call_with_timeout(command, timeout, name))
 
-pass_sub_count = pass_sub_count + pass_count
-fail_sub_count = fail_sub_count + fail_count
+# result = (name, status, passes, failures)
+timed_out = [name for name, status, _, _ in results
+ if status == eTimedOut]
+passed = [name for name, status, _, _ in results
+  if status == ePassed]
+failed = [name for name, status, _, _ in results
+  if status != ePassed]
+pass_count = sum([result[2] for result in results])
+fail_count = sum([result[3] for result in results])
 
-if exit_status == ePassed:
-passed.append(name)
-else:
-if eTimedOut == exit_status:
-timed_out.append(name)
-failed.append(name)
-return (timed_out, failed, passed, fail_sub_count, pass_sub_count)
+return (timed_out, passed, failed, pass_count, fail_count)
 
 in_q = None
 out_q = None
 
 def process_dir_worker(arg_tuple):
 """Worker thread main loop when in multithreaded mode.
 Takes one directory specification at a time and works on it."""
-(root, files, test_root, dotest_argv) = arg_tuple
-return process_dir(root, files, test_root, dotest_argv)
+return process_dir(*arg_tuple)
 
 def walk_and_invoke(test_directory, test_subdir, dotest_argv, num_threads):
 """Look for matched files and invoke test driver on each one.
@@ -237,25 +233,16 @@
   dotest_options))
 test_results = pool.map(process_dir_worker, test_work_items)
 else:
-test_results = []
-for work_item in test_work_items:
-test_results.append(process_dir_worker(work_item))
-
-timed_out = []
-failed = []
-passed = []
-fail_sub_count = 0
-pass_sub_count = 0
-
-for test_result in test_results:
-(dir_timed_out, dir_failed, dir_passed, dir_fail_sub_count, dir_pass_sub_count) = test_result
-timed_out += dir_timed_out
-failed += dir_failed
-passed += dir_passed
-fail_sub_count = fail_sub_count + dir_fail_sub_count
-pass_sub_count = pass_sub_count + dir_pass_sub_count
-
-return (timed_out, failed, passed, fail_sub_count, pass_sub_count)
+test_results = map(process_dir_worker, test_work_items)
+
+# result = (timed_out, failed, passed, fail_count, pass_count)
+timed_out = sum([result[0] for result in test_results], [])
+passed = sum([result[1] for result in test_results], [])
+failed = sum([result[2] for result in test_results], [])
+pass_count = sum([result[3] for result in test_results])
+fail_count = sum([result[4] for result in test_results])
+
+return (timed_out, passed, failed, pass_count, fail_count)
 
 def getExpectedTimeouts(platform_name):
 # returns a set of test filenames that might timeout
@@ -414,11 +401,12 @@
 num_threads = 1
 
 system_info = " ".join(platform.uname())
-(timed_out, failed, passed, all_fails, all_passes) = walk_and_invoke(test_directory, test_subdir, dotest_argv, num_threads)
+(timed_out, passed, failed, pass_count, fail_count) = walk_and_invoke(
+test_directory, test_subdir, dotest_argv, num_threads)
 
 timed_out = set(timed_out)
-num_test_files = len(failed) + len(passed)
-num_tests = all_fails + all_passes
+num_test_files = len(passed) + len(failed)
+num_test_cases = pass_count + fail_count
 
 # move core files into session dir
 cores = find('core.*', test_subdir)
@@ -444,10 +432,16 @@
 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) if num_test_files > 0 else float('NaN'))
-pr

Re: [Lldb-commits] [PATCH] D11384: Improve check for ASAN callbacks

2015-08-10 Thread Stephane Sezer via lldb-commits
sas added a subscriber: sas.
sas accepted this revision.
sas added a reviewer: sas.
sas added a comment.
This revision is now accepted and ready to land.

Looks pretty good.


http://reviews.llvm.org/D11384



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D11843: Make dosep output status by overwriting the same line.

2015-08-10 Thread Chaoren Lin via lldb-commits
chaoren updated this revision to Diff 31703.
chaoren added a comment.

Rebase on top of http://reviews.llvm.org/rL244469.


http://reviews.llvm.org/D11843

Files:
  test/dosep.py

Index: test/dosep.py
===
--- test/dosep.py
+++ test/dosep.py
@@ -66,41 +66,47 @@
 output_lock = None
 test_counter = None
 total_tests = None
+test_name_len = None
 dotest_options = None
 output_on_success = False
 
-def setup_global_variables(lock, counter, total, options):
-global output_lock, test_counter, total_tests, dotest_options
+def setup_global_variables(lock, counter, total, name_len, options):
+global output_lock, test_counter, total_tests, test_name_len
+global dotest_options
 output_lock = lock
 test_counter = counter
 total_tests = total
+test_name_len = name_len
 dotest_options = options
 
 def report_test_failure(name, command, output):
 global output_lock
 with output_lock:
-print >> sys.stderr, "\n"
+print >> sys.stderr
 print >> sys.stderr, output
+print >> sys.stderr, "[%s FAILED]" % name
 print >> sys.stderr, "Command invoked: %s" % ' '.join(command)
-update_progress(name, "FAILED")
+update_progress(name)
 
 def report_test_pass(name, output):
 global output_lock, output_on_success
 with output_lock:
 if output_on_success:
-print >> sys.stderr, "\n"
+print >> sys.stderr
 print >> sys.stderr, output
-update_progress(name, "PASSED")
+print >> sys.stderr, "[%s PASSED]" % name
+update_progress(name)
 
-def update_progress(test_name, result):
-global output_lock, test_counter, total_tests
+def update_progress(test_name=""):
+global output_lock, test_counter, total_tests, test_name_len
 with output_lock:
-if test_name != None:
-sys.stderr.write("\n[%s %s] - %d out of %d test suites processed" %
-(result, test_name, test_counter.value, total_tests))
-else:
-sys.stderr.write("\n%d out of %d test suites processed" %
-(test_counter.value, total_tests))
+counter_len = len(str(total_tests))
+sys.stderr.write(
+"\r%*d out of %d test suites processed - %-*s" %
+(counter_len, test_counter.value, total_tests,
+ test_name_len.value, test_name))
+if len(test_name) > test_name_len.value:
+test_name_len.value = len(test_name)
 test_counter.value += 1
 sys.stdout.flush()
 sys.stderr.flush()
@@ -157,16 +163,6 @@
 pass_sub_count = 0
 fail_sub_count = 0
 for name in files:
-path = os.path.join(root, name)
-
-# We're only interested in the test file with the "Test*.py" naming pattern.
-if not name.startswith("Test") or not name.endswith(".py"):
-continue
-
-# Neither a symbolically linked file.
-if os.path.islink(path):
-continue
-
 script_file = os.path.join(test_root, "dotest.py")
 command = ([sys.executable, script_file] +
dotest_argv +
@@ -211,21 +207,34 @@
 # Collect the test files that we'll run.
 test_work_items = []
 for root, dirs, files in os.walk(test_subdir, topdown=False):
-test_work_items.append((root, files, test_directory, dotest_argv))
+def is_test(name):
+# Not interested in symbolically linked files.
+if os.path.islink(os.path.join(root, name)):
+return False
+# Only interested in test files with the "Test*.py" naming pattern.
+return name.startswith("Test") and name.endswith(".py")
+
+tests = filter(is_test, files)
+test_work_items.append((root, tests, test_directory, dotest_argv))
 
-global output_lock, test_counter, total_tests
+global output_lock, test_counter, total_tests, test_name_len
 output_lock = multiprocessing.RLock()
-total_tests = len(test_work_items)
+# item = (root, tests, test_directory, dotest_argv)
+total_tests = sum([len(item[1]) for item in test_work_items])
 test_counter = multiprocessing.Value('i', 0)
-print >> sys.stderr, "Testing: %d tests, %d threads" % (total_tests, num_threads)
-update_progress(None, None)
+test_name_len = multiprocessing.Value('i', 0)
+print >> sys.stderr, "Testing: %d test suites, %d thread%s" % (
+total_tests, num_threads, (num_threads > 1) * "s")
+update_progress()
 
 # Run the items, either in a pool (for multicore speedup) or
 # calling each individually.
 if num_threads > 1:
-pool = multiprocessing.Pool(num_threads,
-initializer = setup_global_variables,
-initargs = (output_lock, test_counter, total_tests, dotest_options))
+pool = multiprocessing.Pool(
+num_threads,
+initializer=setup_global_variables,
+  

Re: [Lldb-commits] [PATCH] D11910: Refactor dosep to use list comprehension. NFC.

2015-08-10 Thread Zachary Turner via lldb-commits
zturner added a comment.

lgtm


http://reviews.llvm.org/D11910



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D11909: Don't print number of failures and percentage if no tests ran.

2015-08-10 Thread Zachary Turner via lldb-commits
lgtm

On Mon, Aug 10, 2015 at 9:50 AM Chaoren Lin  wrote:

> chaoren created this revision.
> chaoren added a reviewer: zturner.
> chaoren added a subscriber: lldb-commits.
>
> http://reviews.llvm.org/D11909
>
> Files:
>   test/dosep.py
>
> Index: test/dosep.py
> ===
> --- test/dosep.py
> +++ test/dosep.py
> @@ -444,10 +444,16 @@
>  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) 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'))
> +sys.stdout.write("Ran %d test suites" % num_test_files)
> +if num_test_files > 0:
> +sys.stdout.write(" (%d failed) (%f%%)" % (
> +len(failed), 100.0 * len(failed) / num_test_files))
> +print
> +sys.stdout.write("Ran %d test cases" % num_tests)
> +if num_tests > 0:
> +sys.stdout.write(" (%d failed) (%f%%)" % (
> +all_fails, 100.0 * all_fails / num_tests))
> +print
>  if len(failed) > 0:
>  failed.sort()
>  print "Failing Tests (%d)" % len(failed)
>
>
>
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r244469 - Allow dosep.py to print dotest.py output on success.

2015-08-10 Thread Zachary Turner via lldb-commits
Author: zturner
Date: Mon Aug 10 12:46:11 2015
New Revision: 244469

URL: http://llvm.org/viewvc/llvm-project?rev=244469&view=rev
Log:
Allow dosep.py to print dotest.py output on success.

Previously all test output was reported by each individual
instance of dotest.py.  After a recent patch, dosep gets dotest
outptu via a pipe, and selectively decides which output to
print.

This breaks certain scripts which rely on having full output
of each dotest instance to do various parsing and/or log-scraping.

While we make no promises about the format of dotest output, it's
easy to restore this to the old behavior for now, although it is
behind a flag.  To re-enable full output, run dosep.py with the -s
option.

Differential Revision: http://reviews.llvm.org/D11816
Reviewed By: Chaoren Lin

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=244469&r1=244468&r2=244469&view=diff
==
--- lldb/trunk/test/dosep.py (original)
+++ lldb/trunk/test/dosep.py Mon Aug 10 12:46:11 2015
@@ -67,6 +67,7 @@ output_lock = None
 test_counter = None
 total_tests = None
 dotest_options = None
+output_on_success = False
 
 def setup_global_variables(lock, counter, total, options):
 global output_lock, test_counter, total_tests, dotest_options
@@ -75,19 +76,34 @@ def setup_global_variables(lock, counter
 total_tests = total
 dotest_options = options
 
-def update_status(name = None, command = None, output = None):
+def report_test_failure(name, command, output):
+global output_lock
+with output_lock:
+print >> sys.stderr, "\n"
+print >> sys.stderr, output
+print >> sys.stderr, "Command invoked: %s" % ' '.join(command)
+update_progress(name, "FAILED")
+
+def report_test_pass(name, output):
+global output_lock, output_on_success
+with output_lock:
+if output_on_success:
+print >> sys.stderr, "\n"
+print >> sys.stderr, output
+update_progress(name, "PASSED")
+
+def update_progress(test_name, result):
 global output_lock, test_counter, total_tests
 with output_lock:
-if output is not None:
-print >> sys.stderr
-print >> sys.stderr, "Failed test suite: %s" % name
-print >> sys.stderr, "Command invoked: %s" % ' '.join(command)
-print >> sys.stderr, "stdout:\n%s" % output[0]
-print >> sys.stderr, "stderr:\n%s" % output[1]
-sys.stderr.write("\r%*d out of %d test suites processed" %
-(len(str(total_tests)), test_counter.value, total_tests))
-sys.stderr.flush()
+if test_name != None:
+sys.stderr.write("\n[%s %s] - %d out of %d test suites processed" %
+(result, test_name, test_counter.value, total_tests))
+else:
+sys.stderr.write("\n%d out of %d test suites processed" %
+(test_counter.value, total_tests))
 test_counter.value += 1
+sys.stdout.flush()
+sys.stderr.flush()
 
 def parse_test_results(output):
 passes = 0
@@ -126,7 +142,11 @@ def call_with_timeout(command, timeout,
 output = process.communicate()
 exit_status = process.returncode
 passes, failures = parse_test_results(output)
-update_status(name, command, output if exit_status != 0 else None)
+if exit_status == 0:
+# stdout does not have any useful information from 'dotest.py', only 
stderr does.
+report_test_pass(name, output[1])
+else:
+report_test_failure(name, command, output[1])
 return exit_status, passes, failures
 
 def process_dir(root, files, test_root, dotest_argv):
@@ -194,11 +214,11 @@ def walk_and_invoke(test_directory, test
 test_work_items.append((root, files, test_directory, dotest_argv))
 
 global output_lock, test_counter, total_tests
-output_lock = multiprocessing.Lock()
+output_lock = multiprocessing.RLock()
 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()
+update_progress(None, None)
 
 # Run the items, either in a pool (for multicore speedup) or
 # calling each individually.
@@ -327,6 +347,12 @@ Run lldb test suite using a separate pro
   dest='dotest_options',
   help="""The options passed to 'dotest.py' if 
specified.""")
 
+parser.add_option('-s', '--output-on-success',
+  action='store_true',
+  dest='output_on_success',
+  default=False,
+  help="""Print full output of 'dotest.py' even when it 
succeeds.""")
+
 parser.add_option('-t', '--threads',
   type='int',
   dest='num_threads',
@@ -340,6 +366

Re: [Lldb-commits] [PATCH] D11816: Allow dosep.py to print full output of dotest.py, even when dotest succeeds.

2015-08-10 Thread Chaoren Lin via lldb-commits
chaoren added a comment.

Zach, there were two more comments since the LGTM.



Comment at: test/dosep.py:1
@@ -1,2 +1,2 @@
-#!/usr/bin/env python
+#!/usr/bin/env python
 

chaoren wrote:
> I think you added a  character here. Could you please double check 
> before submitting?
Please remove the byte-order-mark that your editor added. 


Comment at: test/dosep.py:95
@@ -79,1 +94,3 @@
+
+def update_progress(test_name, result):
 global output_lock, test_counter, total_tests

chaoren wrote:
> The order of `test_name` and `result` here is different from the invocation.
The order of test_name and result here is different from the invocation.


http://reviews.llvm.org/D11816



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D11846: Make dosep.py PEP8 compliant. NFC.

2015-08-10 Thread Greg Clayton via lldb-commits
clayborg accepted this revision.
clayborg added a comment.
This revision is now accepted and ready to land.

Looks fine.


http://reviews.llvm.org/D11846



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D11899: Fix AArch64 watchpoint handlers in NativeRegisterContextLinux_arm64

2015-08-10 Thread Greg Clayton via lldb-commits
clayborg resigned from this revision.
clayborg removed a reviewer: clayborg.
clayborg added a comment.

I will defer to Tamas Berghammer since I have no expertise is arm64 watchpoints.


http://reviews.llvm.org/D11899



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D11902: Fix LLGS to enable read type watchpoints

2015-08-10 Thread Greg Clayton via lldb-commits
clayborg requested changes to this revision.
clayborg added a comment.
This revision now requires changes to proceed.

Init "watch_flags" to zero and this is good to go.



Comment at: 
source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp:2230
@@ -2229,2 +2229,3 @@
 bool want_hardware = false;
+uint32_t watch_flags;
 

tberghammer wrote:
> (nit): Please initialize to 0
Yes, init to zero please.


http://reviews.llvm.org/D11902



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D11816: Allow dosep.py to print full output of dotest.py, even when dotest succeeds.

2015-08-10 Thread Zachary Turner via lldb-commits
zturner added a comment.

Chaoren, am I still missing any requested changes or is this good to go?  I'm 
not sure if some of your original concerns still stand after the latest 
discussion.


http://reviews.llvm.org/D11816



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D11846: Make dosep.py PEP8 compliant. NFC.

2015-08-10 Thread Chaoren Lin via lldb-commits
chaoren updated this revision to Diff 31683.
chaoren added a comment.

Rebase on top of http://reviews.llvm.org/D11910.


http://reviews.llvm.org/D11846

Files:
  test/dosep.py

Index: test/dosep.py
===
--- test/dosep.py
+++ test/dosep.py
@@ -20,7 +20,8 @@
 E.g., export LLDB_TEST_TIMEOUT=0
 orexport LLDB_TESTCONCURRENTEVENTS_TIMEOUT=0
 
-To collect core files for timed out tests, do the following before running dosep.py
+To collect core files for timed out tests,
+do the following before running dosep.py
 
 OSX
 ulimit -c unlimited
@@ -43,6 +44,7 @@
 
 from optparse import OptionParser
 
+
 def get_timeout_command():
 """Search for a suitable timeout command."""
 if not sys.platform.startswith("win32"):
@@ -70,6 +72,7 @@
 dotest_options = None
 output_on_success = False
 
+
 def setup_global_variables(lock, counter, total, name_len, options):
 global output_lock, test_counter, total_tests, test_name_len
 global dotest_options
@@ -79,6 +82,7 @@
 test_name_len = name_len
 dotest_options = options
 
+
 def report_test_failure(name, command, output):
 global output_lock
 with output_lock:
@@ -88,6 +92,7 @@
 print >> sys.stderr, "Command invoked: %s" % ' '.join(command)
 update_progress(name)
 
+
 def report_test_pass(name, output):
 global output_lock, output_on_success
 with output_lock:
@@ -97,6 +102,7 @@
 print >> sys.stderr, "[%s PASSED]" % name
 update_progress(name)
 
+
 def update_progress(test_name=""):
 global output_lock, test_counter, total_tests, test_name_len
 with output_lock:
@@ -111,50 +117,60 @@
 sys.stdout.flush()
 sys.stderr.flush()
 
+
 def parse_test_results(output):
 passes = 0
 failures = 0
 for result in output:
-pass_count = re.search("^RESULT:.*([0-9]+) passes", result, re.MULTILINE)
-fail_count = re.search("^RESULT:.*([0-9]+) failures", result, re.MULTILINE)
-error_count = re.search("^RESULT:.*([0-9]+) errors", result, re.MULTILINE)
+pass_count = re.search("^RESULT:.*([0-9]+) passes",
+   result, re.MULTILINE)
+fail_count = re.search("^RESULT:.*([0-9]+) failures",
+   result, re.MULTILINE)
+error_count = re.search("^RESULT:.*([0-9]+) errors",
+result, re.MULTILINE)
 this_fail_count = 0
 this_error_count = 0
-if pass_count != None:
+if pass_count is not None:
 passes = passes + int(pass_count.group(1))
-if fail_count != None:
+if fail_count is not None:
 failures = failures + int(fail_count.group(1))
-if error_count != None:
+if error_count is not None:
 failures = failures + int(error_count.group(1))
 pass
 return passes, failures
 
+
 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
 if timeout_command and timeout != "0":
 command = [timeout_command, '-s', 'QUIT', timeout] + command
-# Specifying a value for close_fds is unsupported on Windows when using subprocess.PIPE
+# Specifying a value for close_fds is unsupported on Windows when using
+# subprocess.PIPE
 if os.name != "nt":
-process = subprocess.Popen(command, stdin=subprocess.PIPE,
-stdout=subprocess.PIPE,
-stderr=subprocess.PIPE,
-close_fds=True)
+process = subprocess.Popen(command,
+   stdin=subprocess.PIPE,
+   stdout=subprocess.PIPE,
+   stderr=subprocess.PIPE,
+   close_fds=True)
 else:
-process = subprocess.Popen(command, stdin=subprocess.PIPE,
-stdout=subprocess.PIPE,
-stderr=subprocess.PIPE)
+process = subprocess.Popen(command,
+   stdin=subprocess.PIPE,
+   stdout=subprocess.PIPE,
+   stderr=subprocess.PIPE)
 output = process.communicate()
 exit_status = process.returncode
 passes, failures = parse_test_results(output)
 if exit_status == 0:
-# stdout does not have any useful information from 'dotest.py', only stderr does.
+# stdout does not have any useful information from 'dotest.py',
+# only stderr does.
 report_test_pass(name, output[1])
 else:
 report_test_failure(name, command, output[1])
 return name, exit_status, passes, failures
 
+
 def process_dir(root, files, test_root, dotest_argv

Re: [Lldb-commits] [PATCH] D11102: Set the default language to use when evaluating to that of the frame's CU.

2015-08-10 Thread Greg Clayton via lldb-commits
clayborg resigned from this revision.
clayborg removed a reviewer: clayborg.
clayborg added a comment.

I will let Jim and Sean handle this one.


http://reviews.llvm.org/D11102



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D10216: Initial diff for FreeBSD kernel debugging support

2015-08-10 Thread Greg Clayton via lldb-commits
clayborg accepted this revision.
clayborg added a comment.
This revision is now accepted and ready to land.

Looks good as long as the code is using the LLDB coding style which I believe 
has been addressed.


http://reviews.llvm.org/D10216



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D11910: Refactor dosep to use list comprehension. NFC.

2015-08-10 Thread Chaoren Lin via lldb-commits
chaoren created this revision.
chaoren added a reviewer: zturner.
chaoren added a subscriber: lldb-commits.

http://reviews.llvm.org/D11910

Files:
  test/dosep.py

Index: test/dosep.py
===
--- test/dosep.py
+++ test/dosep.py
@@ -153,15 +153,11 @@
 report_test_pass(name, output[1])
 else:
 report_test_failure(name, command, output[1])
-return exit_status, passes, failures
+return name, exit_status, passes, failures
 
 def process_dir(root, files, test_root, dotest_argv):
 """Examine a directory for tests, and invoke any found within it."""
-timed_out = []
-failed = []
-passed = []
-pass_sub_count = 0
-fail_sub_count = 0
+results = []
 for name in files:
 script_file = os.path.join(test_root, "dotest.py")
 command = ([sys.executable, script_file] +
@@ -172,27 +168,27 @@
 
 timeout = os.getenv("LLDB_%s_TIMEOUT" % timeout_name) or getDefaultTimeout(dotest_options.lldb_platform_name)
 
-exit_status, pass_count, fail_count = call_with_timeout(command, timeout, name)
+results.append(call_with_timeout(command, timeout, name))
 
-pass_sub_count = pass_sub_count + pass_count
-fail_sub_count = fail_sub_count + fail_count
+# result = (name, status, passes, failures)
+timed_out = [name for name, status, _, _ in results
+ if status == eTimedOut]
+passed = [name for name, status, _, _ in results
+  if status == ePassed]
+failed = [name for name, _, _, _ in results
+  if name not in timed_out + passed]
+pass_count = sum([result[2] for result in results])
+fail_count = sum([result[3] for result in results])
 
-if exit_status == ePassed:
-passed.append(name)
-else:
-if eTimedOut == exit_status:
-timed_out.append(name)
-failed.append(name)
-return (timed_out, failed, passed, fail_sub_count, pass_sub_count)
+return (timed_out, passed, failed, pass_count, fail_count)
 
 in_q = None
 out_q = None
 
 def process_dir_worker(arg_tuple):
 """Worker thread main loop when in multithreaded mode.
 Takes one directory specification at a time and works on it."""
-(root, files, test_root, dotest_argv) = arg_tuple
-return process_dir(root, files, test_root, dotest_argv)
+return process_dir(*arg_tuple)
 
 def walk_and_invoke(test_directory, test_subdir, dotest_argv, num_threads):
 """Look for matched files and invoke test driver on each one.
@@ -237,25 +233,16 @@
   dotest_options))
 test_results = pool.map(process_dir_worker, test_work_items)
 else:
-test_results = []
-for work_item in test_work_items:
-test_results.append(process_dir_worker(work_item))
-
-timed_out = []
-failed = []
-passed = []
-fail_sub_count = 0
-pass_sub_count = 0
-
-for test_result in test_results:
-(dir_timed_out, dir_failed, dir_passed, dir_fail_sub_count, dir_pass_sub_count) = test_result
-timed_out += dir_timed_out
-failed += dir_failed
-passed += dir_passed
-fail_sub_count = fail_sub_count + dir_fail_sub_count
-pass_sub_count = pass_sub_count + dir_pass_sub_count
-
-return (timed_out, failed, passed, fail_sub_count, pass_sub_count)
+test_results = map(process_dir_worker, test_work_items)
+
+# result = (timed_out, failed, passed, fail_count, pass_count)
+timed_out = sum([result[0] for result in test_results], [])
+passed = sum([result[1] for result in test_results], [])
+failed = sum([result[2] for result in test_results], [])
+pass_count = sum([result[3] for result in test_results])
+fail_count = sum([result[4] for result in test_results])
+
+return (timed_out, passed, failed, pass_count, fail_count)
 
 def getExpectedTimeouts(platform_name):
 # returns a set of test filenames that might timeout
@@ -414,11 +401,12 @@
 num_threads = 1
 
 system_info = " ".join(platform.uname())
-(timed_out, failed, passed, all_fails, all_passes) = walk_and_invoke(test_directory, test_subdir, dotest_argv, num_threads)
+(timed_out, passed, failed, pass_count, fail_count) = walk_and_invoke(
+test_directory, test_subdir, dotest_argv, num_threads)
 
 timed_out = set(timed_out)
-num_test_files = len(failed) + len(passed)
-num_tests = all_fails + all_passes
+num_test_files = len(passed) + len(failed)
+num_test_cases = pass_count + fail_count
 
 # move core files into session dir
 cores = find('core.*', test_subdir)
@@ -449,10 +437,10 @@
 sys.stdout.write(" (%d failed) (%f%%)" % (
 len(failed), 100.0 * len(failed) / num_test_files))
 print
-sys.stdout.write("Ran %d test cases" % num_tests)
-if num_tests > 0:
+sys.stdout.write("Ran %d test cases" % num_test_cases)
+if num_test_cases 

[Lldb-commits] [PATCH] D11909: Don't print number of failures and percentage if no tests ran.

2015-08-10 Thread Chaoren Lin via lldb-commits
chaoren created this revision.
chaoren added a reviewer: zturner.
chaoren added a subscriber: lldb-commits.

http://reviews.llvm.org/D11909

Files:
  test/dosep.py

Index: test/dosep.py
===
--- test/dosep.py
+++ test/dosep.py
@@ -444,10 +444,16 @@
 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) 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'))
+sys.stdout.write("Ran %d test suites" % num_test_files)
+if num_test_files > 0:
+sys.stdout.write(" (%d failed) (%f%%)" % (
+len(failed), 100.0 * len(failed) / num_test_files))
+print
+sys.stdout.write("Ran %d test cases" % num_tests)
+if num_tests > 0:
+sys.stdout.write(" (%d failed) (%f%%)" % (
+all_fails, 100.0 * all_fails / num_tests))
+print
 if len(failed) > 0:
 failed.sort()
 print "Failing Tests (%d)" % len(failed)


Index: test/dosep.py
===
--- test/dosep.py
+++ test/dosep.py
@@ -444,10 +444,16 @@
 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) 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'))
+sys.stdout.write("Ran %d test suites" % num_test_files)
+if num_test_files > 0:
+sys.stdout.write(" (%d failed) (%f%%)" % (
+len(failed), 100.0 * len(failed) / num_test_files))
+print
+sys.stdout.write("Ran %d test cases" % num_tests)
+if num_tests > 0:
+sys.stdout.write(" (%d failed) (%f%%)" % (
+all_fails, 100.0 * all_fails / num_tests))
+print
 if len(failed) > 0:
 failed.sort()
 print "Failing Tests (%d)" % len(failed)
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D11641: Handle floating point and aggregate return types in SysV-mips64 ABI

2015-08-10 Thread Greg Clayton via lldb-commits
clayborg accepted this revision.
clayborg added a comment.
This revision is now accepted and ready to land.

Looks good.


Repository:
  rL LLVM

http://reviews.llvm.org/D11641



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [lldb] r244308 - [LLDB][MIPS] Fix offsets of all register sets and add MSA regset and FRE=1 mode support

2015-08-10 Thread Ed Maste via lldb-commits
On 7 August 2015 at 02:39, Sagar Thakur via lldb-commits
 wrote:
>
> Author: slthakur
> Date: Fri Aug  7 01:39:38 2015
> New Revision: 244308
>
> URL: http://llvm.org/viewvc/llvm-project?rev=244308&view=rev
> Log:
> [LLDB][MIPS] Fix offsets of all register sets and add MSA regset and FRE=1 
> mode support

This change introduced a failure on FreeBSD in
test_register_expressions TestRegisters RegisterCommandsTestCase

From the test log:
python2.7 SBCommandInterpreter(0x804549200)::HandleCommand
(command="expr/x $eax", SBCommandReturnObject(0x8023fe600),
add_to_history=0)
python2.7 SBCommandReturnObject(0x8023fe600)::GetError () => "error:
Couldn't materialize: data for register eax had size 8 but we expected
4
Errored out in Execute, couldn't PrepareToExecuteJITExpression
"
python2.7 SBCommandInterpreter(0x804549200)::HandleCommand
(command="expr/x $eax", SBCommandReturnObject(0x8023fe600): Status:
Fail
Error Message:
error: Couldn't materialize: data for register eax had size 8 but we expected 4
Errored out in Execute, couldn't PrepareToExecuteJITExpression
, add_to_history=0) => 6
python2.7 SBCommandReturnObject(0x8023fe600)::GetError () => "error:
Couldn't materialize: data for register eax had size 8 but we expected
4
Errored out in Execute, couldn't PrepareToExecuteJITExpression
"
runCmd: expr/x $eax
runCmd failed!
error: Couldn't materialize: data for register eax had size 8 but we expected 4
Errored out in Execute, couldn't PrepareToExecuteJITExpression


These tests also started failing in the last few days, but I haven't
yet confirmed they are also introduced by this change.
test_breakpoint_condition_inline_with_dwarf_and_run_command
TestBreakpointConditions BreakpointConditionsTestCase
test_breakpoint_condition_with_dwarf_and_run_command
TestBreakpointConditions BreakpointConditionsTestCase
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D11574: Add size field to library load event

2015-08-10 Thread Paul Maybee via lldb-commits
paulmaybee added a comment.

Can you please check in in for me. Thanks.


http://reviews.llvm.org/D11574



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [lldb] r244308 - [LLDB][MIPS] Fix offsets of all register sets and add MSA regset and FRE=1 mode support

2015-08-10 Thread Ed Maste via lldb-commits
On 7 August 2015 at 02:39, Sagar Thakur via lldb-commits
 wrote:
>
> Author: slthakur
> Date: Fri Aug  7 01:39:38 2015
> New Revision: 244308
>
> URL: http://llvm.org/viewvc/llvm-project?rev=244308&view=rev
> Log:
> [LLDB][MIPS] Fix offsets of all register sets and add MSA regset and FRE=1 
> mode support

This change introduced a failure on FreeBSD in
test_register_expressions TestRegisters RegisterCommandsTestCase

From the test log:
python2.7 SBCommandInterpreter(0x804549200)::HandleCommand
(command="expr/x $eax", SBCommandReturnObject(0x8023fe600),
add_to_history=0)
python2.7 SBCommandReturnObject(0x8023fe600)::GetError () => "error:
Couldn't materialize: data for register eax had size 8 but we expected
4
Errored out in Execute, couldn't PrepareToExecuteJITExpression
"
python2.7 SBCommandInterpreter(0x804549200)::HandleCommand
(command="expr/x $eax", SBCommandReturnObject(0x8023fe600): Status:
Fail
Error Message:
error: Couldn't materialize: data for register eax had size 8 but we expected 4
Errored out in Execute, couldn't PrepareToExecuteJITExpression
, add_to_history=0) => 6
python2.7 SBCommandReturnObject(0x8023fe600)::GetError () => "error:
Couldn't materialize: data for register eax had size 8 but we expected
4
Errored out in Execute, couldn't PrepareToExecuteJITExpression
"
runCmd: expr/x $eax
runCmd failed!
error: Couldn't materialize: data for register eax had size 8 but we expected 4
Errored out in Execute, couldn't PrepareToExecuteJITExpression


These tests also started failing in the last few days, but I haven't
yet confirmed they are also introduced by this change.
test_breakpoint_condition_inline_with_dwarf_and_run_command
TestBreakpointConditions BreakpointConditionsTestCase
test_breakpoint_condition_with_dwarf_and_run_command
TestBreakpointConditions BreakpointConditionsTestCase
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D11519: [MIPS] Use qfThreadID if qC packet is not supported by target

2015-08-10 Thread Greg Clayton via lldb-commits
clayborg requested changes to this revision.
clayborg added a comment.
This revision now requires changes to proceed.

I don't see how passing the target architecture's OS helps here since you 
aren't checking it for linux or any of the other OS's where pid == tid. This 
arch is likely to be unset during many of these calls which makes the test just 
assume any time the OS is unknown it will just assume pid == tid.



Comment at: 
source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp:1463-1465
@@ +1462,5 @@
+
+// If we don't get a response for $qC, check if $qfThreadID gives us a 
result.
+if (m_curr_pid == LLDB_INVALID_PROCESS_ID && ostype == 
llvm::Triple::UnknownOS)
+{
+std::vector thread_ids;

How does checking the "ostype" with unknown help us to determine if this is an 
OS where pid == tid? What if the user makes their target with:

```
(lldb) target create --arch x86_64-pc-linux ...
```

Then this code doesn't trigger?


Repository:
  rL LLVM

http://reviews.llvm.org/D11519



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [lldb] r244308 - [LLDB][MIPS] Fix offsets of all register sets and add MSA regset and FRE=1 mode support

2015-08-10 Thread Ed Maste via lldb-commits
On 10 August 2015 at 05:13,   wrote:
>
>
> Hi Ed,
>
> We do not require to handle e_void case in GetData() as we have already
> checked if bytes_size greater than zero.
>>
>> 136bool
>> 137Scalar::GetData (DataExtractor &data, size_t limit_byte_size)
>> const
>> 138{
>> 139size_t byte_size = GetByteSize();
>> 140static float f_val;
>> 141static double d_val;
>> ->142 if (byte_size > 0)
>> 143{
>
> Should I still add a case for e_void to clear the warnings?

We should clear the warnings, even though in in this case we can't
reach the switch statement if m_type is e_void as you say. It's
probably worth a brief comment on the case though.
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D11898: Also initialize ScriptInterpreterNone if Python is disabled

2015-08-10 Thread Zachary Turner via lldb-commits
lgtm

On Mon, Aug 10, 2015 at 2:15 AM Keno Fischer 
wrote:

> loladiro created this revision.
> loladiro added a reviewer: zturner.
> loladiro added a subscriber: lldb-commits.
> loladiro set the repository for this revision to rL LLVM.
>
> We get an assertion otherwise because the None Interpreter cannot be found
>
> Repository:
>   rL LLVM
>
> http://reviews.llvm.org/D11898
>
> Files:
>   source/API/SystemInitializerFull.cpp
>
> Index: source/API/SystemInitializerFull.cpp
> ===
> --- source/API/SystemInitializerFull.cpp
> +++ source/API/SystemInitializerFull.cpp
> @@ -231,6 +231,7 @@
>  SystemInitializerFull::Initialize()
>  {
>  SystemInitializerCommon::Initialize();
> +ScriptInterpreterNone::Initialize();
>
>  #if !defined(LLDB_DISABLE_PYTHON)
>  InitializeSWIG();
> @@ -238,7 +239,6 @@
>  // ScriptInterpreterPython::Initialize() depends on things like
> HostInfo being initialized
>  // so it can compute the python directory etc, so we need to do this
> after
>  // SystemInitializerCommon::Initialize().
> -ScriptInterpreterNone::Initialize();
>  ScriptInterpreterPython::Initialize();
>  #endif
>
>
>
>
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D11899: Fix AArch64 watchpoint handlers in NativeRegisterContextLinux_arm64

2015-08-10 Thread Tamas Berghammer via lldb-commits
tberghammer added a comment.

Generally looks good to me. I am happy to push the 2 cleanup change to a 
separate CL but please check that the read/write flag calculation is correct.



Comment at: 
source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp:514-519
@@ -507,8 +513,8 @@
 
 // Check if our hardware breakpoint and watchpoint information is updated.
 if (m_refresh_hwdebug_info)
 {
-ReadHardwareDebugInfo (m_max_hwp_supported, m_max_hbp_supported);
+ReadHardwareDebugInfo ();
 m_refresh_hwdebug_info = false;
 }


You use this pattern several times in this class. It would be nice if you can 
move it out to a separate function to avoid code duplication.


Comment at: 
source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp:537
@@ -529,1 +536,3 @@
+// Flip watchpoint flag bits to match AArch64 write-read bit configuration.
+watch_flags = ((watch_flags >> 1) | (watch_flags << 1));
 

I think this expression is incorrect. Based on 
http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0500d/CEGDIEBB.html
 I don't see why you need this at all and if watch_flags==0x3 then it will set 
watch_flags to 0x7 what looks wrong for me.


Comment at: 
source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp:753
@@ -737,6 +752,3 @@
 Error
-NativeRegisterContextLinux_arm64::WriteHardwareDebugRegs(lldb::addr_t 
*addr_buf,
- uint32_t *cntrl_buf,
- int type,
- int count)
+NativeRegisterContextLinux_arm64::WriteHardwareDebugRegs(int type)
 {

The 0/1 for the type isn't too descriptive. Please use an enum here (or the 
NT_ARM_HW_WATCH/NT_ARM_HW_BREAK constants)


http://reviews.llvm.org/D11899



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D11902: Fix LLGS to enable read type watchpoints

2015-08-10 Thread Tamas Berghammer via lldb-commits
tberghammer accepted this revision.
tberghammer added a comment.
This revision is now accepted and ready to land.

LGTM



Comment at: 
source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp:2230
@@ -2229,2 +2229,3 @@
 bool want_hardware = false;
+uint32_t watch_flags;
 

(nit): Please initialize to 0


http://reviews.llvm.org/D11902



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D11902: Fix LLGS to enable read type watchpoints

2015-08-10 Thread Muhammad Omair Javaid via lldb-commits
omjavaid created this revision.
omjavaid added reviewers: tberghammer, clayborg.
omjavaid added a subscriber: lldb-commits.

LLGS was forcing lldb to use only write or read+write type watchpoints.

This patch fixes this behavior to enable read, write and read+write types of 
watchpoints.

Note: On x86_64 read watchpoints still dont work and they are disabled by 
NativeRegisterContextLinux_x86. We ll need to revisit this later because all 
three types of watchpoints should also work on x86.

http://reviews.llvm.org/D11902

Files:
  source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp
  source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp

Index: source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
===
--- source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
+++ source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
@@ -2227,6 +2227,7 @@
 
 bool want_breakpoint = true;
 bool want_hardware = false;
+uint32_t watch_flags;
 
 const GDBStoppointType stoppoint_type =
 GDBStoppointType(packet.GetS32 (eStoppointInvalid));
@@ -2237,10 +2238,13 @@
 case eBreakpointHardware:
 want_hardware = true;  want_breakpoint = true;  break;
 case eWatchpointWrite:
+watch_flags = 1;
 want_hardware = true;  want_breakpoint = false; break;
 case eWatchpointRead:
+watch_flags = 2;
 want_hardware = true;  want_breakpoint = false; break;
 case eWatchpointReadWrite:
+watch_flags = 3;
 want_hardware = true;  want_breakpoint = false; break;
 case eStoppointInvalid:
 return SendIllFormedResponse(packet, "Z packet had invalid 
software/hardware specifier");
@@ -2280,11 +2284,6 @@
 }
 else
 {
-uint32_t watch_flags =
-stoppoint_type == eWatchpointWrite
-? 0x1  // Write
-: 0x3; // ReadWrite
-
 // Try to set the watchpoint.
 const Error error = m_debugged_process_sp->SetWatchpoint (
 addr, size, watch_flags, want_hardware);
Index: source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp
===
--- source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp
+++ source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp
@@ -1018,6 +1018,9 @@
 if (wp_index >= NumSupportedHardwareWatchpoints())
 return Error ("Watchpoint index out of range");
 
+if (watch_flags == 0x2)
+return Error ("Read watchpoints currently unsupported on x86_64 
architecture");
+
 if (watch_flags != 0x1 && watch_flags != 0x3)
 return Error ("Invalid read/write bits for watchpoint");
 


Index: source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
===
--- source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
+++ source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
@@ -2227,6 +2227,7 @@
 
 bool want_breakpoint = true;
 bool want_hardware = false;
+uint32_t watch_flags;
 
 const GDBStoppointType stoppoint_type =
 GDBStoppointType(packet.GetS32 (eStoppointInvalid));
@@ -2237,10 +2238,13 @@
 case eBreakpointHardware:
 want_hardware = true;  want_breakpoint = true;  break;
 case eWatchpointWrite:
+watch_flags = 1;
 want_hardware = true;  want_breakpoint = false; break;
 case eWatchpointRead:
+watch_flags = 2;
 want_hardware = true;  want_breakpoint = false; break;
 case eWatchpointReadWrite:
+watch_flags = 3;
 want_hardware = true;  want_breakpoint = false; break;
 case eStoppointInvalid:
 return SendIllFormedResponse(packet, "Z packet had invalid software/hardware specifier");
@@ -2280,11 +2284,6 @@
 }
 else
 {
-uint32_t watch_flags =
-stoppoint_type == eWatchpointWrite
-? 0x1  // Write
-: 0x3; // ReadWrite
-
 // Try to set the watchpoint.
 const Error error = m_debugged_process_sp->SetWatchpoint (
 addr, size, watch_flags, want_hardware);
Index: source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp
===
--- source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp
+++ source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp
@@ -1018,6 +1018,9 @@
 if (wp_index >= NumSupportedHardwareWatchpoints())
 return Error ("Watchpoint index out of range");
 
+if (watch_flags == 0x2)
+return Error ("Read watchpoints currently unsupported on x86_64 architecture");
+
 if (watch_flags != 0x1 && watch_flags != 

[Lldb-commits] [PATCH] D11899: Fix AArch64 watchpoint handlers in NativeRegisterContextLinux_arm64

2015-08-10 Thread Muhammad Omair Javaid via lldb-commits
omjavaid created this revision.
omjavaid added reviewers: tberghammer, clayborg.
omjavaid added a subscriber: lldb-commits.
Herald added subscribers: rengolin, aemerson.

There were some bugs that needed to be fixed in watchpoint handling code on 
arm64.

Watchpoints were being written to all watchpoint registers and cache was not 
being maintained correctly.

This patch fixes up all these issues. Watchpoints now work on arm64 except that 
there is race condition which is not allowing lldb to step out of a watchpoint 
hit before we can continue again so inferior gets stuck at that point. Manually 
disabling the watchpoint then issuing a step and then enabling the watchpoint 
again fixes shows that watchpoints are being installed and removed correctly.

http://reviews.llvm.org/D11899

Files:
  source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp
  source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.h

Index: source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.h
===
--- source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.h
+++ source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.h
@@ -172,10 +172,10 @@
 IsFPR(unsigned reg) const;
 
 Error
-ReadHardwareDebugInfo(unsigned int &watch_count , unsigned int &break_count);
+ReadHardwareDebugInfo();
 
 Error
-WriteHardwareDebugRegs(lldb::addr_t *addr_buf, uint32_t *cntrl_buf, int type, int count);
+WriteHardwareDebugRegs(int type);
 };
 
 } // namespace process_linux
Index: source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp
===
--- source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp
+++ source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp
@@ -391,14 +391,10 @@
 if (log)
 log->Printf ("NativeRegisterContextLinux_arm64::%s()", __FUNCTION__);
 
-NativeProcessProtocolSP process_sp (m_thread.GetProcess ());
-if (!process_sp)
-return false;
-
 // Check if our hardware breakpoint and watchpoint information is updated.
 if (m_refresh_hwdebug_info)
 {
-ReadHardwareDebugInfo (m_max_hwp_supported, m_max_hbp_supported);
+ReadHardwareDebugInfo ();
 m_refresh_hwdebug_info = false;
 }
 
@@ -443,7 +439,8 @@
 m_hbr_regs[bp_index].control = control_value;
 m_hbr_regs[bp_index].refcount = 1;
 
-//TODO: PTRACE CALL HERE for an UPDATE
+// PTRACE call to set corresponding hardware breakpoint register.
+WriteHardwareDebugRegs(1);
 }
 else
 m_hbr_regs[bp_index].refcount++;
@@ -459,6 +456,13 @@
 if (log)
 log->Printf ("NativeRegisterContextLinux_arm64::%s()", __FUNCTION__);
 
+// Check if our hardware breakpoint and watchpoint information is updated.
+if (m_refresh_hwdebug_info)
+{
+ReadHardwareDebugInfo ();
+m_refresh_hwdebug_info = false;
+}
+
 if (hw_idx >= m_max_hbp_supported)
 return false;
 
@@ -474,8 +478,8 @@
 m_hbr_regs[hw_idx].address = 0;
 m_hbr_regs[hw_idx].refcount = 0;
 
-//TODO: PTRACE CALL HERE for an UPDATE
-return true;
+// PTRACE call to clear corresponding hardware breakpoint register.
+WriteHardwareDebugRegs(1);
 }
 
 return false;
@@ -489,6 +493,13 @@
 if (log)
 log->Printf ("NativeRegisterContextLinux_arm64::%s()", __FUNCTION__);
 
+// Check if our hardware breakpoint and watchpoint information is updated.
+if (m_refresh_hwdebug_info)
+{
+ReadHardwareDebugInfo ();
+m_refresh_hwdebug_info = false;
+}
+
 return m_max_hwp_supported;
 }
 
@@ -499,33 +510,31 @@
 
 if (log)
 log->Printf ("NativeRegisterContextLinux_arm64::%s()", __FUNCTION__);
-
-NativeProcessProtocolSP process_sp (m_thread.GetProcess ());
-if (!process_sp)
-return false;
-
 
 // Check if our hardware breakpoint and watchpoint information is updated.
 if (m_refresh_hwdebug_info)
 {
-ReadHardwareDebugInfo (m_max_hwp_supported, m_max_hbp_supported);
+ReadHardwareDebugInfo ();
 m_refresh_hwdebug_info = false;
 }
 		
 uint32_t control_value, wp_index;
 
-
+// Check if we are setting watchpoint other than read/write/access
 if (watch_flags != 0x1 && watch_flags != 0x2 && watch_flags != 0x3)
-return 0;//Error ("Invalid read/write bits for watchpoint");
+return LLDB_INVALID_INDEX32;
 
 // Check if size has a valid hardware watchpoint length.
 if (size != 1 && size != 2 && size != 4 && size != 8)
-return 0;//Error ("Invalid size for watchpoint");
+return LLDB_INVALID_INDEX32;
 
 // Check 8-byte alignment for hardware watchpoint target address.
 // TODO: Add support for watching un-aligned addresses
 if (addr & 0x07)
-r

Re: [Lldb-commits] [PATCH] D11384: Improve check for ASAN callbacks

2015-08-10 Thread Tamas Berghammer via lldb-commits
tberghammer added a comment.

Friendly ping


http://reviews.llvm.org/D11384



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [lldb] r244308 - [LLDB][MIPS] Fix offsets of all register sets and add MSA regset and FRE=1 mode support

2015-08-10 Thread via lldb-commits



Hi Ed,

We do not require to handle e_void case in GetData() as we have already 
checked if bytes_size greater than zero.

136bool
137Scalar::GetData (DataExtractor &data, size_t 
limit_byte_size) const

138{
139size_t byte_size = GetByteSize();
140static float f_val;
141static double d_val;
->142 if (byte_size > 0)
143{

Should I still add a case for e_void to clear the warnings?

Thanks and Regards,
Sagar

On Friday 07 August 2015 06:49 PM, Ed Maste wrote:

On 7 August 2015 at 02:39, Sagar Thakur via lldb-commits
 wrote:

Author: slthakur
Date: Fri Aug  7 01:39:38 2015
New Revision: 244308

URL: http://llvm.org/viewvc/llvm-project?rev=244308&view=rev
Log:
[LLDB][MIPS] Fix offsets of all register sets and add MSA regset and FRE=1 mode 
support

Noticed a few new warnings after this change:

../tools/lldb/source/Core/Scalar.cpp:151:24: warning: enumeration
value 'e_void' not handled in switch [-Wswitch]
 switch(m_type)
^
../tools/lldb/source/Core/Scalar.cpp:186:24: warning: enumeration
value 'e_void' not handled in switch [-Wswitch]
 switch(m_type)
^
../tools/lldb/source/Core/Scalar.cpp:220:20: warning: enumeration
value 'e_void' not handled in switch [-Wswitch]
 switch(m_type)
^


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D11898: Also initialize ScriptInterpreterNone if Python is disabled

2015-08-10 Thread Keno Fischer via lldb-commits
loladiro created this revision.
loladiro added a reviewer: zturner.
loladiro added a subscriber: lldb-commits.
loladiro set the repository for this revision to rL LLVM.

We get an assertion otherwise because the None Interpreter cannot be found

Repository:
  rL LLVM

http://reviews.llvm.org/D11898

Files:
  source/API/SystemInitializerFull.cpp

Index: source/API/SystemInitializerFull.cpp
===
--- source/API/SystemInitializerFull.cpp
+++ source/API/SystemInitializerFull.cpp
@@ -231,6 +231,7 @@
 SystemInitializerFull::Initialize()
 {
 SystemInitializerCommon::Initialize();
+ScriptInterpreterNone::Initialize();
 
 #if !defined(LLDB_DISABLE_PYTHON)
 InitializeSWIG();
@@ -238,7 +239,6 @@
 // ScriptInterpreterPython::Initialize() depends on things like HostInfo 
being initialized
 // so it can compute the python directory etc, so we need to do this after
 // SystemInitializerCommon::Initialize().
-ScriptInterpreterNone::Initialize();
 ScriptInterpreterPython::Initialize();
 #endif
 


Index: source/API/SystemInitializerFull.cpp
===
--- source/API/SystemInitializerFull.cpp
+++ source/API/SystemInitializerFull.cpp
@@ -231,6 +231,7 @@
 SystemInitializerFull::Initialize()
 {
 SystemInitializerCommon::Initialize();
+ScriptInterpreterNone::Initialize();
 
 #if !defined(LLDB_DISABLE_PYTHON)
 InitializeSWIG();
@@ -238,7 +239,6 @@
 // ScriptInterpreterPython::Initialize() depends on things like HostInfo being initialized
 // so it can compute the python directory etc, so we need to do this after
 // SystemInitializerCommon::Initialize().
-ScriptInterpreterNone::Initialize();
 ScriptInterpreterPython::Initialize();
 #endif
 
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] TOT svn lldb crashes trying to print argc on TOT lldb, maybe fallout from r244308 - [LLDB][MIPS] Fix offsets of all register sets and add MSA regset and FRE=1 mode support

2015-08-10 Thread via lldb-commits

Hi Jason,

The function sext() for sign extending APInt values requires the new bit 
width to be greater than the current bit width. That is the reason I was 
just creating a new APInt instead of using sext function in cases where 
we need to promote to a type which has same bit width. I will do the 
same for promoting e_ulong type to s_longlong type to avoid the llvm 
assertion in sext() function.


I will submit a patch for the same.

Thanks and Regards,
Sagar

On Monday 10 August 2015 01:17 PM, Jason Molenda wrote:

( Resending with correct lldb-commits email address Cc:'ed )


Hi Sagar, I noticed this weekend that given an input program like

int foo (int in) { return in + 5;}
int main (int argc, char**argv) { return foo(argc); }

if I put a breakpoint on foo() on an x86 system (compiled with clang, on a 
mac), I get an llvm assert when I backtrace:

(lldb) bt
Assertion failed: (width > BitWidth && "Invalid APInt SignExtend request"), 
function sext, file /Users/jason/work/lldb/llvm/lib/Support/APInt.cpp, line 956.

The assert is being hit here -

4  0x000109cbe401  LLDB`__assert_rtn + 129  Signals.inc:517
5  0x000109c39dc8  LLDB`llvm::APInt::sext + 120  APInt.cpp:956
6  0x00010a36687d  LLDB`lldb_private::Scalar::Promote + 11725  
Scalar.cpp:1166
7  0x00010a36c073  LLDB`PromoteToMaxType + 307  Scalar.cpp:63
8  0x00010a36bd6d  LLDB`lldb_private::Scalar::operator+= + 77  
Scalar.cpp:2361
9  0x00010a46db4f  LLDB`lldb_private::DWARFExpression::Evaluate + 
38703  DWARFExpression.cpp:2564
10 0x00010a464399  LLDB`lldb_private::DWARFExpression::Evaluate + 
1785  DWARFExpression.cpp:1325
11 0x00010a3fa9e5  
LLDB`lldb_private::ValueObjectVariable::UpdateValue + 965  
ValueObjectVariable.cpp:166
12 0x00010a3c4ceb  
LLDB`lldb_private::ValueObject::UpdateValueIfNeeded + 1483  ValueObject.cpp:236
13 0x00010a3ce0ba  
LLDB`lldb_private::ValueObject::GetValueAsCString + 42  ValueObject.cpp:1430
14 0x00010a379edf  LLDB`lldb_private::FormatEntity::Format + 18991  
FormatEntity.cpp:1800
15 0x00010a375b31  LLDB`lldb_private::FormatEntity::Format + 1665  
FormatEntity.cpp:1228
16 0x00010a375b31  LLDB`lldb_private::FormatEntity::Format + 1665  
FormatEntity.cpp:1228
17 0x00010a375767  LLDB`lldb_private::FormatEntity::Format + 695  
FormatEntity.cpp:1204
18 0x00010aa1bc9b  
LLDB`lldb_private::StackFrame::DumpUsingSettingsFormat + 523  
StackFrame.cpp:1379
19 0x00010aa1d036  LLDB`lldb_private::StackFrame::GetStatus + 102  
StackFrame.cpp:1475
20 0x00010aa25ecd  LLDB`lldb_private::StackFrameList::GetStatus + 
3037  StackFrameList.cpp:936

The DWARF expression for 'argc' is

0x005c: TAG_subprogram [2] *
 AT_low_pc( 0x00010f70 )
 AT_high_pc( 0x00010fa0 )
 AT_frame_base( rbp )
 AT_name( "main" )

0x007b: TAG_formal_parameter [3]
 AT_location( fbreg -8 )

We create a Scalar object to represent the frame base value, lldb type s_ulong, 
APInt BitWidth 64, in DWARFExpression::Evaluate():

   2561 if (frame->GetFrameBaseValue(value, error_ptr))
   2562 {
   2563 int64_t fbreg_offset = 
opcodes.GetSLEB128(&offset);
-> 2564  value += fbreg_offset;


So we're adding a e_slonglong (64-bit signed value, -8) to an e_ulong (64-bit 
unsigned, 0x7fff5fbffb10).

We end up in Scalar::Promote, trying to promote the 64-bit e_ulong APInt to a 
64-bit e_slonglong APInt:

1152case e_ulong:
1153switch (type)
1154{

1164 case e_slonglong:
1165 {
->  1166  m_integer = m_integer.sext(sizeof(slonglong_t) * 
8);
1167 success = true;
1168 break;


and APInt::sext() asserts because the unsigned and the signed types have the 
same bit width.


NB if I stop in main() itself, Frame::GetFrameBaseValue() happens to return a 
Scalar frame base value of e_ulonglong (still 64-bits) for the frame base 
value.  This means that Scalar::Promote instead creates a new APInt object 
instead of trying to sign extend:

   1225  case e_ulonglong:
   1226  {
-> 1227   m_integer = llvm::APInt(sizeof(ulonglong_t) * 8, 
*(const uint64_t *)m_integer.getRawData(), false);


and it works as expected.  For whatever reason, when we retrieve the frame base 
value higher up on the stack, we are getting an e_ulong (64-bits) which is when 
we have problems.



J



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r244436 - Feedback from Jim: Change the "optimized code" warning to be entirely

2015-08-10 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Mon Aug 10 02:55:25 2015
New Revision: 244436

URL: http://llvm.org/viewvc/llvm-project?rev=244436&view=rev
Log:
Feedback from Jim: Change the "optimized code" warning to be entirely
contained within Process so that we won't be duplicating the warning
message if other parts of the code want to issue the message.  Change
Process::PrintWarning to be a protected method - the public method
will be the PrintWarningOptimization et al.  Also, Have
Thread::FunctionOptimizationWarning shortcut out if the warnings
have been disabled so that we don't (potentially) compute parts of
the SymbolContext unnecessarily.


Modified:
lldb/trunk/include/lldb/Target/Process.h
lldb/trunk/source/Target/Process.cpp
lldb/trunk/source/Target/Thread.cpp

Modified: lldb/trunk/include/lldb/Target/Process.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Process.h?rev=244436&r1=244435&r2=244436&view=diff
==
--- lldb/trunk/include/lldb/Target/Process.h (original)
+++ lldb/trunk/include/lldb/Target/Process.h Mon Aug 10 02:55:25 2015
@@ -1952,31 +1952,18 @@ public:
 }
 
 //--
-/// Print a user-visible warning one time per Process
-///
-/// A facility for printing a warning to the user once per repeat_key.
+/// Print a user-visible warning about a module being built with 
optimization
 ///
-/// warning_type is from the Process::Warnings enums.
-/// repeat_key is a pointer value that will be used to ensure that the
-/// warning message is not printed multiple times.  For instance, with a
-/// warning about a function being optimized, you can pass the CompileUnit
-/// pointer to have the warning issued for only the first function in a
-/// CU, or the Function pointer to have it issued once for every function,
-/// or a Module pointer to have it issued once per Module.
-///
-/// @param [in] warning_type
-/// One of the types defined in Process::Warnings.
-///
-/// @param [in] repeat_key
-/// A pointer value used to ensure that the warning is only printed 
once.
-/// May be nullptr, indicating that the warning is printed 
unconditionally
-/// every time.
-///
-/// @param [in] fmt
-/// printf style format string
+/// Prints a async warning message to the user one time per Module
+/// where a function is found that was compiled with optimization, per
+/// Process.
+///
+/// @param [in] sc
+/// A SymbolContext with eSymbolContextFunction and 
eSymbolContextModule
+/// pre-computed.
 //--
 void
-PrintWarning (uint64_t warning_type, void *repeat_key, const char *fmt, 
...) __attribute__((format(printf, 4, 5)));
+PrintWarningOptimization (const SymbolContext &sc);
 
 protected:
 
@@ -2001,6 +1988,37 @@ protected:
 //--
 void
 CompleteAttach ();
+
+//--
+/// Print a user-visible warning one time per Process
+///
+/// A facility for printing a warning to the user once per repeat_key.
+///
+/// warning_type is from the Process::Warnings enums.
+/// repeat_key is a pointer value that will be used to ensure that the
+/// warning message is not printed multiple times.  For instance, with a
+/// warning about a function being optimized, you can pass the CompileUnit
+/// pointer to have the warning issued for only the first function in a
+/// CU, or the Function pointer to have it issued once for every function,
+/// or a Module pointer to have it issued once per Module.
+///
+/// Classes outside Process should call a specific PrintWarning method
+/// so that the warning strings are all centralized in Process, instead of
+/// calling PrintWarning() directly.
+///
+/// @param [in] warning_type
+/// One of the types defined in Process::Warnings.
+///
+/// @param [in] repeat_key
+/// A pointer value used to ensure that the warning is only printed 
once.
+/// May be nullptr, indicating that the warning is printed 
unconditionally
+/// every time.
+///
+/// @param [in] fmt
+/// printf style format string
+//--
+void
+PrintWarning (uint64_t warning_type, void *repeat_key, const char *fmt, 
...) __attribute__((format(printf, 4, 5)));
 
 public:
 //--

Modified: lldb/trunk/source/Target/Process.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Process.cpp?rev=244436&r1=244435&r2=244436&view=diff
==

Re: [Lldb-commits] TOT svn lldb crashes trying to print argc on TOT lldb, maybe fallout from r244308 - [LLDB][MIPS] Fix offsets of all register sets and add MSA regset and FRE=1 mode support

2015-08-10 Thread Jason Molenda via lldb-commits
( Resending with correct lldb-commits email address Cc:'ed )


Hi Sagar, I noticed this weekend that given an input program like

int foo (int in) { return in + 5;}
int main (int argc, char**argv) { return foo(argc); }

if I put a breakpoint on foo() on an x86 system (compiled with clang, on a 
mac), I get an llvm assert when I backtrace:

(lldb) bt
Assertion failed: (width > BitWidth && "Invalid APInt SignExtend request"), 
function sext, file /Users/jason/work/lldb/llvm/lib/Support/APInt.cpp, line 956.

The assert is being hit here -

4  0x000109cbe401  LLDB`__assert_rtn + 129  Signals.inc:517
5  0x000109c39dc8  LLDB`llvm::APInt::sext + 120  APInt.cpp:956
6  0x00010a36687d  LLDB`lldb_private::Scalar::Promote + 11725  
Scalar.cpp:1166
7  0x00010a36c073  LLDB`PromoteToMaxType + 307  Scalar.cpp:63
8  0x00010a36bd6d  LLDB`lldb_private::Scalar::operator+= + 77  
Scalar.cpp:2361
9  0x00010a46db4f  LLDB`lldb_private::DWARFExpression::Evaluate + 
38703  DWARFExpression.cpp:2564
10 0x00010a464399  LLDB`lldb_private::DWARFExpression::Evaluate + 
1785  DWARFExpression.cpp:1325
11 0x00010a3fa9e5  
LLDB`lldb_private::ValueObjectVariable::UpdateValue + 965  
ValueObjectVariable.cpp:166
12 0x00010a3c4ceb  
LLDB`lldb_private::ValueObject::UpdateValueIfNeeded + 1483  ValueObject.cpp:236
13 0x00010a3ce0ba  
LLDB`lldb_private::ValueObject::GetValueAsCString + 42  ValueObject.cpp:1430
14 0x00010a379edf  LLDB`lldb_private::FormatEntity::Format + 18991  
FormatEntity.cpp:1800
15 0x00010a375b31  LLDB`lldb_private::FormatEntity::Format + 1665  
FormatEntity.cpp:1228
16 0x00010a375b31  LLDB`lldb_private::FormatEntity::Format + 1665  
FormatEntity.cpp:1228
17 0x00010a375767  LLDB`lldb_private::FormatEntity::Format + 695  
FormatEntity.cpp:1204
18 0x00010aa1bc9b  
LLDB`lldb_private::StackFrame::DumpUsingSettingsFormat + 523  
StackFrame.cpp:1379
19 0x00010aa1d036  LLDB`lldb_private::StackFrame::GetStatus + 102  
StackFrame.cpp:1475
20 0x00010aa25ecd  LLDB`lldb_private::StackFrameList::GetStatus + 
3037  StackFrameList.cpp:936

The DWARF expression for 'argc' is

0x005c: TAG_subprogram [2] *
AT_low_pc( 0x00010f70 )
AT_high_pc( 0x00010fa0 )
AT_frame_base( rbp )
AT_name( "main" )

0x007b: TAG_formal_parameter [3]  
AT_location( fbreg -8 )

We create a Scalar object to represent the frame base value, lldb type s_ulong, 
APInt BitWidth 64, in DWARFExpression::Evaluate():

  2561  if (frame->GetFrameBaseValue(value, error_ptr))
  2562  {
  2563  int64_t fbreg_offset = 
opcodes.GetSLEB128(&offset);
-> 2564 value += fbreg_offset;


So we're adding a e_slonglong (64-bit signed value, -8) to an e_ulong (64-bit 
unsigned, 0x7fff5fbffb10).

We end up in Scalar::Promote, trying to promote the 64-bit e_ulong APInt to a 
64-bit e_slonglong APInt:

   1152 case e_ulong:
   1153 switch (type)
   1154 {

   1164  case e_slonglong:
   1165  {
->  1166 m_integer = m_integer.sext(sizeof(slonglong_t) 
* 8);
   1167  success = true;
   1168  break;


and APInt::sext() asserts because the unsigned and the signed types have the 
same bit width.


NB if I stop in main() itself, Frame::GetFrameBaseValue() happens to return a 
Scalar frame base value of e_ulonglong (still 64-bits) for the frame base 
value.  This means that Scalar::Promote instead creates a new APInt object 
instead of trying to sign extend:

  1225   case e_ulonglong:
  1226   {
-> 1227  m_integer = llvm::APInt(sizeof(ulonglong_t) * 8, 
*(const uint64_t *)m_integer.getRawData(), false);


and it works as expected.  For whatever reason, when we retrieve the frame base 
value higher up on the stack, we are getting an e_ulong (64-bits) which is when 
we have problems.



J

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits