[Lldb-commits] [lldb] r343023 - [lldbinline] Set directory attribute on test-specific classes

2018-09-25 Thread Vedant Kumar via lldb-commits
Author: vedantk
Date: Tue Sep 25 13:20:13 2018
New Revision: 343023

URL: http://llvm.org/viewvc/llvm-project?rev=343023&view=rev
Log:
[lldbinline] Set directory attribute on test-specific classes

Set the "mydir" attribute of an inline test on the test-specific class,
instead of on the base InlineTest class.

This makes it possible to run dotest.py on a directory containing inline
tests. This wasn't really possible prior to this patch, because what
would happen is that one test would just run over and over again, even
though the test infrastructure would claim that different tests were
being run.

Example:

The test infrastructure claimed that all of these different tests were passing,
which couldn't be true --

$ ./bin/lldb-dotest 
/Users/vsk/src/tailcall/lldb/test/testcases/functionalities/tail_call_frames/ 
-G dwarf -t 2>&1 | grep PASS
PASS: LLDB (/Users/vsk/src/builds/tailcall-RA/bin/clang-8-x86_64) :: test_dwarf 
(lldbsuite.test.lldbtest.TestDisambiguateTailCallSeq)
PASS: LLDB (/Users/vsk/src/builds/tailcall-RA/bin/clang-8-x86_64) :: test_dwarf 
(lldbsuite.test.lldbtest.TestArtificialFrameStepOutMessage)
PASS: LLDB (/Users/vsk/src/builds/tailcall-RA/bin/clang-8-x86_64) :: test_dwarf 
(lldbsuite.test.lldbtest.TestAmbiguousTailCallSeq1)
PASS: LLDB (/Users/vsk/src/builds/tailcall-RA/bin/clang-8-x86_64) :: test_dwarf 
(lldbsuite.test.lldbtest.TestDisambiguatePathsToCommonSink)
PASS: LLDB (/Users/vsk/src/builds/tailcall-RA/bin/clang-8-x86_64) :: test_dwarf 
(lldbsuite.test.lldbtest.TestDisambiguateCallSite)
PASS: LLDB (/Users/vsk/src/builds/tailcall-RA/bin/clang-8-x86_64) :: test_dwarf 
(lldbsuite.test.lldbtest.TestUnambiguousTailCalls)
PASS: LLDB (/Users/vsk/src/builds/tailcall-RA/bin/clang-8-x86_64) :: test_dwarf 
(lldbsuite.test.lldbtest.TestAmbiguousTailCallSeq2)
RESULT: PASSED (7 passes, 0 failures, 0 errors, 24 skipped, 0 expected 
failures, 0 unexpected successes)

... because it wasn't even looking at some of these tests:

$ ./bin/lldb-dotest 
/Users/vsk/src/tailcall/lldb/test/testcases/functionalities/tail_call_frames/ 
-G dwarf -t 2>&1 | grep "Change dir"
Change dir to: 
/Users/vsk/src/tailcall/lldb/packages/Python/lldbsuite/test/functionalities/tail_call_frames/ambiguous_tail_call_seq2
Change dir to: 
/Users/vsk/src/tailcall/lldb/packages/Python/lldbsuite/test/functionalities/tail_call_frames/ambiguous_tail_call_seq2
Change dir to: 
/Users/vsk/src/tailcall/lldb/packages/Python/lldbsuite/test/functionalities/tail_call_frames/ambiguous_tail_call_seq2
Change dir to: 
/Users/vsk/src/tailcall/lldb/packages/Python/lldbsuite/test/functionalities/tail_call_frames/sbapi_support
Change dir to: 
/Users/vsk/src/tailcall/lldb/packages/Python/lldbsuite/test/functionalities/tail_call_frames/ambiguous_tail_call_seq2
Change dir to: 
/Users/vsk/src/tailcall/lldb/packages/Python/lldbsuite/test/functionalities/tail_call_frames/thread_step_out_or_return
Change dir to: 
/Users/vsk/src/tailcall/lldb/packages/Python/lldbsuite/test/functionalities/tail_call_frames/ambiguous_tail_call_seq2
Change dir to: 
/Users/vsk/src/tailcall/lldb/packages/Python/lldbsuite/test/functionalities/tail_call_frames/ambiguous_tail_call_seq2
Change dir to: 
/Users/vsk/src/tailcall/lldb/packages/Python/lldbsuite/test/functionalities/tail_call_frames/ambiguous_tail_call_seq2

E.g it was only building one of them:

$ ls lldb-test-build.noindex/functionalities/tail_call_frames/  
  
ambiguous_tail_call_seq2

Differential Revision: https://reviews.llvm.org/D52516

Modified:
lldb/trunk/packages/Python/lldbsuite/test/lldbinline.py

Modified: lldb/trunk/packages/Python/lldbsuite/test/lldbinline.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lldbinline.py?rev=343023&r1=343022&r2=343023&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/lldbinline.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/lldbinline.py Tue Sep 25 13:20:13 
2018
@@ -195,7 +195,6 @@ def MakeInlineTest(__file, __globals, de
 
 # Derive the test name from the current file name
 file_basename = os.path.basename(__file)
-InlineTest.mydir = TestBase.compute_mydir(__file)
 
 test_name, _ = os.path.splitext(file_basename)
 
@@ -209,4 +208,5 @@ def MakeInlineTest(__file, __globals, de
 # Keep track of the original test filename so we report it
 # correctly in test results.
 test_class.test_filename = __file
+test_class.mydir = TestBase.compute_mydir(__file)
 return test_class


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


[Lldb-commits] [lldb] r343899 - Relax a data formatter test

2018-10-05 Thread Vedant Kumar via lldb-commits
Author: vedantk
Date: Fri Oct  5 16:14:13 2018
New Revision: 343899

URL: http://llvm.org/viewvc/llvm-project?rev=343899&view=rev
Log:
Relax a data formatter test

Before inspecting the contents of a list, make sure that we've stepped
past the push_back() that inserts the element we're interested in.

Modified:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/TestDataFormatterLibcxxList.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/TestDataFormatterLibcxxList.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/TestDataFormatterLibcxxList.py?rev=343899&r1=343898&r2=343899&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/TestDataFormatterLibcxxList.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/TestDataFormatterLibcxxList.py
 Fri Oct  5 16:14:13 2018
@@ -190,6 +190,7 @@ class LibcxxListDataFormatterTestCase(Te
 
 self.runCmd("n") # This gets us past the printf
 self.runCmd("n")
+self.runCmd("n")
 
 # check access-by-index
 self.expect("frame variable text_list[0]",


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


[Lldb-commits] [lldb] r343900 - Add support for artificial tail call frames

2018-10-05 Thread Vedant Kumar via lldb-commits
Author: vedantk
Date: Fri Oct  5 16:23:15 2018
New Revision: 343900

URL: http://llvm.org/viewvc/llvm-project?rev=343900&view=rev
Log:
Add support for artificial tail call frames

This patch teaches lldb to detect when there are missing frames in a
backtrace due to a sequence of tail calls, and to fill in the backtrace
with artificial tail call frames when this happens. This is only done
when the execution history can be determined from the call graph and
from the return PC addresses of calls on the stack. Ambiguous sequences
of tail calls (e.g anything involving tail calls and recursion) are
detected and ignored.

Depends on D49887.

Differential Revision: https://reviews.llvm.org/D50478

Added:
lldb/trunk/packages/Python/lldbsuite/test/functionalities/tail_call_frames/

lldb/trunk/packages/Python/lldbsuite/test/functionalities/tail_call_frames/ambiguous_tail_call_seq1/

lldb/trunk/packages/Python/lldbsuite/test/functionalities/tail_call_frames/ambiguous_tail_call_seq1/Makefile

lldb/trunk/packages/Python/lldbsuite/test/functionalities/tail_call_frames/ambiguous_tail_call_seq1/TestAmbiguousTailCallSeq1.py

lldb/trunk/packages/Python/lldbsuite/test/functionalities/tail_call_frames/ambiguous_tail_call_seq1/main.cpp

lldb/trunk/packages/Python/lldbsuite/test/functionalities/tail_call_frames/ambiguous_tail_call_seq2/

lldb/trunk/packages/Python/lldbsuite/test/functionalities/tail_call_frames/ambiguous_tail_call_seq2/Makefile

lldb/trunk/packages/Python/lldbsuite/test/functionalities/tail_call_frames/ambiguous_tail_call_seq2/TestAmbiguousTailCallSeq2.py

lldb/trunk/packages/Python/lldbsuite/test/functionalities/tail_call_frames/ambiguous_tail_call_seq2/main.cpp

lldb/trunk/packages/Python/lldbsuite/test/functionalities/tail_call_frames/disambiguate_call_site/

lldb/trunk/packages/Python/lldbsuite/test/functionalities/tail_call_frames/disambiguate_call_site/Makefile

lldb/trunk/packages/Python/lldbsuite/test/functionalities/tail_call_frames/disambiguate_call_site/TestDisambiguateCallSite.py

lldb/trunk/packages/Python/lldbsuite/test/functionalities/tail_call_frames/disambiguate_call_site/main.cpp

lldb/trunk/packages/Python/lldbsuite/test/functionalities/tail_call_frames/disambiguate_paths_to_common_sink/

lldb/trunk/packages/Python/lldbsuite/test/functionalities/tail_call_frames/disambiguate_paths_to_common_sink/Makefile

lldb/trunk/packages/Python/lldbsuite/test/functionalities/tail_call_frames/disambiguate_paths_to_common_sink/TestDisambiguatePathsToCommonSink.py

lldb/trunk/packages/Python/lldbsuite/test/functionalities/tail_call_frames/disambiguate_paths_to_common_sink/main.cpp

lldb/trunk/packages/Python/lldbsuite/test/functionalities/tail_call_frames/disambiguate_tail_call_seq/

lldb/trunk/packages/Python/lldbsuite/test/functionalities/tail_call_frames/disambiguate_tail_call_seq/Makefile

lldb/trunk/packages/Python/lldbsuite/test/functionalities/tail_call_frames/disambiguate_tail_call_seq/TestDisambiguateTailCallSeq.py

lldb/trunk/packages/Python/lldbsuite/test/functionalities/tail_call_frames/disambiguate_tail_call_seq/main.cpp

lldb/trunk/packages/Python/lldbsuite/test/functionalities/tail_call_frames/inlining_and_tail_calls/

lldb/trunk/packages/Python/lldbsuite/test/functionalities/tail_call_frames/inlining_and_tail_calls/Makefile

lldb/trunk/packages/Python/lldbsuite/test/functionalities/tail_call_frames/inlining_and_tail_calls/TestInliningAndTailCalls.py

lldb/trunk/packages/Python/lldbsuite/test/functionalities/tail_call_frames/inlining_and_tail_calls/main.cpp

lldb/trunk/packages/Python/lldbsuite/test/functionalities/tail_call_frames/sbapi_support/

lldb/trunk/packages/Python/lldbsuite/test/functionalities/tail_call_frames/sbapi_support/Makefile

lldb/trunk/packages/Python/lldbsuite/test/functionalities/tail_call_frames/sbapi_support/TestTailCallFrameSBAPI.py

lldb/trunk/packages/Python/lldbsuite/test/functionalities/tail_call_frames/sbapi_support/main.cpp

lldb/trunk/packages/Python/lldbsuite/test/functionalities/tail_call_frames/thread_step_out_message/

lldb/trunk/packages/Python/lldbsuite/test/functionalities/tail_call_frames/thread_step_out_message/Makefile

lldb/trunk/packages/Python/lldbsuite/test/functionalities/tail_call_frames/thread_step_out_message/TestArtificialFrameStepOutMessage.py

lldb/trunk/packages/Python/lldbsuite/test/functionalities/tail_call_frames/thread_step_out_message/main.cpp

lldb/trunk/packages/Python/lldbsuite/test/functionalities/tail_call_frames/thread_step_out_or_return/

lldb/trunk/packages/Python/lldbsuite/test/functionalities/tail_call_frames/thread_step_out_or_return/Makefile

lldb/trunk/packages/Python/lldbsuite/test/functionalities/tail_call_frames/thread_step_out_or_return/TestSteppingOutWithArtificialFrames.py

lldb/trunk/packages/Python/lldbsuite/test/functionalities/tail_call_frames/thread_step_out_or_return

Re: [Lldb-commits] [PATCH] D53175: [dotest] Make a missing FileCheck binary a warning, not an error

2018-10-11 Thread Vedant Kumar via lldb-commits
It's probably not, it's just that the --filecheck arg is missing. I wrote 
things this way because I was advised that dotest.py shouldn't assume where 
FileCheck is on the filesystem.

vedant

> On Oct 11, 2018, at 3:22 PM, Zachary Turner  wrote:
> 
> Why is FileCheck missing in the first place?
> On Thu, Oct 11, 2018 at 3:13 PM Vedant Kumar via Phabricator 
> mailto:revi...@reviews.llvm.org>> wrote:
> vsk created this revision.
> vsk added reviewers: stella.stamenova, zturner.
> 
> This allows bots which haven't updated to pass in --filecheck to dotest.py to 
> run more tests. FileCheck-dependent tests will continue to fail.
> 
> 
> https://reviews.llvm.org/D53175 
> 
> Files:
>   lldb/packages/Python/lldbsuite/test/dotest.py
> 
> 
> Index: lldb/packages/Python/lldbsuite/test/dotest.py
> ===
> --- lldb/packages/Python/lldbsuite/test/dotest.py
> +++ lldb/packages/Python/lldbsuite/test/dotest.py
> @@ -311,8 +311,8 @@
>  # The CMake build passes in a path to a working FileCheck binary.
>  configuration.filecheck = os.path.abspath(args.filecheck)
>  else:
> -logging.error('No valid FileCheck executable; aborting...')
> -sys.exit(-1)
> +logging.warning('No valid FileCheck executable; some tests may 
> fail...')
> +logging.warning('(Pass in a --filecheck argument to dotest.py)')
> 
>  if args.channels:
>  lldbtest_config.channels = args.channels
> 
> 

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


Re: [Lldb-commits] [PATCH] D53175: [dotest] Make a missing FileCheck binary a warning, not an error

2018-10-11 Thread Vedant Kumar via lldb-commits


> On Oct 11, 2018, at 3:30 PM, Stella Stamenova via Phabricator 
>  wrote:
> 
> stella.stamenova added a comment.
> 
> I spent a bit more time on this and I think I have a better idea of what's 
> happening.
> 
> Vedant added functionality so that we can use FileCheck-style checks inside 
> non-lit LLDB tests. Part of that change was to require a parameter 
> --filecheck to be passed when calling the scripts (such as dotests.py). Also 
> as part of that change, the CMakeFiles now propagate a default location for 
> FileCheck as an input to the scripts, so that if you just run the tests by 
> default using any of the generated outputs (for ninja, or make, or VS), they 
> work correctly
> 
> The bots (at least some bots) don't just use the generated solutions to run 
> the tests. There's some complicated logic in the zorg repo to create the list 
> of parameters that are passed to the bots and they do not include the new 
> --filecheck argument.

I did update zorg. See r342507 and r342559. Ah, is there a Windows-specific 
configuration I missed?


> So it's not individual bots that need to be updated, but the test harness. I 
> haven't really looked at it before, so I'm still trying to understand it - 
> especially how we would get FileCheck to any of the bots that run the tests 
> remotely using lldbserver today.

zorg/jenkins/build.py in https://github.com/llvm-mirror/zorg.git 
 might be relevant.

vedant

> 
> 
> https://reviews.llvm.org/D53175
> 
> 
> 

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


Re: [Lldb-commits] [PATCH] D53175: [dotest] Make a missing FileCheck binary a warning, not an error

2018-10-11 Thread Vedant Kumar via lldb-commits
Does this look reasonable to you? I'm not sure how to test this.

diff --git a/zorg/buildbot/builders/LLDBBuilder.py 
b/zorg/buildbot/builders/LLDBBuilder.py
index 5a1b2e87..62152924 100644
--- a/zorg/buildbot/builders/LLDBBuilder.py
+++ b/zorg/buildbot/builders/LLDBBuilder.py
@@ -270,6 +270,7 @@ def getLLDBTestSteps(f,
 compilerPath = compiler
 for arch in test_archs:
 DOTEST_OPTS=''.join(['--executable ' + bindir + '/lldb ',
+ '--filecheck ' + bindir + '/FileCheck ',
  '-A %s ' % arch,
  '-C %s ' % compilerPath,
  '-s lldb-test-traces-%s-%s ' % (compiler, 
arch),
@@ -819,6 +820,7 @@ def getLLDBxcodebuildFactory(use_cc=None,
   workdir=lldb_srcdir))
 DOTEST_OPTS = ' '.join(['--executable',
 '%(lldb_bindir)s/lldb',
+'%(lldb_bindir)s/FileCheck',
 '--framework', '%(lldb_bindir)s/LLDB.framework',
 '-A', 'x86_64',
 '-C', 'clang',

vedant

> On Oct 11, 2018, at 3:46 PM, Stella Stamenova via Phabricator 
>  wrote:
> 
> stella.stamenova added a comment.
> 
> The failing bots are not windows bots but Linux bots. It looks like you only 
> updated the configurations for xcode.
> 
> I think the file that needs to be updated is:
> 
> zorg\buildbot\builders\LLDBBuilder.py
> 
> 
> https://reviews.llvm.org/D53175
> 
> 
> 

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


Re: [Lldb-commits] [PATCH] D53175: [dotest] Make a missing FileCheck binary a warning, not an error

2018-10-11 Thread Vedant Kumar via lldb-commits
Can we get the Xcode build to generate lldb-dotest, just like the cmake build 
does? That way there's no need to duplicate build system logic into dotest.py. 
It would just live in one place, and we'd all invoke lldb-dotest the same way.

vedant

> On Oct 11, 2018, at 3:53 PM, Jason Molenda via Phabricator 
>  wrote:
> 
> jasonmolenda added a comment.
> 
> (obviously this would only be the behavior if a filecheck path was not 
> specified)
> 
> 
> https://reviews.llvm.org/D53175
> 
> 
> 

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


Re: [Lldb-commits] [PATCH] D53175: [dotest] Make a missing FileCheck binary a warning, not an error

2018-10-12 Thread Vedant Kumar via lldb-commits
All right, Committed r344396, I’ll keep an eye out for failures.

vedant

> On Oct 12, 2018, at 9:58 AM, Stella Stamenova  wrote:
> 
> Those changes look reasonable, but I don't know how to test it either. I 
> would be in favor of checking it in because the buildbots are currently 
> broken and this can't make it worse, right?
> 
> -Original Message-
> From: v...@apple.com   > 
> Sent: Thursday, October 11, 2018 3:56 PM
> To: Stella Stamenova mailto:sti...@microsoft.com>>
> Cc: Zachary Turner mailto:ztur...@google.com>>; 
> lldb-commits@lists.llvm.org ; 
> reviews+d53175+public+09519a8f992e0...@reviews.llvm.org 
> 
> Subject: Re: [PATCH] D53175: [dotest] Make a missing FileCheck binary a 
> warning, not an error
> 
> Does this look reasonable to you? I'm not sure how to test this.
> 
> diff --git a/zorg/buildbot/builders/LLDBBuilder.py 
> b/zorg/buildbot/builders/LLDBBuilder.py
> index 5a1b2e87..62152924 100644
> --- a/zorg/buildbot/builders/LLDBBuilder.py
> +++ b/zorg/buildbot/builders/LLDBBuilder.py
> @@ -270,6 +270,7 @@ def getLLDBTestSteps(f,
> compilerPath = compiler
> for arch in test_archs:
> DOTEST_OPTS=''.join(['--executable ' + bindir + '/lldb ',
> + '--filecheck ' + bindir + '/FileCheck 
> + ',
>  '-A %s ' % arch,
>  '-C %s ' % compilerPath,
>  '-s lldb-test-traces-%s-%s ' % (compiler, 
> arch), @@ -819,6 +820,7 @@ def getLLDBxcodebuildFactory(use_cc=None,
>   workdir=lldb_srcdir))
> DOTEST_OPTS = ' '.join(['--executable',
> '%(lldb_bindir)s/lldb',
> +'%(lldb_bindir)s/FileCheck',
> '--framework', '%(lldb_bindir)s/LLDB.framework',
> '-A', 'x86_64',
> '-C', 'clang',
> 
> vedant
> 
>> On Oct 11, 2018, at 3:46 PM, Stella Stamenova via Phabricator 
>>  wrote:
>> 
>> stella.stamenova added a comment.
>> 
>> The failing bots are not windows bots but Linux bots. It looks like you only 
>> updated the configurations for xcode.
>> 
>> I think the file that needs to be updated is:
>> 
>> zorg\buildbot\builders\LLDBBuilder.py
>> 
>> 
>> https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Frevie 
>> 
>> ws.llvm.org 
>> %2FD53175&data=02%7C01%7CSTILIS%40microsoft.com 
>> %7Cb8693
>> c9edfa5449d97db08d62fccaacd%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0
>> %7C636748953431151967&sdata=rdn7nntFECouzbw%2FPoQISVCGGrjLCqAygk8q
>> l0St%2B5o%3D&reserved=0

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


[Lldb-commits] [lldb] r344401 - [dotest] Make a missing FileCheck binary a warning, not an error

2018-10-12 Thread Vedant Kumar via lldb-commits
Author: vedantk
Date: Fri Oct 12 12:29:59 2018
New Revision: 344401

URL: http://llvm.org/viewvc/llvm-project?rev=344401&view=rev
Log:
[dotest] Make a missing FileCheck binary a warning, not an error

This allows bots which haven't updated to pass in --filecheck to
dotest.py to run more tests. FileCheck-dependent tests will continue to
fail.

Differential Revision: https://reviews.llvm.org/D53175

Modified:
lldb/trunk/packages/Python/lldbsuite/test/configuration.py
lldb/trunk/packages/Python/lldbsuite/test/dotest.py
lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py

Modified: lldb/trunk/packages/Python/lldbsuite/test/configuration.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/configuration.py?rev=344401&r1=344400&r2=344401&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/configuration.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/configuration.py Fri Oct 12 
12:29:59 2018
@@ -188,5 +188,5 @@ def get_filecheck_path():
 """
 Get the path to the FileCheck testing tool.
 """
-assert os.path.lexists(filecheck)
-return filecheck
+if os.path.lexists(filecheck):
+return filecheck

Modified: lldb/trunk/packages/Python/lldbsuite/test/dotest.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/dotest.py?rev=344401&r1=344400&r2=344401&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/dotest.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/dotest.py Fri Oct 12 12:29:59 2018
@@ -308,11 +308,15 @@ def parseOptionsAndInitTestdirs():
   'xcrun -find -toolchain default dsymutil')
 
 if args.filecheck:
-# The CMake build passes in a path to a working FileCheck binary.
+# The lldb-dotest script produced by the CMake build passes in a path
+# to a working FileCheck binary. So does one specific Xcode project
+# target. However, when invoking dotest.py directly, a valid 
--filecheck
+# option needs to be given.
 configuration.filecheck = os.path.abspath(args.filecheck)
-else:
-logging.error('No valid FileCheck executable; aborting...')
-sys.exit(-1)
+
+if not configuration.get_filecheck_path():
+logging.warning('No valid FileCheck executable; some tests may 
fail...')
+logging.warning('(Double-check the --filecheck argument to dotest.py)')
 
 if args.channels:
 lldbtest_config.channels = args.channels

Modified: lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py?rev=344401&r1=344400&r2=344401&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py Fri Oct 12 12:29:59 
2018
@@ -2237,6 +2237,8 @@ class TestBase(Base):
 
 # Run FileCheck.
 filecheck_bin = configuration.get_filecheck_path()
+if not filecheck_bin:
+self.assertTrue(False, "No valid FileCheck executable specified")
 filecheck_args = [filecheck_bin, check_file_abs]
 if filecheck_options:
 filecheck_args.append(filecheck_options)


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


Re: [Lldb-commits] [PATCH] D53175: [dotest] Make a missing FileCheck binary a warning, not an error

2018-10-12 Thread Vedant Kumar via lldb-commits
Ah gotcha. For the public Darwin bots, we needed to specifically trigger a 
Jenkins job to distribute Zorg updates to all our builders. This can be a bit 
of a manual process, because you need to kill the jobs on the builders’ queues 
to make sure they run the Zorg_Distribute job asap.

I’m not sure whether the Linux CI has a similar mechanism.

vedant

> On Oct 12, 2018, at 12:31 PM, Stella Stamenova  wrote:
> 
> Thanks, I’ve been monitoring the bots also and it looks like they haven’t 
> picked up the zorg change yet. I don’t know if that’s supposed to just happen 
> or if there’s something that needs to be done or if there’s a schedule for 
> when they update.
>  
> Thanks,
> -Stella
>  
> From: v...@apple.com   > 
> Sent: Friday, October 12, 2018 11:33 AM
> To: Stella Stamenova mailto:sti...@microsoft.com>>
> Cc: Zachary Turner mailto:ztur...@google.com>>; 
> lldb-commits@lists.llvm.org ; 
> reviews+d53175+public+09519a8f992e0...@reviews.llvm.org 
> 
> Subject: Re: [PATCH] D53175: [dotest] Make a missing FileCheck binary a 
> warning, not an error
>  
> All right, Committed r344396, I’ll keep an eye out for failures.
>  
> vedant
> 
> 
> On Oct 12, 2018, at 9:58 AM, Stella Stamenova  > wrote:
>  
> Those changes look reasonable, but I don't know how to test it either. I 
> would be in favor of checking it in because the buildbots are currently 
> broken and this can't make it worse, right?
> 
> -Original Message-
> From: v...@apple.com   > 
> Sent: Thursday, October 11, 2018 3:56 PM
> To: Stella Stamenova mailto:sti...@microsoft.com>>
> Cc: Zachary Turner mailto:ztur...@google.com>>; 
> lldb-commits@lists.llvm.org ; 
> reviews+d53175+public+09519a8f992e0...@reviews.llvm.org 
> 
> Subject: Re: [PATCH] D53175: [dotest] Make a missing FileCheck binary a 
> warning, not an error
> 
> Does this look reasonable to you? I'm not sure how to test this.
> 
> diff --git a/zorg/buildbot/builders/LLDBBuilder.py 
> b/zorg/buildbot/builders/LLDBBuilder.py
> index 5a1b2e87..62152924 100644 
> --- a/zorg/buildbot/builders/LLDBBuilder.py
> +++ b/zorg/buildbot/builders/LLDBBuilder.py
> @@ -270,6 +270,7 @@ def getLLDBTestSteps(f,
> compilerPath = compiler
> for arch in test_archs:
> DOTEST_OPTS=''.join(['--executable ' + bindir + '/lldb ',
> + '--filecheck ' + bindir + '/FileCheck 
> + ',
>  '-A %s ' % arch,
>  '-C %s ' % compilerPath,
>  '-s lldb-test-traces-%s-%s ' % (compiler, 
> arch), @@ -819,6 +820,7 @@ def getLLDBxcodebuildFactory(use_cc=None,
>   workdir=lldb_srcdir))
> DOTEST_OPTS = ' '.join(['--executable',
> '%(lldb_bindir)s/lldb',
> +'%(lldb_bindir)s/FileCheck',
> '--framework', '%(lldb_bindir)s/LLDB.framework',
> '-A', 'x86_64',
> '-C', 'clang',
> 
> vedant
> 
> 
> On Oct 11, 2018, at 3:46 PM, Stella Stamenova via Phabricator 
> mailto:revi...@reviews.llvm.org>> wrote:
> 
> stella.stamenova added a comment.
> 
> The failing bots are not windows bots but Linux bots. It looks like you only 
> updated the configurations for xcode.
> 
> I think the file that needs to be updated is:
> 
> zorg\buildbot\builders\LLDBBuilder.py
> 
> 
> https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Frevie 
> 
> ws.llvm.org 
> %2FD53175&data=02%7C01%7CSTILIS%40microsoft.com
>  
> %7Cb8693
> c9edfa5449d97db08d62fccaacd%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0
> %7C636748953431151967&sdata=rdn7nntFECouzbw%2FPoQISVCGGrjLCqAygk8q
> l0St%2B5o%3D&reserved=0

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


Re: [Lldb-commits] [PATCH] D53175: [dotest] Make a missing FileCheck binary a warning, not an error

2018-10-12 Thread Vedant Kumar via lldb-commits


> On Oct 12, 2018, at 12:52 PM, Stella Stamenova via Phabricator 
>  wrote:
> 
> stella.stamenova added a comment.
> 
> The bots are now failing because lexists doesn't handle NoneType correctly:
> 
>File 
> "/lldb-buildbot/lldbSlave/buildWorkingDir/llvm/tools/lldb/packages/Python/lldbsuite/test/configuration.py",
>  line 191, in get_filecheck_path
>  if os.path.lexists(filecheck):
>File "/lldb-buildbot/virenv/lib/python2.7/posixpath.py", line 152, in 
> lexists
>  os.lstat(path)
>  TypeError: coercing to Unicode: need string or buffer, NoneType found
> 
> I think get_filecheck_path should check if filecheck is set first before 
> calling lexists:
> 
>  if filecheck and os.path.lexists(filecheck):
>  return filecheck

That sounds right. Would you mind committing the fix?

vedant

> 
> 
> Repository:
>  rL LLVM
> 
> https://reviews.llvm.org/D53175
> 
> 
> 

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


Re: [Lldb-commits] [PATCH] D50478: Add support for artificial tail call frames

2018-10-15 Thread Vedant Kumar via lldb-commits


> On Oct 15, 2018, at 3:47 PM, Stella Stamenova via Phabricator 
>  wrote:
> 
> stella.stamenova added a comment.
> 
> In https://reviews.llvm.org/D50478#1262717, @vsk wrote:
> 
>> In https://reviews.llvm.org/D50478#1262710, @stella.stamenova wrote:
>> 
>>> Unfortunately, the bots are broken because of the FileCheck issue, so I 
>>> can't confirm with them, but I see a number of these tests fail in our 
>>> local testing. Some fail on both Windows and Linux and some just fail on 
>>> Linux. Here are the failing tests:
>>> 
>>>  Linux:
>>>  lldb-Suite :: 
>>> functionalities/tail_call_frames/disambiguate_call_site/TestDisambiguateCallSite.py
>>>  lldb-Suite :: 
>>> functionalities/tail_call_frames/disambiguate_paths_to_common_sink/TestDisambiguatePathsToCommonSink.py
>>>  lldb-Suite :: 
>>> functionalities/tail_call_frames/disambiguate_tail_call_seq/TestDisambiguateTailCallSeq.py
>>>  lldb-Suite :: 
>>> functionalities/tail_call_frames/inlining_and_tail_calls/TestInliningAndTailCalls.py
>>>  lldb-Suite :: 
>>> functionalities/tail_call_frames/sbapi_support/TestTailCallFrameSBAPI.py
>>>  lldb-Suite :: 
>>> functionalities/tail_call_frames/thread_step_out_message/TestArtificialFrameStepOutMessage.py
>>>  lldb-Suite :: 
>>> functionalities/tail_call_frames/unambiguous_sequence/TestUnambiguousTailCalls.py
>>> 
>>>  Windows:
>>>  lldb-Suite :: 
>>> functionalities/tail_call_frames/sbapi_support/TestTailCallFrameSBAPI.py
>>>  lldb-Suite :: 
>>> functionalities/tail_call_frames/thread_step_out_or_return/TestSteppingOutWithArtificialFrames.py
>>> 
>>> 
>>> Let me know what you need to investigate.
>> 
>> 
>> Strange, I didn't get any bot failure notifications in the days after this 
>> landed. Could you share the output from the failing tests?
> 
> 
> All the failures on Windows are happening when validating the function name. 
> For example:
> 
>  ==
> 
>  FAIL: test_tail_call_frame_sbapi 
> (TestTailCallFrameSBAPI.TestTailCallFrameSBAPI)
> 
>  --
> 
>  Traceback (most recent call last):
> 
>File 
> "E:\_work\55\s\llvm\tools\lldb\packages\Python\lldbsuite\test\functionalities\tail_call_frames\sbapi_support\TestTailCallFrameSBAPI.py",
>  line 19, in test_tail_call_frame_sbapi
> 
>  self.do_test()
> 
>File 
> "E:\_work\55\s\llvm\tools\lldb\packages\Python\lldbsuite\test\functionalities\tail_call_frames\sbapi_support\TestTailCallFrameSBAPI.py",
>  line 64, in do_test
> 
>  self.assertTrue(frame.GetDisplayFunctionName() == name)

It could be that the display name of a function is formatted differently on 
Windows. Do you have an easy way of determining what 
frame.GetDisplayFunctionName() is?


> 
>  AssertionError: False is not True
> 
>  Config=x86_64-E:\_work\55\b\LLVMBuild\Release\bin\clang.exe
> 
>  --
> 
> There are several different failures on Linux. Here's the first one:
> 
>  FAIL: LLDB (/vstsdrive/_work/38/b/LLVMBuild/bin/clang-8-x86_64) :: 
> test_dwarf (lldbsuite.test.lldbtest.TestDisambiguateCallSite)
> 
>  --- FileCheck trace (code=1) ---
>  /vstsdrive/_work/38/b/LLVMBuild/bin/FileCheck 
> /vstsdrive/_work/38/s/llvm/tools/lldb/packages/Python/lldbsuite/test/functionalities/tail_call_frames/disambiguate_call_site/main.cpp
>  -implicit-check-not=artificial
> 
>  FileCheck input:
>  * thread #1, name = 'a.out', stop reason = breakpoint 1.1
>* frame #0: 0x00400580 a.out`sink() at main.cpp:13:4 [opt]
>  frame #1: 0x004005b8 a.out`main(argc=1, (null)=) at 
> main.cpp:28:3 [opt]
>  frame #2: 0x7f980aff7830 libc.so.6`__libc_start_main + 240
>  frame #3: 0x004004a9 a.out`_start + 41

It looks like we're not generating tail call frames on Linux at all. It would 
help to have logs from "log enable -f /tmp/linux-stepping.log lldb step".

I'm headed out of the office now, but If you need to disable the tests on 
Windows/Linux , the fastest way to do that would be to add a platform check to 
skipUnlessHasCallSiteInfo in decorators.py.

vedant


> 
> 
>  FileCheck output:
> 
>  
> /vstsdrive/_work/38/s/llvm/tools/lldb/packages/Python/lldbsuite/test/functionalities/tail_call_frames/disambiguate_call_site/main.cpp:15:17:
>  error: CHECK-NEXT: expected string not found in input
>   // CHECK-NEXT: func2{{.*}} [opt] [artificial]
>  ^
>  :3:2: note: scanning from here
>   frame #1: 0x004005b8 a.out`main(argc=1, (null)=) at 
> main.cpp:28:3 [opt]
>   ^
>  :3:80: note: possible intended match here
>   frame #1: 0x004005b8 a.out`main(argc=1, (null)=) at 
> main.cpp:28:3 [opt]
>   
>  ^
> 
> Let me know if you need more logs.
> 
> 
> Repository:
>  rLLDB LLDB
> 
> https://reviews.llvm.org/D50478
> 
> 
> 

___
lldb-com

[Lldb-commits] [lldb] r344581 - Use assertEqual to improve test failure logging

2018-10-15 Thread Vedant Kumar via lldb-commits
Author: vedantk
Date: Mon Oct 15 20:31:33 2018
New Revision: 344581

URL: http://llvm.org/viewvc/llvm-project?rev=344581&view=rev
Log:
Use assertEqual to improve test failure logging

Some tests in test/functionalities/tail_call_frames are failing on
non-Darwin platforms. Use assertEqual to improve logging on failure.

Modified:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/tail_call_frames/sbapi_support/TestTailCallFrameSBAPI.py

lldb/trunk/packages/Python/lldbsuite/test/functionalities/tail_call_frames/thread_step_out_or_return/TestSteppingOutWithArtificialFrames.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/tail_call_frames/sbapi_support/TestTailCallFrameSBAPI.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/tail_call_frames/sbapi_support/TestTailCallFrameSBAPI.py?rev=344581&r1=344580&r2=344581&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/tail_call_frames/sbapi_support/TestTailCallFrameSBAPI.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/tail_call_frames/sbapi_support/TestTailCallFrameSBAPI.py
 Mon Oct 15 20:31:33 2018
@@ -43,11 +43,11 @@ class TestTailCallFrameSBAPI(TestBase):
 # Did we hit our breakpoint?
 threads = lldbutil.get_threads_stopped_at_breakpoint(process,
 breakpoint)
-self.assertTrue(
-len(threads) == 1,
+self.assertEqual(
+len(threads), 1,
 "There should be a thread stopped at our breakpoint")
 
-self.assertTrue(breakpoint.GetHitCount() == 1)
+self.assertEqual(breakpoint.GetHitCount(), 1)
 
 thread = threads[0]
 
@@ -61,5 +61,5 @@ class TestTailCallFrameSBAPI(TestBase):
 artificiality = [False, True, False, True, False]
 for idx, (name, is_artificial) in enumerate(zip(names, artificiality)):
 frame = thread.GetFrameAtIndex(idx)
-self.assertTrue(frame.GetDisplayFunctionName() == name)
-self.assertTrue(frame.IsArtificial() == is_artificial)
+self.assertEqual(frame.GetDisplayFunctionName(), name)
+self.assertEqual(frame.IsArtificial(), is_artificial)

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/tail_call_frames/thread_step_out_or_return/TestSteppingOutWithArtificialFrames.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/tail_call_frames/thread_step_out_or_return/TestSteppingOutWithArtificialFrames.py?rev=344581&r1=344580&r2=344581&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/tail_call_frames/thread_step_out_or_return/TestSteppingOutWithArtificialFrames.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/tail_call_frames/thread_step_out_or_return/TestSteppingOutWithArtificialFrames.py
 Mon Oct 15 20:31:33 2018
@@ -35,11 +35,11 @@ class TestArtificialFrameThreadStepOut1(
 # Did we hit our breakpoint?
 threads = lldbutil.get_threads_stopped_at_breakpoint(process,
 breakpoint)
-self.assertTrue(
-len(threads) == 1,
+self.assertEqual(
+len(threads), 1,
 "There should be a thread stopped at our breakpoint")
 
-self.assertTrue(breakpoint.GetHitCount() == 1)
+self.assertEqual(breakpoint.GetHitCount(), 1)
 
 thread = threads[0]
 
@@ -59,13 +59,13 @@ class TestArtificialFrameThreadStepOut1(
 # frame #2, because we behave as-if artificial frames were not present.
 thread.StepOut()
 frame2 = thread.GetSelectedFrame()
-self.assertTrue(frame2.GetDisplayFunctionName() == "func2()")
+self.assertEqual(frame2.GetDisplayFunctionName(), "func2()")
 self.assertFalse(frame2.IsArtificial())
 
 # Ditto: stepping out of frame #2 should move to frame #4.
 thread.StepOut()
 frame4 = thread.GetSelectedFrame()
-self.assertTrue(frame4.GetDisplayFunctionName() == "main")
+self.assertEqual(frame4.GetDisplayFunctionName(), "main")
 self.assertFalse(frame2.IsArtificial())
 
 def test_return_past_artificial_frame(self):
@@ -78,13 +78,13 @@ class TestArtificialFrameThreadStepOut1(
 # to frame #2.
 thread.ReturnFromFrame(thread.GetSelectedFrame(), value)
 frame2 = thread.GetSelectedFrame()
-self.assertTrue(frame2.GetDisplayFunctionName() == "func2()")
+self.assertEqual(frame2.GetDisplayFunctionName(), "func2()")
 self.assertFalse(frame2.IsArtificial())
 
 # Ditto: stepping out of frame #2 should move to frame #4.
 thread.ReturnFromFrame(thread.GetSelectedFrame(), value)
 frame4 = thread.GetSelectedFrame()
-self.assertTrue

Re: [Lldb-commits] [PATCH] D50478: Add support for artificial tail call frames

2018-10-15 Thread Vedant Kumar via lldb-commits


> On Oct 15, 2018, at 4:46 PM, Frédéric Riss  wrote:
> 
> 
> 
>> On Oct 15, 2018, at 4:40 PM, Vedant Kumar > > wrote:
>> 
>> 
>> 
>>> On Oct 15, 2018, at 3:47 PM, Stella Stamenova via Phabricator 
>>> mailto:revi...@reviews.llvm.org>> wrote:
>>> 
>>> stella.stamenova added a comment.
>>> 
>>> In https://reviews.llvm.org/D50478#1262717 
>>> , @vsk wrote:
>>> 
 In https://reviews.llvm.org/D50478#1262710 
 , @stella.stamenova wrote:
 
> Unfortunately, the bots are broken because of the FileCheck issue, so I 
> can't confirm with them, but I see a number of these tests fail in our 
> local testing. Some fail on both Windows and Linux and some just fail on 
> Linux. Here are the failing tests:
> 
> Linux:
> lldb-Suite :: 
> functionalities/tail_call_frames/disambiguate_call_site/TestDisambiguateCallSite.py
> lldb-Suite :: 
> functionalities/tail_call_frames/disambiguate_paths_to_common_sink/TestDisambiguatePathsToCommonSink.py
> lldb-Suite :: 
> functionalities/tail_call_frames/disambiguate_tail_call_seq/TestDisambiguateTailCallSeq.py
> lldb-Suite :: 
> functionalities/tail_call_frames/inlining_and_tail_calls/TestInliningAndTailCalls.py
> lldb-Suite :: 
> functionalities/tail_call_frames/sbapi_support/TestTailCallFrameSBAPI.py
> lldb-Suite :: 
> functionalities/tail_call_frames/thread_step_out_message/TestArtificialFrameStepOutMessage.py
> lldb-Suite :: 
> functionalities/tail_call_frames/unambiguous_sequence/TestUnambiguousTailCalls.py
> 
> Windows:
> lldb-Suite :: 
> functionalities/tail_call_frames/sbapi_support/TestTailCallFrameSBAPI.py
> lldb-Suite :: 
> functionalities/tail_call_frames/thread_step_out_or_return/TestSteppingOutWithArtificialFrames.py
> 
> 
> Let me know what you need to investigate.
 
 
 Strange, I didn't get any bot failure notifications in the days after this 
 landed. Could you share the output from the failing tests?
>>> 
>>> 
>>> All the failures on Windows are happening when validating the function 
>>> name. For example:
>>> 
>>> ==
>>> 
>>> FAIL: test_tail_call_frame_sbapi 
>>> (TestTailCallFrameSBAPI.TestTailCallFrameSBAPI)
>>> 
>>> --
>>> 
>>> Traceback (most recent call last):
>>> 
>>>   File 
>>> "E:\_work\55\s\llvm\tools\lldb\packages\Python\lldbsuite\test\functionalities\tail_call_frames\sbapi_support\TestTailCallFrameSBAPI.py",
>>>  line 19, in test_tail_call_frame_sbapi
>>> 
>>> self.do_test()
>>> 
>>>   File 
>>> "E:\_work\55\s\llvm\tools\lldb\packages\Python\lldbsuite\test\functionalities\tail_call_frames\sbapi_support\TestTailCallFrameSBAPI.py",
>>>  line 64, in do_test
>>> 
>>> self.assertTrue(frame.GetDisplayFunctionName() == name)
>> 
>> It could be that the display name of a function is formatted differently on 
>> Windows. Do you have an easy way of determining what 
>> frame.GetDisplayFunctionName() is?
> 
> If you use assertEqual(a,b) instead of assertTrue, it will print out the 
> values and make it easier to debug.

Thanks, done in r344581.

vedant

> 
> Fred 
> 
>> 
>>> 
>>> AssertionError: False is not True
>>> 
>>> Config=x86_64-E:\_work\55\b\LLVMBuild\Release\bin\clang.exe
>>> 
>>> --
>>> 
>>> There are several different failures on Linux. Here's the first one:
>>> 
>>> FAIL: LLDB (/vstsdrive/_work/38/b/LLVMBuild/bin/clang-8-x86_64) :: 
>>> test_dwarf (lldbsuite.test.lldbtest.TestDisambiguateCallSite)
>>> 
>>> --- FileCheck trace (code=1) ---
>>> /vstsdrive/_work/38/b/LLVMBuild/bin/FileCheck 
>>> /vstsdrive/_work/38/s/llvm/tools/lldb/packages/Python/lldbsuite/test/functionalities/tail_call_frames/disambiguate_call_site/main.cpp
>>>  -implicit-check-not=artificial
>>> 
>>> FileCheck input:
>>> * thread #1, name = 'a.out', stop reason = breakpoint 1.1
>>>   * frame #0: 0x00400580 a.out`sink() at main.cpp:13:4 [opt]
>>> frame #1: 0x004005b8 a.out`main(argc=1, (null)=) 
>>> at main.cpp:28:3 [opt]
>>> frame #2: 0x7f980aff7830 libc.so.6`__libc_start_main + 240
>>> frame #3: 0x004004a9 a.out`_start + 41
>> 
>> It looks like we're not generating tail call frames on Linux at all. It 
>> would help to have logs from "log enable -f /tmp/linux-stepping.log lldb 
>> step".
>> 
>> I'm headed out of the office now, but If you need to disable the tests on 
>> Windows/Linux , the fastest way to do that would be to add a platform check 
>> to skipUnlessHasCallSiteInfo in decorators.py.
>> 
>> vedant
>> 
>> 
>>> 
>>> 
>>> FileCheck output:
>>> 
>>> /vstsdrive/_work/38/s/llvm/tools/lldb/packages/Python/lldbsuite/test/functionalities/tail_call_frames/disambiguate_call_site/main.cpp:15:

[Lldb-commits] [lldb] r344634 - Use a relaxed substring check for function names in a test

2018-10-16 Thread Vedant Kumar via lldb-commits
Author: vedantk
Date: Tue Oct 16 11:13:42 2018
New Revision: 344634

URL: http://llvm.org/viewvc/llvm-project?rev=344634&view=rev
Log:
Use a relaxed substring check for function names in a test

The TestTailCallFrameSBAPI.py test checks that function names in a
backtrace are equal to an expected value.

Use a relaxed substring check because function dislpay names are
platform-dependent. E.g we see "void sink(void)" on Windows, but "sink()" on
Darwin. This seems like a bug -- just work around it for now.

Modified:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/tail_call_frames/sbapi_support/TestTailCallFrameSBAPI.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/tail_call_frames/sbapi_support/TestTailCallFrameSBAPI.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/tail_call_frames/sbapi_support/TestTailCallFrameSBAPI.py?rev=344634&r1=344633&r2=344634&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/tail_call_frames/sbapi_support/TestTailCallFrameSBAPI.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/tail_call_frames/sbapi_support/TestTailCallFrameSBAPI.py
 Tue Oct 16 11:13:42 2018
@@ -57,9 +57,14 @@ class TestTailCallFrameSBAPI(TestBase):
 #   frame #2: ... a.out`func2() at main.cpp:18:62 [opt]
 #   frame #3: ... a.out`func1() at main.cpp:18:85 [opt] [artificial]
 #   frame #4: ... a.out`main at main.cpp:23:3 [opt]
-names = ["sink()", "func3()", "func2()", "func1()", "main"]
+names = ["sink", "func3", "func2", "func1", "main"]
 artificiality = [False, True, False, True, False]
 for idx, (name, is_artificial) in enumerate(zip(names, artificiality)):
 frame = thread.GetFrameAtIndex(idx)
-self.assertEqual(frame.GetDisplayFunctionName(), name)
+
+# Use a relaxed substring check because function dislpay names are
+# platform-dependent. E.g we see "void sink(void)" on Windows, but
+# "sink()" on Darwin. This seems like a bug -- just work around it
+# for now.
+self.assertTrue(name in frame.GetDisplayFunctionName())
 self.assertEqual(frame.IsArtificial(), is_artificial)


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


Re: [Lldb-commits] [PATCH] D50478: Add support for artificial tail call frames

2018-10-16 Thread Vedant Kumar via lldb-commits


> On Oct 16, 2018, at 10:59 AM, Stella Stamenova  wrote:
> 
> The windows error is because the names are different, as you expected:
>  
> AssertionError: 'void sink(void)' != 'sink()'
>  
> You can probably update the test to look for a different name on Windows 
> (though if I recall correctly, different versions of the DIA sdk provide 
> different detail on the names, so that might not be robust either) or look 
> for a substring in the full name.

I used a substring check in r344634.


> I’ll look into the Linux error as well and let you know what I find.

Thank you very much! I really appreciate your help and patience with this.

The "step" logging channel should provide detailed information about what goes 
wrong when parsing the DWARF for call site information and creating artificial 
frames.

vedant

>  
>  
> From: v...@apple.com  
> Sent: Monday, October 15, 2018 8:34 PM
> To: Frédéric Riss 
> Cc: reviews+d50478+public+7e86b794a0909...@reviews.llvm.org; Adrian Prantl 
> ; paul.robin...@sony.com; jdevliegh...@apple.com; Jim 
> Ingham ; ztur...@google.com; Stella Stamenova 
> ; abidh@gmail.com; teempe...@gmail.com; 
> sgraen...@apple.com; mgr...@codeaurora.org; dblai...@gmail.com; 
> lldb-commits@lists.llvm.org
> Subject: Re: [PATCH] D50478: Add support for artificial tail call frames
>  
>  
> 
> 
> On Oct 15, 2018, at 4:46 PM, Frédéric Riss  > wrote:
>  
> 
> 
> 
> On Oct 15, 2018, at 4:40 PM, Vedant Kumar  > wrote:
>  
> 
> 
> 
> On Oct 15, 2018, at 3:47 PM, Stella Stamenova via Phabricator 
> mailto:revi...@reviews.llvm.org>> wrote:
> 
> stella.stamenova added a comment.
> 
> In https://reviews.llvm.org/D50478#1262717 
> ,
>  @vsk wrote:
> 
> 
> In https://reviews.llvm.org/D50478#1262710 
> ,
>  @stella.stamenova wrote:
> 
> 
> Unfortunately, the bots are broken because of the FileCheck issue, so I can't 
> confirm with them, but I see a number of these tests fail in our local 
> testing. Some fail on both Windows and Linux and some just fail on Linux. 
> Here are the failing tests:
> 
> Linux:
> lldb-Suite :: 
> functionalities/tail_call_frames/disambiguate_call_site/TestDisambiguateCallSite.py
> lldb-Suite :: 
> functionalities/tail_call_frames/disambiguate_paths_to_common_sink/TestDisambiguatePathsToCommonSink.py
> lldb-Suite :: 
> functionalities/tail_call_frames/disambiguate_tail_call_seq/TestDisambiguateTailCallSeq.py
> lldb-Suite :: 
> functionalities/tail_call_frames/inlining_and_tail_calls/TestInliningAndTailCalls.py
> lldb-Suite :: 
> functionalities/tail_call_frames/sbapi_support/TestTailCallFrameSBAPI.py
> lldb-Suite :: 
> functionalities/tail_call_frames/thread_step_out_message/TestArtificialFrameStepOutMessage.py
> lldb-Suite :: 
> functionalities/tail_call_frames/unambiguous_sequence/TestUnambiguousTailCalls.py
> 
> Windows:
> lldb-Suite :: 
> functionalities/tail_call_frames/sbapi_support/TestTailCallFrameSBAPI.py
> lldb-Suite :: 
> functionalities/tail_call_frames/thread_step_out_or_return/TestSteppingOutWithArtificialFrames.py
> 
> 
> Let me know what you need to investigate.
> 
> 
> Strange, I didn't get any bot failure notifications in the days after this 
> landed. Could you share the output from the failing tests?
> 
> 
> All the failures on Windows are happening when validating the function name. 
> For example:
> 
> ==
> 
> FAIL: test_tail_call_frame_sbapi 
> (TestTailCallFrameSBAPI.TestTailCallFrameSBAPI)
> 
> --
> 
> Traceback (most recent call last):
> 
>   File 
> "E:\_work\55\s\llvm\tools\lldb\packages\Python\lldbsuite\test\functionalities\tail_call_frames\sbapi_support\TestTailCallFrameSBAPI.py",
>  line 19, in test_tail_call_frame_sbapi
> 
> self.do_test()
> 
>   File 
> "E:\_work\55\s\llvm\tools\lldb\packages\Python\lldbsuite\test\functionalities\tail_call_frames\sbapi_support\TestTailCallFrameSBAPI.py",
>  line 64, in do_test
> 
> self.assertTrue(frame.GetDisplayFunctionName() == name)
> 
> It could be that the display name of a function is formatted differently on 
> Windows. Do you have an easy way of determining what 
> frame.GetDisplayFunctionName() is?
>  
> If you use assertEqual(a,b) instead of assertTrue, it will print out the 
> values and make it easier to 

Re: [Lldb-commits] [PATCH] D50478: Add support for artificial tail call frames

2018-10-19 Thread Vedant Kumar via lldb-commits
Hi Stella,

The logs are really helpful, thanks. This part is unexpected:

python   Finding frames between main and sink(), retn-pc=0x4005b8
python   GetCallEdges: Attempting to parse call site info for main
python   CollectCallEdges: Found call site info in main
python   CollectCallEdges: Found call origin: _Z5func2v (retn-PC: 
0x4005b8)
python   CollectCallEdges: Found call origin: _Z5func1v (retn-PC: 
0x4005c2)
python   FindInterveningFrames: found call with retn-PC = 0x800a38
python   FindInterveningFrames: found call with retn-PC = 0x800a42

LLDB finds a call from main() with return PC = 0x4005b8. It’s able to parse the 
call site info within main’s debug info. It finds a call from main() into func2 
with that exact return PC. But, the address calculation in 
CallEdge::GetReturnPCAddress adds the wrong slide to this return PC, giving 
0x800a38. This doesn’t match the PC value in the register state, so lldb can’t 
create a tail call frame.

I think Address::GetLoadAddress is the right API to use, but it’s clearly not 
achieving the right result here. I’ll experiment with replacing return PC 
addresses with function-local offsets to the instruction after a call. The idea 
would be to simply add this offset to the base address of the function, instead 
of doing a load address calculation.

vedant

> On Oct 18, 2018, at 9:47 AM, Stella Stamenova  wrote:
> 
> Hey Vedant,
>  
> I’ve attached the logs from Linux.
>  
> Most of the tests now pass on Windows with the exception of 
> TestSteppingOutWithArtificialFrames and TestTailCallFrameSBAPI. Both of these 
> attempt to get a specific frame by calling GetFrameAtIndex which only works 
> partially on Windows right now. I think we should mark these as XFAIL on 
> Windows and link them to: https://bugs.llvm.org/show_bug.cgi?id=26265 
> .
>  
> Thanks,
> -Stella
>  
> From: v...@apple.com   > 
> Sent: Tuesday, October 16, 2018 11:17 AM
> To: Stella Stamenova mailto:sti...@microsoft.com>>
> Cc: Frédéric Riss mailto:fr...@apple.com>>; 
> reviews+d50478+public+7e86b794a0909...@reviews.llvm.org 
> ; Adrian 
> Prantl mailto:apra...@apple.com>>; paul.robin...@sony.com 
> ; jdevliegh...@apple.com 
> ; Jim Ingham  >; ztur...@google.com ; 
> abidh@gmail.com ; teempe...@gmail.com 
> ; sgraen...@apple.com 
> ; mgr...@codeaurora.org 
> ; dblai...@gmail.com 
> ; lldb-commits@lists.llvm.org 
> 
> Subject: Re: [PATCH] D50478: Add support for artificial tail call frames
>  
>  
> 
> 
> On Oct 16, 2018, at 10:59 AM, Stella Stamenova  > wrote:
>  
> The windows error is because the names are different, as you expected:
> AssertionError: 'void sink(void)' != 'sink()'
> You can probably update the test to look for a different name on Windows 
> (though if I recall correctly, different versions of the DIA sdk provide 
> different detail on the names, so that might not be robust either) or look 
> for a substring in the full name.
>  
> I used a substring check in r344634.
>  
> 
> 
> I’ll look into the Linux error as well and let you know what I find.
>  
> Thank you very much! I really appreciate your help and patience with this.
>  
> The "step" logging channel should provide detailed information about what 
> goes wrong when parsing the DWARF for call site information and creating 
> artificial frames.
>  
> vedant
> 
> 
> From: v...@apple.com   > 
> Sent: Monday, October 15, 2018 8:34 PM
> To: Frédéric Riss mailto:fr...@apple.com>>
> Cc: reviews+d50478+public+7e86b794a0909...@reviews.llvm.org 
> ; Adrian 
> Prantl mailto:apra...@apple.com>>; paul.robin...@sony.com 
> ; jdevliegh...@apple.com 
> ; Jim Ingham  >; ztur...@google.com ; 
> Stella Stamenova mailto:sti...@microsoft.com>>; 
> abidh@gmail.com ; teempe...@gmail.com 
> ; sgraen...@apple.com 
> ; mgr...@codeaurora.org 
> ; dblai...@gmail.com 
> ; lldb-commits@lists.llvm.org 
> 
> Subject: Re: [PATCH] D50478: Add support for artificial tail call frames
> 
> 
> 
> On Oct 15, 2018, at 4:46 PM, Frédéric Riss  > wrote:
> 
> 
> 
> 
> On Oct 15, 2018, at 4:40 PM, Vedant Kumar  

Re: [Lldb-commits] [PATCH] D50478: Add support for artificial tail call frames

2018-10-19 Thread Vedant Kumar via lldb-commits


> On Oct 19, 2018, at 5:37 PM, Vedant Kumar  wrote:
> 
> Hi Stella,
> 
> The logs are really helpful, thanks. This part is unexpected:
> 
> python   Finding frames between main and sink(), retn-pc=0x4005b8
> python   GetCallEdges: Attempting to parse call site info for main
> python   CollectCallEdges: Found call site info in main
> python   CollectCallEdges: Found call origin: _Z5func2v (retn-PC: 
> 0x4005b8)
> python   CollectCallEdges: Found call origin: _Z5func1v (retn-PC: 
> 0x4005c2)
> python   FindInterveningFrames: found call with retn-PC = 0x800a38
> python   FindInterveningFrames: found call with retn-PC = 0x800a42
> 
> LLDB finds a call from main() with return PC = 0x4005b8. It’s able to parse 
> the call site info within main’s debug info. It finds a call from main() into 
> func2 with that exact return PC. But, the address calculation in 
> CallEdge::GetReturnPCAddress adds the wrong slide to this return PC, giving 
> 0x800a38. This doesn’t match the PC value in the register state, so lldb 
> can’t create a tail call frame.
> 
> I think Address::GetLoadAddress is the right API to use, but it’s clearly not 
> achieving the right result here. I’ll experiment with replacing return PC 
> addresses with function-local offsets to the instruction after a call. The 
> idea would be to simply add this offset to the base address of the function, 
> instead of doing a load address calculation.

FWIW this works just fine on Darwin, but I haven't verified that it works on 
Linux. Here's an illustrative patch: https://reviews.llvm.org/D53469 


vedant

> 
> vedant
> 
>> On Oct 18, 2018, at 9:47 AM, Stella Stamenova > > wrote:
>> 
>> Hey Vedant,
>>  
>> I’ve attached the logs from Linux.
>>  
>> Most of the tests now pass on Windows with the exception of 
>> TestSteppingOutWithArtificialFrames and TestTailCallFrameSBAPI. Both of 
>> these attempt to get a specific frame by calling GetFrameAtIndex which only 
>> works partially on Windows right now. I think we should mark these as XFAIL 
>> on Windows and link them to: https://bugs.llvm.org/show_bug.cgi?id=26265 
>> .
>>  
>> Thanks,
>> -Stella
>>  
>> From: v...@apple.com  > > 
>> Sent: Tuesday, October 16, 2018 11:17 AM
>> To: Stella Stamenova mailto:sti...@microsoft.com>>
>> Cc: Frédéric Riss mailto:fr...@apple.com>>; 
>> reviews+d50478+public+7e86b794a0909...@reviews.llvm.org 
>> ; Adrian 
>> Prantl mailto:apra...@apple.com>>; 
>> paul.robin...@sony.com ; 
>> jdevliegh...@apple.com ; Jim Ingham 
>> mailto:jing...@apple.com>>; ztur...@google.com 
>> ; abidh@gmail.com 
>> ; teempe...@gmail.com 
>> ; sgraen...@apple.com 
>> ; mgr...@codeaurora.org 
>> ; dblai...@gmail.com 
>> ; lldb-commits@lists.llvm.org 
>> 
>> Subject: Re: [PATCH] D50478: Add support for artificial tail call frames
>>  
>>  
>> 
>> 
>> On Oct 16, 2018, at 10:59 AM, Stella Stamenova > > wrote:
>>  
>> The windows error is because the names are different, as you expected:
>> AssertionError: 'void sink(void)' != 'sink()'
>> You can probably update the test to look for a different name on Windows 
>> (though if I recall correctly, different versions of the DIA sdk provide 
>> different detail on the names, so that might not be robust either) or look 
>> for a substring in the full name.
>>  
>> I used a substring check in r344634.
>>  
>> 
>> 
>> I’ll look into the Linux error as well and let you know what I find.
>>  
>> Thank you very much! I really appreciate your help and patience with this.
>>  
>> The "step" logging channel should provide detailed information about what 
>> goes wrong when parsing the DWARF for call site information and creating 
>> artificial frames.
>>  
>> vedant
>> 
>> 
>> From: v...@apple.com  > > 
>> Sent: Monday, October 15, 2018 8:34 PM
>> To: Frédéric Riss mailto:fr...@apple.com>>
>> Cc: reviews+d50478+public+7e86b794a0909...@reviews.llvm.org 
>> ; Adrian 
>> Prantl mailto:apra...@apple.com>>; 
>> paul.robin...@sony.com ; 
>> jdevliegh...@apple.com ; Jim Ingham 
>> mailto:jing...@apple.com>>; ztur...@google.com 
>> ; Stella Stamenova > >; abidh@gmail.com 
>> ; teempe...@gmail.com 
>> ; sgraen...@apple.com 
>> 

[Lldb-commits] [lldb] r344960 - [DWARF] Use a function-local offset for AT_call_return_pc

2018-10-22 Thread Vedant Kumar via lldb-commits
Author: vedantk
Date: Mon Oct 22 14:44:21 2018
New Revision: 344960

URL: http://llvm.org/viewvc/llvm-project?rev=344960&view=rev
Log:
[DWARF] Use a function-local offset for AT_call_return_pc

Logs provided by @stella.stamenova indicate that on Linux, lldb adds a
spurious slide offset to the return PC it loads from AT_call_return_pc
attributes (see the list thread: "[PATCH] D50478: Add support for
artificial tail call frames").

This patch side-steps the issue by getting rid of the load address
calculation in lldb's CallEdge::GetReturnPCAddress.

The idea is to have the DWARF writer emit function-local offsets to the
instruction after a call. I.e. return-pc = label-after-call-insn -
function-entry. LLDB can simply add this offset to the base address of a
function to get the return PC.

Differential Revision: https://reviews.llvm.org/D53469

Modified:
lldb/trunk/include/lldb/Symbol/Function.h
lldb/trunk/source/Symbol/Function.cpp

Modified: lldb/trunk/include/lldb/Symbol/Function.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/Function.h?rev=344960&r1=344959&r2=344960&view=diff
==
--- lldb/trunk/include/lldb/Symbol/Function.h (original)
+++ lldb/trunk/include/lldb/Symbol/Function.h Mon Oct 22 14:44:21 2018
@@ -324,7 +324,8 @@ public:
   /// made the call.
   lldb::addr_t GetReturnPCAddress(Function &caller, Target &target) const;
 
-  /// Like \ref GetReturnPCAddress, but returns an unresolved file address.
+  /// Like \ref GetReturnPCAddress, but returns an unslid function-local PC
+  /// offset.
   lldb::addr_t GetUnresolvedReturnPCAddress() const { return return_pc; }
 
 private:
@@ -337,8 +338,9 @@ private:
 Function *def;
   } lazy_callee;
 
-  /// An invalid address if this is a tail call. Otherwise, the return PC for
-  /// the call. Note that this is a file address which must be resolved.
+  /// An invalid address if this is a tail call. Otherwise, the function-local
+  /// PC offset. Adding this PC offset to the function's base load address
+  /// gives the return PC for the call.
   lldb::addr_t return_pc;
 
   /// Whether or not an attempt was made to find the callee's definition.

Modified: lldb/trunk/source/Symbol/Function.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/Function.cpp?rev=344960&r1=344959&r2=344960&view=diff
==
--- lldb/trunk/source/Symbol/Function.cpp (original)
+++ lldb/trunk/source/Symbol/Function.cpp Mon Oct 22 14:44:21 2018
@@ -180,8 +180,7 @@ Function *CallEdge::GetCallee(ModuleList
 lldb::addr_t CallEdge::GetReturnPCAddress(Function &caller,
   Target &target) const {
   const Address &base = caller.GetAddressRange().GetBaseAddress();
-  Address return_pc_addr{base.GetSection(), return_pc};
-  return return_pc_addr.GetLoadAddress(&target);
+  return base.GetLoadAddress(&target) + return_pc;
 }
 
 //--


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


[Lldb-commits] [lldb] r333583 - [lldb-test] Add a testing harness for the JIT's IRMemoryMap

2018-05-30 Thread Vedant Kumar via lldb-commits
Author: vedantk
Date: Wed May 30 12:39:10 2018
New Revision: 333583

URL: http://llvm.org/viewvc/llvm-project?rev=333583&view=rev
Log:
[lldb-test] Add a testing harness for the JIT's IRMemoryMap

This teaches lldb-test how to launch a process, set up an IRMemoryMap,
and issue memory allocations in the target process through the map. This
makes it possible to test IRMemoryMap in a targeted way.

This has uncovered two bugs so far. The first bug is that Malloc
performs an adjustment on the pointer returned from AllocateMemory (for
alignment purposes) which ultimately allows overlapping memory regions
to be created. The second bug is that after most of the address space on
the host side is exhausted, Malloc may return the same address multiple
times. These bugs (and hopefully more!) can be uncovered and tested for
with targeted lldb-test commands.

At an even higher level, the motivation for addressing these bugs is
that they can lead to strange user-visible failures (e.g, variables
assume the wrong value during expression evaluation, or the debugger
crashes). See my third comment on this swift-lldb PR for an example:

https://github.com/apple/swift-lldb/pull/652

I hope lldb-test is the right place to add this testing harness. Setting
up a gtest-style unit test proved too cumbersome (you need to recreate
or mock way too much debugger state), as did writing end-to-end tests
(it's hard to write a test that actually hits a buggy path).

With lldb-test, it's easy to read/generate the test input and parse the
test output. I'll attach a simple "fuzz" tester which generates failing
test cases to the Phab review. Here's an example:

```
Command: malloc(size=1024, alignment=32)
Malloc: address = 0xca000
Command: malloc(size=64, alignment=16)
Malloc: address = 0xca400
Command: malloc(size=1024, alignment=16)
Malloc: address = 0xca440
Command: malloc(size=16, alignment=8)
Malloc: address = 0xca840
Command: malloc(size=2048, alignment=16)
Malloc: address = 0xcb000
Command: malloc(size=64, alignment=32)
Malloc: address = 0xca860
Command: malloc(size=1024, alignment=16)
Malloc: address = 0xca890
Malloc error: overlapping allocation detected, previous allocation at [0xca860, 
0xca8a0)
```

{F6288839}

Differential Revision: https://reviews.llvm.org/D47508

Added:
lldb/trunk/lit/Expr/TestIRMemoryMap.test
Modified:
lldb/trunk/source/Target/Process.cpp
lldb/trunk/tools/lldb-test/lldb-test.cpp

Added: lldb/trunk/lit/Expr/TestIRMemoryMap.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Expr/TestIRMemoryMap.test?rev=333583&view=auto
==
--- lldb/trunk/lit/Expr/TestIRMemoryMap.test (added)
+++ lldb/trunk/lit/Expr/TestIRMemoryMap.test Wed May 30 12:39:10 2018
@@ -0,0 +1,28 @@
+# RUN: %cxx %p/Inputs/call-function.cpp -g -o %t
+# RUN: lldb-test ir-memory-map %t %s
+
+malloc 0 1
+malloc 1 1
+
+malloc 2 1
+malloc 2 2
+malloc 2 4
+
+malloc 3 1
+malloc 3 2
+malloc 3 4
+
+malloc 128 1
+malloc 128 2
+malloc 128 4
+malloc 128 128
+
+malloc 2048 1
+malloc 2048 2
+malloc 2048 4
+
+malloc 3968 1
+malloc 3968 2
+malloc 3968 4
+
+malloc 0 1

Modified: lldb/trunk/source/Target/Process.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Process.cpp?rev=333583&r1=333582&r2=333583&view=diff
==
--- lldb/trunk/source/Target/Process.cpp (original)
+++ lldb/trunk/source/Target/Process.cpp Wed May 30 12:39:10 2018
@@ -2539,8 +2539,10 @@ Status Process::WriteObjectFile(std::vec
 #define USE_ALLOCATE_MEMORY_CACHE 1
 addr_t Process::AllocateMemory(size_t size, uint32_t permissions,
Status &error) {
-  if (GetPrivateState() != eStateStopped)
+  if (GetPrivateState() != eStateStopped) {
+error.SetErrorToGenericError();
 return LLDB_INVALID_ADDRESS;
+  }
 
 #if defined(USE_ALLOCATE_MEMORY_CACHE)
   return m_allocated_memory_cache.AllocateMemory(size, permissions, error);

Modified: lldb/trunk/tools/lldb-test/lldb-test.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-test/lldb-test.cpp?rev=333583&r1=333582&r2=333583&view=diff
==
--- lldb/trunk/tools/lldb-test/lldb-test.cpp (original)
+++ lldb/trunk/tools/lldb-test/lldb-test.cpp Wed May 30 12:39:10 2018
@@ -15,6 +15,7 @@
 #include "lldb/Core/Debugger.h"
 #include "lldb/Core/Module.h"
 #include "lldb/Core/Section.h"
+#include "lldb/Expression/IRMemoryMap.h"
 #include "lldb/Initialization/SystemLifetimeManager.h"
 #include "lldb/Interpreter/CommandInterpreter.h"
 #include "lldb/Interpreter/CommandReturnObject.h"
@@ -23,17 +24,22 @@
 #include "lldb/Symbol/SymbolVendor.h"
 #include "lldb/Symbol/TypeList.h"
 #include "lldb/Symbol/VariableList.h"
+#include "lldb/Target/Process.h"
+#include "lldb/Target/Target.h"
 #include "lldb/Utility/CleanUp.h"
 #include "lldb/Utility/DataExtractor.h"
 #incl

[Lldb-commits] [lldb] r333585 - [lldb-test] ir-memory-map: Avoid accessing a bad iterator

2018-05-30 Thread Vedant Kumar via lldb-commits
Author: vedantk
Date: Wed May 30 12:46:47 2018
New Revision: 333585

URL: http://llvm.org/viewvc/llvm-project?rev=333585&view=rev
Log:
[lldb-test] ir-memory-map: Avoid accessing a bad iterator

Do not access Probe.start() when Probe is at the end of the interval
map.

Modified:
lldb/trunk/tools/lldb-test/lldb-test.cpp

Modified: lldb/trunk/tools/lldb-test/lldb-test.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-test/lldb-test.cpp?rev=333585&r1=333584&r2=333585&view=diff
==
--- lldb/trunk/tools/lldb-test/lldb-test.cpp (original)
+++ lldb/trunk/tools/lldb-test/lldb-test.cpp Wed May 30 12:46:47 2018
@@ -551,17 +551,15 @@ bool opts::irmemorymap::evalMalloc(IRMem
   auto Probe = AllocatedIntervals.begin();
   Probe.advanceTo(Addr); //< First interval s.t stop >= Addr.
   AllocationT NewAllocation = {Addr, EndOfRegion};
-  if (Probe != AllocatedIntervals.end()) {
-while (Probe.start() < EndOfRegion) {
-  AllocationT ProbeAllocation = {Probe.start(), Probe.stop()};
-  if (areAllocationsOverlapping(ProbeAllocation, NewAllocation)) {
-outs() << "Malloc error: overlapping allocation detected"
-   << formatv(", previous allocation at [{0:x}, {1:x})\n",
-  Probe.start(), Probe.stop());
-exit(1);
-  }
-  ++Probe;
+  while (Probe != AllocatedIntervals.end() && Probe.start() < EndOfRegion) {
+AllocationT ProbeAllocation = {Probe.start(), Probe.stop()};
+if (areAllocationsOverlapping(ProbeAllocation, NewAllocation)) {
+  outs() << "Malloc error: overlapping allocation detected"
+ << formatv(", previous allocation at [{0:x}, {1:x})\n",
+Probe.start(), Probe.stop());
+  exit(1);
 }
+++Probe;
   }
 
   // Insert the new allocation into the interval map.


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


[Lldb-commits] [lldb] r333701 - [lit] Remove the *.test suffix from two test inputs

2018-05-31 Thread Vedant Kumar via lldb-commits
Author: vedantk
Date: Thu May 31 15:09:01 2018
New Revision: 333701

URL: http://llvm.org/viewvc/llvm-project?rev=333701&view=rev
Log:
[lit] Remove the *.test suffix from two test inputs

This prevents the test inputs from being marked as unsupported tests,
due to their lack of RUN lines.

Added:
lldb/trunk/lit/Expr/Inputs/ir-memory-map-basic
  - copied, changed from r333700, 
lldb/trunk/lit/Expr/Inputs/ir-memory-map-basic.test
lldb/trunk/lit/Expr/Inputs/ir-memory-map-overlap1
  - copied, changed from r333700, 
lldb/trunk/lit/Expr/Inputs/ir-memory-map-overlap1.test
Removed:
lldb/trunk/lit/Expr/Inputs/ir-memory-map-basic.test
lldb/trunk/lit/Expr/Inputs/ir-memory-map-overlap1.test
Modified:
lldb/trunk/lit/Expr/TestIRMemoryMap.test

Copied: lldb/trunk/lit/Expr/Inputs/ir-memory-map-basic (from r333700, 
lldb/trunk/lit/Expr/Inputs/ir-memory-map-basic.test)
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Expr/Inputs/ir-memory-map-basic?p2=lldb/trunk/lit/Expr/Inputs/ir-memory-map-basic&p1=lldb/trunk/lit/Expr/Inputs/ir-memory-map-basic.test&r1=333700&r2=333701&rev=333701&view=diff
==
(empty)

Removed: lldb/trunk/lit/Expr/Inputs/ir-memory-map-basic.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Expr/Inputs/ir-memory-map-basic.test?rev=333700&view=auto
==
--- lldb/trunk/lit/Expr/Inputs/ir-memory-map-basic.test (original)
+++ lldb/trunk/lit/Expr/Inputs/ir-memory-map-basic.test (removed)
@@ -1,25 +0,0 @@
-malloc 0 1
-malloc 1 1
-
-malloc 2 1
-malloc 2 2
-malloc 2 4
-
-malloc 3 1
-malloc 3 2
-malloc 3 4
-
-malloc 128 1
-malloc 128 2
-malloc 128 4
-malloc 128 128
-
-malloc 2048 1
-malloc 2048 2
-malloc 2048 4
-
-malloc 3968 1
-malloc 3968 2
-malloc 3968 4
-
-malloc 0 1

Copied: lldb/trunk/lit/Expr/Inputs/ir-memory-map-overlap1 (from r333700, 
lldb/trunk/lit/Expr/Inputs/ir-memory-map-overlap1.test)
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Expr/Inputs/ir-memory-map-overlap1?p2=lldb/trunk/lit/Expr/Inputs/ir-memory-map-overlap1&p1=lldb/trunk/lit/Expr/Inputs/ir-memory-map-overlap1.test&r1=333700&r2=333701&rev=333701&view=diff
==
(empty)

Removed: lldb/trunk/lit/Expr/Inputs/ir-memory-map-overlap1.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Expr/Inputs/ir-memory-map-overlap1.test?rev=333700&view=auto
==
--- lldb/trunk/lit/Expr/Inputs/ir-memory-map-overlap1.test (original)
+++ lldb/trunk/lit/Expr/Inputs/ir-memory-map-overlap1.test (removed)
@@ -1,10 +0,0 @@
-malloc 8 16
-malloc 16 8
-malloc 64 32
-malloc 1 8
-malloc 64 32
-malloc 64 8
-malloc 1024 32
-malloc 1 16
-malloc 8 16
-malloc 1024 16
\ No newline at end of file

Modified: lldb/trunk/lit/Expr/TestIRMemoryMap.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Expr/TestIRMemoryMap.test?rev=333701&r1=333700&r2=333701&view=diff
==
--- lldb/trunk/lit/Expr/TestIRMemoryMap.test (original)
+++ lldb/trunk/lit/Expr/TestIRMemoryMap.test Thu May 31 15:09:01 2018
@@ -1,10 +1,10 @@
 # RUN: %cxx %p/Inputs/call-function.cpp -g -o %t
 
-# RUN: lldb-test ir-memory-map %t %S/Inputs/ir-memory-map-basic.test
-# RUN: lldb-test ir-memory-map -host-only %t %S/Inputs/ir-memory-map-basic.test
+# RUN: lldb-test ir-memory-map %t %S/Inputs/ir-memory-map-basic
+# RUN: lldb-test ir-memory-map -host-only %t %S/Inputs/ir-memory-map-basic
 
-# RUN: lldb-test ir-memory-map %t %S/Inputs/ir-memory-map-overlap1.test
-# RUN: lldb-test ir-memory-map -host-only %t 
%S/Inputs/ir-memory-map-overlap1.test
+# RUN: lldb-test ir-memory-map %t %S/Inputs/ir-memory-map-overlap1
+# RUN: lldb-test ir-memory-map -host-only %t %S/Inputs/ir-memory-map-overlap1
 
 # RUN: lldb-test ir-memory-map %t %S/Inputs/ir-memory-map-mix-malloc-free
 # RUN: lldb-test ir-memory-map -host-only %t 
%S/Inputs/ir-memory-map-mix-malloc-free


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


[Lldb-commits] [lldb] r333700 - [IRMemoryMap] Test interleaved Mallocs and Frees

2018-05-31 Thread Vedant Kumar via lldb-commits
Author: vedantk
Date: Thu May 31 15:09:01 2018
New Revision: 333700

URL: http://llvm.org/viewvc/llvm-project?rev=333700&view=rev
Log:
[IRMemoryMap] Test interleaved Mallocs and Frees

This adds a new command to the ir-memory-map tester:

  free 

The argument to free is an index which identifies which live allocation
to free. Index 0 identifies the first live allocation in the address
space, index 1 identifies the second, etc. where the allocations are
sorted in increasing order.

For illustrative purposes, assume malloc returns monotonically
increasing addresses. Here are some examples of how free would work:

Example 1
-

malloc 16 1
malloc 32 1
free 1  //< Free the 32-byte allocation.
free 0  //< Next, free the 16-byte allocation.

Example 2
-

malloc 16 1
malloc 32 1
free 0  //< Free the 16-byte allocation.
free 0  //< Next, free the 32-byte allocation.

Added:
lldb/trunk/lit/Expr/Inputs/ir-memory-map-mix-malloc-free
Modified:
lldb/trunk/lit/Expr/TestIRMemoryMap.test
lldb/trunk/tools/lldb-test/lldb-test.cpp

Added: lldb/trunk/lit/Expr/Inputs/ir-memory-map-mix-malloc-free
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Expr/Inputs/ir-memory-map-mix-malloc-free?rev=333700&view=auto
==
--- lldb/trunk/lit/Expr/Inputs/ir-memory-map-mix-malloc-free (added)
+++ lldb/trunk/lit/Expr/Inputs/ir-memory-map-mix-malloc-free Thu May 31 
15:09:01 2018
@@ -0,0 +1,275 @@
+# This file was generated by a slightly extended version of a script
+# attached to https://reviews.llvm.org/D47508.
+
+malloc 2 4
+malloc 4095 128
+malloc 3 16
+malloc 8192 2
+malloc 1 128
+malloc 3 2
+free 3
+free 3
+malloc 32 2
+malloc 2 16
+free 1
+malloc 2048 2
+free 2
+malloc 2049 4
+malloc 4097 2
+malloc 2 16
+free 1
+free 6
+malloc 1 16
+malloc 33 128
+malloc 2 128
+malloc 2 16
+malloc 2 4
+malloc 2 4
+free 4
+malloc 4 4
+malloc 2 16
+free 3
+malloc 0 128
+free 6
+free 2
+malloc 33 2
+malloc 4095 2
+free 6
+malloc 2 4
+malloc 0 2
+free 1
+free 9
+free 5
+malloc 32 2
+malloc 4096 2
+free 2
+free 9
+free 6
+malloc 8192 16
+malloc 2 4
+malloc 4096 16
+free 10
+malloc 4 4
+free 7
+malloc 4 4
+malloc 8193 2
+malloc 1 2
+free 3
+free 7
+malloc 4096 2
+free 0
+malloc 4096 4
+free 3
+malloc 4097 128
+malloc 1 2
+malloc 4 2
+free 10
+free 8
+malloc 0 16
+malloc 2049 16
+free 9
+malloc 8193 16
+free 10
+free 1
+malloc 8193 2
+free 11
+malloc 3 16
+free 5
+malloc 33 128
+free 0
+malloc 2049 4
+malloc 1 128
+malloc 32 16
+free 1
+free 9
+malloc 2048 4
+free 0
+free 2
+malloc 5 4
+free 11
+malloc 2048 4
+malloc 4097 16
+malloc 8192 4
+free 2
+free 8
+free 11
+malloc 8192 4
+free 2
+malloc 8191 4
+malloc 32 128
+free 7
+malloc 4 16
+malloc 4096 128
+free 12
+malloc 2 4
+free 9
+malloc 8193 128
+malloc 4095 4
+malloc 2049 16
+malloc 2 4
+free 16
+malloc 0 128
+malloc 5 2
+malloc 2047 4
+malloc 2 2
+free 10
+malloc 0 128
+free 6
+malloc 2047 128
+free 11
+free 0
+free 9
+malloc 4 4
+malloc 3 2
+free 7
+malloc 1 128
+free 13
+malloc 8193 16
+malloc 4097 128
+free 15
+free 3
+malloc 1 2
+malloc 2049 4
+malloc 2048 2
+free 7
+malloc 31 4
+free 5
+free 14
+free 4
+free 10
+malloc 4 4
+free 6
+malloc 3 2
+malloc 1 128
+free 13
+malloc 4 16
+free 4
+free 8
+malloc 3 16
+free 13
+malloc 0 4
+free 8
+free 13
+malloc 1 2
+malloc 8192 128
+free 12
+malloc 2049 2
+malloc 1 16
+free 4
+free 7
+malloc 4 16
+malloc 4 128
+malloc 4096 16
+malloc 2048 16
+malloc 32 4
+malloc 8193 4
+free 2
+malloc 3 16
+malloc 8192 4
+free 1
+malloc 8191 2
+free 3
+malloc 8192 2
+malloc 8192 2
+free 3
+free 7
+malloc 31 4
+malloc 2049 2
+free 4
+free 3
+free 14
+free 1
+malloc 2048 4
+malloc 1 4
+malloc 1 4
+malloc 2 4
+malloc 4 16
+free 12
+free 14
+free 3
+free 0
+free 12
+free 10
+malloc 32 16
+free 5
+free 9
+free 4
+free 9
+free 3
+malloc 4096 16
+malloc 4 2
+free 12
+free 10
+free 3
+free 7
+malloc 4097 4
+malloc 4095 16
+free 3
+malloc 2047 16
+free 12
+malloc 8193 2
+free 2
+free 3
+malloc 0 4
+free 2
+free 9
+malloc 8192 16
+malloc 2 2
+malloc 4096 4
+malloc 5 128
+malloc 4095 4
+malloc 4095 4
+free 9
+malloc 32 4
+malloc 31 16
+free 15
+malloc 4097 16
+malloc 2048 128
+malloc 2048 2
+malloc 4096 128
+malloc 3 16
+free 2
+malloc 1 4
+malloc 3 4
+free 3
+malloc 31 2
+malloc 1 128
+free 21
+malloc 0 128
+free 8
+malloc 3 128
+free 5
+malloc 1 16
+free 9
+malloc 2048 4
+free 8
+free 4
+malloc 31 2
+malloc 1 16
+free 19
+malloc 2 4
+malloc 2 2
+free 8
+malloc 8193 16
+free 11
+free 8
+free 6
+free 12
+free 4
+free 0
+free 10
+free 1
+free 0
+free 5
+free 5
+free 3
+free 6
+free 1
+free 2
+free 6
+free 5
+free 4
+free 3
+free 1
+free 1
+free 0

Modified: lldb/trunk/lit/Expr/TestIRMemoryMap.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Expr/TestIRMemoryMap.test?rev=333700&r1=333699&r2=333700&view=diff
==
--- lldb/trunk/lit/Expr/TestIRMemoryMap.test (original)
+++ lldb/tru

[Lldb-commits] [lldb] r333698 - [IRMemoryMap] Test host-side allocations

2018-05-31 Thread Vedant Kumar via lldb-commits
Author: vedantk
Date: Thu May 31 15:09:00 2018
New Revision: 333698

URL: http://llvm.org/viewvc/llvm-project?rev=333698&view=rev
Log:
[IRMemoryMap] Test host-side allocations

r333583 introduced testing for IRMemoryMap's process-side allocations
(eAllocationPolicyProcessOnly). This adds support for the host-side
variety (eAllocationPolicyHostOnly).

Modified:
lldb/trunk/lit/Expr/TestIRMemoryMap.test
lldb/trunk/tools/lldb-test/lldb-test.cpp

Modified: lldb/trunk/lit/Expr/TestIRMemoryMap.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Expr/TestIRMemoryMap.test?rev=333698&r1=333697&r2=333698&view=diff
==
--- lldb/trunk/lit/Expr/TestIRMemoryMap.test (original)
+++ lldb/trunk/lit/Expr/TestIRMemoryMap.test Thu May 31 15:09:00 2018
@@ -1,3 +1,5 @@
 # RUN: %cxx %p/Inputs/call-function.cpp -g -o %t
 # RUN: lldb-test ir-memory-map %t %S/Inputs/ir-memory-map-basic.test
+# RUN: lldb-test ir-memory-map -host-only %t %S/Inputs/ir-memory-map-basic.test
 # RUN: lldb-test ir-memory-map %t %S/Inputs/ir-memory-map-overlap1.test
+# RUN: lldb-test ir-memory-map -host-only %t 
%S/Inputs/ir-memory-map-overlap1.test

Modified: lldb/trunk/tools/lldb-test/lldb-test.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-test/lldb-test.cpp?rev=333698&r1=333697&r2=333698&view=diff
==
--- lldb/trunk/tools/lldb-test/lldb-test.cpp (original)
+++ lldb/trunk/tools/lldb-test/lldb-test.cpp Thu May 31 15:09:00 2018
@@ -159,6 +159,10 @@ static cl::opt CommandFile(
 cl::desc(""),
 cl::init("-"),
 cl::sub(IRMemoryMapSubcommand));
+static cl::opt UseHostOnlyAllocationPolicy(
+"host-only", cl::desc("Use the host-only allocation policy"),
+cl::init(false), cl::sub(IRMemoryMapSubcommand));
+
 using AllocationT = std::pair;
 bool areAllocationsOverlapping(const AllocationT &L, const AllocationT &R);
 using AddrIntervalMap =
@@ -521,14 +525,16 @@ bool opts::irmemorymap::evalMalloc(IRMem
 exit(1);
   }
 
+  IRMemoryMap::AllocationPolicy AP =
+  UseHostOnlyAllocationPolicy ? IRMemoryMap::eAllocationPolicyHostOnly
+  : IRMemoryMap::eAllocationPolicyProcessOnly;
+
   // Issue the malloc in the target process with "-rw" permissions.
   const uint32_t Permissions = 0x3;
   const bool ZeroMemory = false;
-  IRMemoryMap::AllocationPolicy Policy =
-  IRMemoryMap::eAllocationPolicyProcessOnly;
   Status ST;
   addr_t Addr =
-  IRMemMap.Malloc(Size, Alignment, Permissions, Policy, ZeroMemory, ST);
+  IRMemMap.Malloc(Size, Alignment, Permissions, AP, ZeroMemory, ST);
   if (ST.Fail()) {
 outs() << formatv("Malloc error: {0}\n", ST);
 return true;


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


[Lldb-commits] [lldb] r333699 - [lldb-test] Make logging available to all subcommands

2018-05-31 Thread Vedant Kumar via lldb-commits
Author: vedantk
Date: Thu May 31 15:09:00 2018
New Revision: 333699

URL: http://llvm.org/viewvc/llvm-project?rev=333699&view=rev
Log:
[lldb-test] Make logging available to all subcommands

Modified:
lldb/trunk/tools/lldb-test/lldb-test.cpp

Modified: lldb/trunk/tools/lldb-test/lldb-test.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-test/lldb-test.cpp?rev=333699&r1=333698&r2=333699&view=diff
==
--- lldb/trunk/tools/lldb-test/lldb-test.cpp (original)
+++ lldb/trunk/tools/lldb-test/lldb-test.cpp Thu May 31 15:09:00 2018
@@ -53,7 +53,10 @@ cl::SubCommand ModuleSubcommand("module-
 "Display LLDB Module Information");
 cl::SubCommand SymbolsSubcommand("symbols", "Dump symbols for an object file");
 cl::SubCommand IRMemoryMapSubcommand("ir-memory-map", "Test IRMemoryMap");
+
 cl::opt Log("log", cl::desc("Path to a log file"), cl::init(""),
+ cl::sub(BreakpointSubcommand),
+ cl::sub(ModuleSubcommand), cl::sub(SymbolsSubcommand),
  cl::sub(IRMemoryMapSubcommand));
 
 /// Create a target using the file pointed to by \p Filename, or abort.


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


[Lldb-commits] [lldb] r333697 - [IRMemoryMap] Fix the alignment adjustment in Malloc

2018-05-31 Thread Vedant Kumar via lldb-commits
Author: vedantk
Date: Thu May 31 15:08:59 2018
New Revision: 333697

URL: http://llvm.org/viewvc/llvm-project?rev=333697&view=rev
Log:
[IRMemoryMap] Fix the alignment adjustment in Malloc

This prevents Malloc from allocating the same chunk of memory twice, as
a byproduct of an alignment adjustment which gave the client access to
unallocated memory.

Prior to this patch, the newly-added test failed with:

$ lldb-test ir-memory-map ... ir-memory-map-overlap1.test
...
Command: malloc(size=64, alignment=32)
Malloc: address = 0x1000cd080
Command: malloc(size=64, alignment=8)
Malloc: address = 0x1000cd0b0
Malloc error: overlapping allocation detected, previous allocation at 
[0x1000cd080, 0x1000cd0c0)

Differential Revision: https://reviews.llvm.org/D47551

Added:
lldb/trunk/lit/Expr/Inputs/ir-memory-map-basic.test
  - copied, changed from r333690, lldb/trunk/lit/Expr/TestIRMemoryMap.test
lldb/trunk/lit/Expr/Inputs/ir-memory-map-overlap1.test
Modified:
lldb/trunk/lit/Expr/TestIRMemoryMap.test
lldb/trunk/source/Expression/IRMemoryMap.cpp

Copied: lldb/trunk/lit/Expr/Inputs/ir-memory-map-basic.test (from r333690, 
lldb/trunk/lit/Expr/TestIRMemoryMap.test)
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Expr/Inputs/ir-memory-map-basic.test?p2=lldb/trunk/lit/Expr/Inputs/ir-memory-map-basic.test&p1=lldb/trunk/lit/Expr/TestIRMemoryMap.test&r1=333690&r2=333697&rev=333697&view=diff
==
--- lldb/trunk/lit/Expr/TestIRMemoryMap.test (original)
+++ lldb/trunk/lit/Expr/Inputs/ir-memory-map-basic.test Thu May 31 15:08:59 2018
@@ -1,6 +1,3 @@
-# RUN: %cxx %p/Inputs/call-function.cpp -g -o %t
-# RUN: lldb-test ir-memory-map %t %s
-
 malloc 0 1
 malloc 1 1
 

Added: lldb/trunk/lit/Expr/Inputs/ir-memory-map-overlap1.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Expr/Inputs/ir-memory-map-overlap1.test?rev=333697&view=auto
==
--- lldb/trunk/lit/Expr/Inputs/ir-memory-map-overlap1.test (added)
+++ lldb/trunk/lit/Expr/Inputs/ir-memory-map-overlap1.test Thu May 31 15:08:59 
2018
@@ -0,0 +1,10 @@
+malloc 8 16
+malloc 16 8
+malloc 64 32
+malloc 1 8
+malloc 64 32
+malloc 64 8
+malloc 1024 32
+malloc 1 16
+malloc 8 16
+malloc 1024 16
\ No newline at end of file

Modified: lldb/trunk/lit/Expr/TestIRMemoryMap.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Expr/TestIRMemoryMap.test?rev=333697&r1=333696&r2=333697&view=diff
==
--- lldb/trunk/lit/Expr/TestIRMemoryMap.test (original)
+++ lldb/trunk/lit/Expr/TestIRMemoryMap.test Thu May 31 15:08:59 2018
@@ -1,28 +1,3 @@
 # RUN: %cxx %p/Inputs/call-function.cpp -g -o %t
-# RUN: lldb-test ir-memory-map %t %s
-
-malloc 0 1
-malloc 1 1
-
-malloc 2 1
-malloc 2 2
-malloc 2 4
-
-malloc 3 1
-malloc 3 2
-malloc 3 4
-
-malloc 128 1
-malloc 128 2
-malloc 128 4
-malloc 128 128
-
-malloc 2048 1
-malloc 2048 2
-malloc 2048 4
-
-malloc 3968 1
-malloc 3968 2
-malloc 3968 4
-
-malloc 0 1
+# RUN: lldb-test ir-memory-map %t %S/Inputs/ir-memory-map-basic.test
+# RUN: lldb-test ir-memory-map %t %S/Inputs/ir-memory-map-overlap1.test

Modified: lldb/trunk/source/Expression/IRMemoryMap.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/IRMemoryMap.cpp?rev=333697&r1=333696&r2=333697&view=diff
==
--- lldb/trunk/source/Expression/IRMemoryMap.cpp (original)
+++ lldb/trunk/source/Expression/IRMemoryMap.cpp Thu May 31 15:08:59 2018
@@ -301,15 +301,21 @@ lldb::addr_t IRMemoryMap::Malloc(size_t
   lldb::addr_t allocation_address = LLDB_INVALID_ADDRESS;
   lldb::addr_t aligned_address = LLDB_INVALID_ADDRESS;
 
-  size_t alignment_mask = alignment - 1;
   size_t allocation_size;
 
-  if (size == 0)
+  if (size == 0) {
+// FIXME: Malloc(0) should either return an invalid address or assert, in
+// order to cut down on unnecessary allocations.
 allocation_size = alignment;
-  else
-allocation_size = (size & alignment_mask)
-  ? ((size + alignment) & (~alignment_mask))
-  : size;
+  } else {
+// Round up the requested size to an aligned value.
+allocation_size = llvm::alignTo(size, alignment);
+
+// The process page cache does not see the requested alignment. We can't
+// assume its result will be any more than 1-byte aligned. To work around
+// this, request `alignment - 1` additional bytes.
+allocation_size += alignment - 1;
+  }
 
   switch (policy) {
   default:


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


Re: [Lldb-commits] [lldb] r333700 - [IRMemoryMap] Test interleaved Mallocs and Frees

2018-06-01 Thread Vedant Kumar via lldb-commits


> On Jun 1, 2018, at 1:39 AM, Pavel Labath  wrote:
> 
> On Thu, 31 May 2018 at 23:13, Vedant Kumar via lldb-commits
>  wrote:
>> 
>> Author: vedantk
>> Date: Thu May 31 15:09:01 2018
>> New Revision: 333700
>> 
>> URL: http://llvm.org/viewvc/llvm-project?rev=333700&view=rev
>> Log:
>> [IRMemoryMap] Test interleaved Mallocs and Frees
>> 
>> This adds a new command to the ir-memory-map tester:
>> 
>>  free 
>> 
>> The argument to free is an index which identifies which live allocation
>> to free. Index 0 identifies the first live allocation in the address
>> space, index 1 identifies the second, etc. where the allocations are
>> sorted in increasing order.
>> 
>> For illustrative purposes, assume malloc returns monotonically
>> increasing addresses. Here are some examples of how free would work:
>> 
>> Example 1
>> -
>> 
>> malloc 16 1
>> malloc 32 1
>> free 1  //< Free the 32-byte allocation.
>> free 0  //< Next, free the 16-byte allocation.
> 
> I think it would be better if the mallocs and frees were connected
> symbolically instead of by an index that changes after every free. In
> the long test case you add here it's pretty much impossible to figure
> out which allocation a particular free refers to.
> 
> Maybe we could
> attach an optional "label" to each malloc statement and then have
> "free" reference those? e.g. something like:
> LARGEALLOC: malloc 4096 16
> malloc 10, 1 # I won't free this, no label necessary
> free LARGEALLOC # frees first allocation
> 
> Adding parsing code for the extended syntax shouldn't be much work,
> but I believe it will help a lot with the readability of these test
> cases.
> 
> WDYT?

I think this would be a good forward-looking change to make. Maybe it'll help 
test other parts of the API: we have no testing for WriteMemory, or for what 
happens on a double-free.

As an aside, for this particular test case, I'm not sure there's a reason to 
figure out which allocation a free refers to. It might actually be sufficient 
to have the free command pick a random allocation to release (i.e, no 
arguments).

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


Re: [Lldb-commits] [lldb] r333700 - [IRMemoryMap] Test interleaved Mallocs and Frees

2018-06-01 Thread Vedant Kumar via lldb-commits
Patch up for review: https://reviews.llvm.org/D47646 
<https://reviews.llvm.org/D47646>

thanks,
vedant

> On Jun 1, 2018, at 11:31 AM, Vedant Kumar  wrote:
> 
> 
> 
>> On Jun 1, 2018, at 1:39 AM, Pavel Labath  wrote:
>> 
>> On Thu, 31 May 2018 at 23:13, Vedant Kumar via lldb-commits
>>  wrote:
>>> 
>>> Author: vedantk
>>> Date: Thu May 31 15:09:01 2018
>>> New Revision: 333700
>>> 
>>> URL: http://llvm.org/viewvc/llvm-project?rev=333700&view=rev
>>> Log:
>>> [IRMemoryMap] Test interleaved Mallocs and Frees
>>> 
>>> This adds a new command to the ir-memory-map tester:
>>> 
>>> free 
>>> 
>>> The argument to free is an index which identifies which live allocation
>>> to free. Index 0 identifies the first live allocation in the address
>>> space, index 1 identifies the second, etc. where the allocations are
>>> sorted in increasing order.
>>> 
>>> For illustrative purposes, assume malloc returns monotonically
>>> increasing addresses. Here are some examples of how free would work:
>>> 
>>> Example 1
>>> -
>>> 
>>> malloc 16 1
>>> malloc 32 1
>>> free 1  //< Free the 32-byte allocation.
>>> free 0  //< Next, free the 16-byte allocation.
>> 
>> I think it would be better if the mallocs and frees were connected
>> symbolically instead of by an index that changes after every free. In
>> the long test case you add here it's pretty much impossible to figure
>> out which allocation a particular free refers to.
>> 
>> Maybe we could
>> attach an optional "label" to each malloc statement and then have
>> "free" reference those? e.g. something like:
>> LARGEALLOC: malloc 4096 16
>> malloc 10, 1 # I won't free this, no label necessary
>> free LARGEALLOC # frees first allocation
>> 
>> Adding parsing code for the extended syntax shouldn't be much work,
>> but I believe it will help a lot with the readability of these test
>> cases.
>> 
>> WDYT?
> 
> I think this would be a good forward-looking change to make. Maybe it'll help 
> test other parts of the API: we have no testing for WriteMemory, or for what 
> happens on a double-free.
> 
> As an aside, for this particular test case, I'm not sure there's a reason to 
> figure out which allocation a free refers to. It might actually be sufficient 
> to have the free command pick a random allocation to release (i.e, no 
> arguments).
> 
> vedant

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


[Lldb-commits] [lldb] r333785 - Disable TestIRMemoryMap.test on Windows

2018-06-01 Thread Vedant Kumar via lldb-commits
Author: vedantk
Date: Fri Jun  1 13:02:57 2018
New Revision: 333785

URL: http://llvm.org/viewvc/llvm-project?rev=333785&view=rev
Log:
Disable TestIRMemoryMap.test on Windows

It's been pointed out in https://reviews.llvm.org/D47646 that lldb-test
fails to create a usable process on Windows when running this test.

Modified:
lldb/trunk/lit/Expr/TestIRMemoryMap.test

Modified: lldb/trunk/lit/Expr/TestIRMemoryMap.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Expr/TestIRMemoryMap.test?rev=333785&r1=333784&r2=333785&view=diff
==
--- lldb/trunk/lit/Expr/TestIRMemoryMap.test (original)
+++ lldb/trunk/lit/Expr/TestIRMemoryMap.test Fri Jun  1 13:02:57 2018
@@ -1,3 +1,5 @@
+# REQUIRES: nowindows
+
 # RUN: %cxx %p/Inputs/call-function.cpp -g -o %t
 
 # RUN: lldb-test ir-memory-map %t %S/Inputs/ir-memory-map-basic


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


[Lldb-commits] [lldb] r333787 - XFAIL TestIRMemoryMap.test on Windows

2018-06-01 Thread Vedant Kumar via lldb-commits
Author: vedantk
Date: Fri Jun  1 13:32:32 2018
New Revision: 333787

URL: http://llvm.org/viewvc/llvm-project?rev=333787&view=rev
Log:
XFAIL TestIRMemoryMap.test on Windows

I've xfailed this test instead of skipping it by request
(https://reviews.llvm.org/D47646).

Bug: https://bugs.llvm.org/show_bug.cgi?id=37656

Modified:
lldb/trunk/lit/Expr/TestIRMemoryMap.test

Modified: lldb/trunk/lit/Expr/TestIRMemoryMap.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Expr/TestIRMemoryMap.test?rev=333787&r1=333786&r2=333787&view=diff
==
--- lldb/trunk/lit/Expr/TestIRMemoryMap.test (original)
+++ lldb/trunk/lit/Expr/TestIRMemoryMap.test Fri Jun  1 13:32:32 2018
@@ -1,4 +1,4 @@
-# REQUIRES: nowindows
+# XFAIL: windows
 
 # RUN: %cxx %p/Inputs/call-function.cpp -g -o %t
 


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


[Lldb-commits] [lldb] r333930 - [IRMemoryMap] Use labels in the "malloc" and "free" lldb-test commands

2018-06-04 Thread Vedant Kumar via lldb-commits
Author: vedantk
Date: Mon Jun  4 10:11:15 2018
New Revision: 333930

URL: http://llvm.org/viewvc/llvm-project?rev=333930&view=rev
Log:
[IRMemoryMap] Use labels in the "malloc" and "free" lldb-test commands

Change the syntax of the malloc and free commands in lldb-test's
ir-memory-map subcommand to:

   ::=  = malloc  

   ::= free 

This should make it easier to read and extend tests in the future, e.g
to test IRMemoryMap::WriteMemory or double-free behavior.

Differential Revision: https://reviews.llvm.org/D47646

Modified:
lldb/trunk/lit/Expr/Inputs/ir-memory-map-basic
lldb/trunk/lit/Expr/Inputs/ir-memory-map-mix-malloc-free
lldb/trunk/lit/Expr/Inputs/ir-memory-map-overlap1
lldb/trunk/tools/lldb-test/lldb-test.cpp

Modified: lldb/trunk/lit/Expr/Inputs/ir-memory-map-basic
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Expr/Inputs/ir-memory-map-basic?rev=333930&r1=333929&r2=333930&view=diff
==
--- lldb/trunk/lit/Expr/Inputs/ir-memory-map-basic (original)
+++ lldb/trunk/lit/Expr/Inputs/ir-memory-map-basic Mon Jun  4 10:11:15 2018
@@ -1,25 +1,25 @@
-malloc 0 1
-malloc 1 1
+L1 = malloc 0 1
+L2 = malloc 1 1
 
-malloc 2 1
-malloc 2 2
-malloc 2 4
-
-malloc 3 1
-malloc 3 2
-malloc 3 4
-
-malloc 128 1
-malloc 128 2
-malloc 128 4
-malloc 128 128
-
-malloc 2048 1
-malloc 2048 2
-malloc 2048 4
-
-malloc 3968 1
-malloc 3968 2
-malloc 3968 4
+L3 = malloc 2 1
+L4 = malloc 2 2
+L5 = malloc 2 4
+
+L6 = malloc 3 1
+L7 = malloc 3 2
+L8 = malloc 3 4
+
+L9 = malloc 128 1
+L10 = malloc 128 2
+L11 = malloc 128 4
+L12 = malloc 128 128
+
+L13 = malloc 2048 1
+L14 = malloc 2048 2
+L15 = malloc 2048 4
+
+L16 = malloc 3968 1
+L17 = malloc 3968 2
+L18 = malloc 3968 4
 
-malloc 0 1
+L19 = malloc 0 1

Modified: lldb/trunk/lit/Expr/Inputs/ir-memory-map-mix-malloc-free
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Expr/Inputs/ir-memory-map-mix-malloc-free?rev=333930&r1=333929&r2=333930&view=diff
==
--- lldb/trunk/lit/Expr/Inputs/ir-memory-map-mix-malloc-free (original)
+++ lldb/trunk/lit/Expr/Inputs/ir-memory-map-mix-malloc-free Mon Jun  4 
10:11:15 2018
@@ -1,275 +1,272 @@
-# This file was generated by a slightly extended version of a script
-# attached to https://reviews.llvm.org/D47508.
-
-malloc 2 4
-malloc 4095 128
-malloc 3 16
-malloc 8192 2
-malloc 1 128
-malloc 3 2
-free 3
-free 3
-malloc 32 2
-malloc 2 16
-free 1
-malloc 2048 2
-free 2
-malloc 2049 4
-malloc 4097 2
-malloc 2 16
-free 1
-free 6
-malloc 1 16
-malloc 33 128
-malloc 2 128
-malloc 2 16
-malloc 2 4
-malloc 2 4
-free 4
-malloc 4 4
-malloc 2 16
-free 3
-malloc 0 128
-free 6
-free 2
-malloc 33 2
-malloc 4095 2
-free 6
-malloc 2 4
-malloc 0 2
-free 1
-free 9
-free 5
-malloc 32 2
-malloc 4096 2
-free 2
-free 9
-free 6
-malloc 8192 16
-malloc 2 4
-malloc 4096 16
-free 10
-malloc 4 4
-free 7
-malloc 4 4
-malloc 8193 2
-malloc 1 2
-free 3
-free 7
-malloc 4096 2
-free 0
-malloc 4096 4
-free 3
-malloc 4097 128
-malloc 1 2
-malloc 4 2
-free 10
-free 8
-malloc 0 16
-malloc 2049 16
-free 9
-malloc 8193 16
-free 10
-free 1
-malloc 8193 2
-free 11
-malloc 3 16
-free 5
-malloc 33 128
-free 0
-malloc 2049 4
-malloc 1 128
-malloc 32 16
-free 1
-free 9
-malloc 2048 4
-free 0
-free 2
-malloc 5 4
-free 11
-malloc 2048 4
-malloc 4097 16
-malloc 8192 4
-free 2
-free 8
-free 11
-malloc 8192 4
-free 2
-malloc 8191 4
-malloc 32 128
-free 7
-malloc 4 16
-malloc 4096 128
-free 12
-malloc 2 4
-free 9
-malloc 8193 128
-malloc 4095 4
-malloc 2049 16
-malloc 2 4
-free 16
-malloc 0 128
-malloc 5 2
-malloc 2047 4
-malloc 2 2
-free 10
-malloc 0 128
-free 6
-malloc 2047 128
-free 11
-free 0
-free 9
-malloc 4 4
-malloc 3 2
-free 7
-malloc 1 128
-free 13
-malloc 8193 16
-malloc 4097 128
-free 15
-free 3
-malloc 1 2
-malloc 2049 4
-malloc 2048 2
-free 7
-malloc 31 4
-free 5
-free 14
-free 4
-free 10
-malloc 4 4
-free 6
-malloc 3 2
-malloc 1 128
-free 13
-malloc 4 16
-free 4
-free 8
-malloc 3 16
-free 13
-malloc 0 4
-free 8
-free 13
-malloc 1 2
-malloc 8192 128
-free 12
-malloc 2049 2
-malloc 1 16
-free 4
-free 7
-malloc 4 16
-malloc 4 128
-malloc 4096 16
-malloc 2048 16
-malloc 32 4
-malloc 8193 4
-free 2
-malloc 3 16
-malloc 8192 4
-free 1
-malloc 8191 2
-free 3
-malloc 8192 2
-malloc 8192 2
-free 3
-free 7
-malloc 31 4
-malloc 2049 2
-free 4
-free 3
-free 14
-free 1
-malloc 2048 4
-malloc 1 4
-malloc 1 4
-malloc 2 4
-malloc 4 16
-free 12
-free 14
-free 3
-free 0
-free 12
-free 10
-malloc 32 16
-free 5
-free 9
-free 4
-free 9
-free 3
-malloc 4096 16
-malloc 4 2
-free 12
-free 10
-free 3
-free 7
-malloc 4097 4
-malloc 4095 16
-free 3
-malloc 2047 16
-free 12
-malloc 8193 2
-free 2
-free 3
-malloc 0 4
-free 2
-free 9
-malloc 8192 16
-malloc 2 2
-malloc 4096 4
-malloc 5 128
-malloc 4095 4
-malloc 4095 4
-free 9
-malloc 32 4
-malloc 31 16
-free 15
-malloc 4097 16
-malloc 2048 128
-malloc 2048 2
-malloc 4096 128
-malloc 3 1

[Lldb-commits] [lldb] r338588 - [StackFrame] Factor GetOnlyConcreteFramesUpTo out of GetFramesUpTo (NFC)

2018-08-01 Thread Vedant Kumar via lldb-commits
Author: vedantk
Date: Wed Aug  1 10:07:40 2018
New Revision: 338588

URL: http://llvm.org/viewvc/llvm-project?rev=338588&view=rev
Log:
[StackFrame] Factor GetOnlyConcreteFramesUpTo out of GetFramesUpTo (NFC)

Splitting GetOnlyConcreteFramesUpTo will make it easier to implement
support for synthetic tail call frames in backtraces. This is just a
prep change, no functionality is affected.

Modified:
lldb/trunk/include/lldb/Target/StackFrameList.h
lldb/trunk/source/Target/StackFrameList.cpp

Modified: lldb/trunk/include/lldb/Target/StackFrameList.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/StackFrameList.h?rev=338588&r1=338587&r2=338588&view=diff
==
--- lldb/trunk/include/lldb/Target/StackFrameList.h (original)
+++ lldb/trunk/include/lldb/Target/StackFrameList.h Wed Aug  1 10:07:40 2018
@@ -83,6 +83,8 @@ protected:
 
   void GetFramesUpTo(uint32_t end_idx);
 
+  void GetOnlyConcreteFramesUpTo(uint32_t end_idx, Unwind *unwinder);
+
   bool GetAllFramesFetched() { return m_concrete_frames_fetched == UINT32_MAX; 
}
 
   void SetAllFramesFetched() { m_concrete_frames_fetched = UINT32_MAX; }

Modified: lldb/trunk/source/Target/StackFrameList.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/StackFrameList.cpp?rev=338588&r1=338587&r2=338588&view=diff
==
--- lldb/trunk/source/Target/StackFrameList.cpp (original)
+++ lldb/trunk/source/Target/StackFrameList.cpp Wed Aug  1 10:07:40 2018
@@ -226,8 +226,27 @@ void StackFrameList::SetCurrentInlinedDe
 m_current_inlined_pc = m_thread.GetRegisterContext()->GetPC();
 }
 
+void StackFrameList::GetOnlyConcreteFramesUpTo(uint32_t end_idx,
+   Unwind *unwinder) {
+  assert(m_thread.IsValid() && "Expected valid thread");
+  assert(m_frames.size() <= end_idx && "Expected there to be frames to fill");
+
+  if (end_idx < m_concrete_frames_fetched)
+return;
+
+  if (!unwinder)
+return;
+
+  uint32_t num_frames = unwinder->GetFramesUpTo(end_idx);
+  if (num_frames <= end_idx + 1) {
+// Done unwinding.
+m_concrete_frames_fetched = UINT32_MAX;
+  }
+  m_frames.resize(num_frames);
+}
+
 void StackFrameList::GetFramesUpTo(uint32_t end_idx) {
-  // this makes sure we do not fetch frames for an invalid thread
+  // Do not fetch frames for an invalid thread.
   if (!m_thread.IsValid())
 return;
 
@@ -238,201 +257,185 @@ void StackFrameList::GetFramesUpTo(uint3
 
   Unwind *unwinder = m_thread.GetUnwinder();
 
-  if (m_show_inlined_frames) {
+  if (!m_show_inlined_frames) {
+GetOnlyConcreteFramesUpTo(end_idx, unwinder);
+return;
+  }
+
 #if defined(DEBUG_STACK_FRAMES)
-StreamFile s(stdout, false);
+  StreamFile s(stdout, false);
 #endif
-// If we are hiding some frames from the outside world, we need to add
-// those onto the total count of frames to fetch.  However, we don't need
-// to do that if end_idx is 0 since in that case we always get the first
-// concrete frame and all the inlined frames below it...  And of course, if
-// end_idx is UINT32_MAX that means get all, so just do that...
-
-uint32_t inlined_depth = 0;
-if (end_idx > 0 && end_idx != UINT32_MAX) {
-  inlined_depth = GetCurrentInlinedDepth();
-  if (inlined_depth != UINT32_MAX) {
-if (end_idx > 0)
-  end_idx += inlined_depth;
-  }
+  // If we are hiding some frames from the outside world, we need to add
+  // those onto the total count of frames to fetch.  However, we don't need
+  // to do that if end_idx is 0 since in that case we always get the first
+  // concrete frame and all the inlined frames below it...  And of course, if
+  // end_idx is UINT32_MAX that means get all, so just do that...
+
+  uint32_t inlined_depth = 0;
+  if (end_idx > 0 && end_idx != UINT32_MAX) {
+inlined_depth = GetCurrentInlinedDepth();
+if (inlined_depth != UINT32_MAX) {
+  if (end_idx > 0)
+end_idx += inlined_depth;
 }
+  }
 
-StackFrameSP unwind_frame_sp;
-do {
-  uint32_t idx = m_concrete_frames_fetched++;
-  lldb::addr_t pc = LLDB_INVALID_ADDRESS;
-  lldb::addr_t cfa = LLDB_INVALID_ADDRESS;
-  if (idx == 0) {
-// We might have already created frame zero, only create it if we need
-// to
-if (m_frames.empty()) {
-  RegisterContextSP reg_ctx_sp(m_thread.GetRegisterContext());
-
-  if (reg_ctx_sp) {
-const bool success =
-unwinder && unwinder->GetFrameInfoAtIndex(idx, cfa, pc);
-// There shouldn't be any way not to get the frame info for frame
-// 0. But if the unwinder can't make one, lets make one by hand
-// with the
-// SP as the CFA and see if that gets any further.
-if (!success) {
-  cfa = reg_ctx_sp->GetSP()

[Lldb-commits] [lldb] r338590 - [StackFrame] Add doxygen comments to the StackFrameList API (NFC)

2018-08-01 Thread Vedant Kumar via lldb-commits
Author: vedantk
Date: Wed Aug  1 10:08:11 2018
New Revision: 338590

URL: http://llvm.org/viewvc/llvm-project?rev=338590&view=rev
Log:
[StackFrame] Add doxygen comments to the StackFrameList API (NFC)

Clarify how StackFrameList works by documenting its methods. Also,
delete some dead code and insert some TODOs.

Differential Revision: https://reviews.llvm.org/D50087

Modified:
lldb/trunk/include/lldb/Target/StackFrameList.h
lldb/trunk/source/Target/StackFrameList.cpp

Modified: lldb/trunk/include/lldb/Target/StackFrameList.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/StackFrameList.h?rev=338590&r1=338589&r2=338590&view=diff
==
--- lldb/trunk/include/lldb/Target/StackFrameList.h (original)
+++ lldb/trunk/include/lldb/Target/StackFrameList.h Wed Aug  1 10:08:11 2018
@@ -10,14 +10,10 @@
 #ifndef liblldb_StackFrameList_h_
 #define liblldb_StackFrameList_h_
 
-// C Includes
-// C++ Includes
 #include 
 #include 
 #include 
 
-// Other libraries and framework includes
-// Project includes
 #include "lldb/Target/StackFrame.h"
 
 namespace lldb_private {
@@ -32,22 +28,33 @@ public:
 
   ~StackFrameList();
 
+  /// Get the number of visible frames. Frames may be created if \p can_create
+  /// is true. Synthetic (inline) frames expanded from the concrete frame #0
+  /// (aka invisible frames) are not included in this count.
   uint32_t GetNumFrames(bool can_create = true);
 
+  /// Get the frame at index \p idx. Invisible frames cannot be indexed.
   lldb::StackFrameSP GetFrameAtIndex(uint32_t idx);
 
+  /// Get the first concrete frame with index greater than or equal to \p idx.
+  /// Unlike \ref GetFrameAtIndex, this cannot return a synthetic frame.
   lldb::StackFrameSP GetFrameWithConcreteFrameIndex(uint32_t unwind_idx);
 
+  /// Retrieve the stack frame with the given ID \p stack_id.
   lldb::StackFrameSP GetFrameWithStackID(const StackID &stack_id);
 
-  // Mark a stack frame as the current frame
+  /// Mark a stack frame as the currently selected frame and return its index.
   uint32_t SetSelectedFrame(lldb_private::StackFrame *frame);
 
+  /// Get the currently selected frame index.
   uint32_t GetSelectedFrameIndex() const;
 
-  // Mark a stack frame as the current frame using the frame index
+  /// Mark a stack frame as the currently selected frame using the frame index
+  /// \p idx. Like \ref GetFrameAtIndex, invisible frames cannot be selected.
   bool SetSelectedFrameByIndex(uint32_t idx);
 
+  /// If the current inline depth (i.e the number of invisible frames) is 
valid,
+  /// subtract it from \p idx. Otherwise simply return \p idx.
   uint32_t GetVisibleStackFrameIndex(uint32_t idx) {
 if (m_current_inlined_depth < UINT32_MAX)
   return idx - m_current_inlined_depth;
@@ -55,16 +62,23 @@ public:
   return idx;
   }
 
+  /// Calculate and set the current inline depth. This may be used to update
+  /// the StackFrameList's set of inline frames when execution stops, e.g when
+  /// a breakpoint is hit.
   void CalculateCurrentInlinedDepth();
 
+  /// If the currently selected frame comes from the currently selected thread,
+  /// point the default file and line of the thread's target to the location
+  /// specified by the frame.
   void SetDefaultFileAndLineToSelectedFrame();
 
+  /// Clear the cache of frames.
   void Clear();
 
-  void InvalidateFrames(uint32_t start_idx);
-
   void Dump(Stream *s);
 
+  /// If \p stack_frame_ptr is contained in this StackFrameList, return its
+  /// wrapping shared pointer.
   lldb::StackFrameSP
   GetStackFrameSPForStackFramePtr(StackFrame *stack_frame_ptr);
 
@@ -101,14 +115,44 @@ protected:
   typedef collection::iterator iterator;
   typedef collection::const_iterator const_iterator;
 
+  /// The thread this frame list describes.
   Thread &m_thread;
+
+  /// The old stack frame list.
+  // TODO: The old stack frame list is used to fill in missing frame info
+  // heuristically when it's otherwise unavailable (say, because the unwinder
+  // fails). We should have stronger checks to make sure that this is a valid
+  // source of information.
   lldb::StackFrameListSP m_prev_frames_sp;
+
+  /// A mutex for this frame list.
+  // TODO: This mutex may not always be held when required. In particular, uses
+  // of the StackFrameList APIs in lldb_private::Thread look suspect. Consider
+  // passing around a lock_guard reference to enforce proper locking.
   mutable std::recursive_mutex m_mutex;
+
+  /// A cache of frames. This may need to be updated when the program counter
+  /// changes.
   collection m_frames;
+
+  /// The currently selected frame.
   uint32_t m_selected_frame_idx;
+
+  /// The number of concrete frames fetched while filling the frame list. This
+  /// is only used when synthetic frames are enabled.
   uint32_t m_concrete_frames_fetched;
+
+  /// The number of synthetic function activations (invisible frames) expanded
+

[Lldb-commits] [lldb] r338589 - [StackFrame] Use early returns in ResetCurrentInlinedDepth (NFC)

2018-08-01 Thread Vedant Kumar via lldb-commits
Author: vedantk
Date: Wed Aug  1 10:07:56 2018
New Revision: 338589

URL: http://llvm.org/viewvc/llvm-project?rev=338589&view=rev
Log:
[StackFrame] Use early returns in ResetCurrentInlinedDepth (NFC)

Using early returns in this function substantially reduces the nesting
level, making the logic easier to understand.

Modified:
lldb/trunk/include/lldb/Target/StackFrameList.h
lldb/trunk/source/Target/StackFrameList.cpp

Modified: lldb/trunk/include/lldb/Target/StackFrameList.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/StackFrameList.h?rev=338589&r1=338588&r2=338589&view=diff
==
--- lldb/trunk/include/lldb/Target/StackFrameList.h (original)
+++ lldb/trunk/include/lldb/Target/StackFrameList.h Wed Aug  1 10:07:56 2018
@@ -109,7 +109,7 @@ protected:
   uint32_t m_concrete_frames_fetched;
   uint32_t m_current_inlined_depth;
   lldb::addr_t m_current_inlined_pc;
-  bool m_show_inlined_frames;
+  const bool m_show_inlined_frames;
 
 private:
   DISALLOW_COPY_AND_ASSIGN(StackFrameList);

Modified: lldb/trunk/source/Target/StackFrameList.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/StackFrameList.cpp?rev=338589&r1=338588&r2=338589&view=diff
==
--- lldb/trunk/source/Target/StackFrameList.cpp (original)
+++ lldb/trunk/source/Target/StackFrameList.cpp Wed Aug  1 10:07:56 2018
@@ -81,127 +81,119 @@ uint32_t StackFrameList::GetCurrentInlin
 }
 
 void StackFrameList::ResetCurrentInlinedDepth() {
+  if (!m_show_inlined_frames)
+return;
+
   std::lock_guard guard(m_mutex);
 
-  if (m_show_inlined_frames) {
-GetFramesUpTo(0);
-if (m_frames.empty())
-  return;
-if (!m_frames[0]->IsInlined()) {
-  m_current_inlined_depth = UINT32_MAX;
-  m_current_inlined_pc = LLDB_INVALID_ADDRESS;
-  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_STEP));
-  if (log && log->GetVerbose())
-log->Printf(
-"ResetCurrentInlinedDepth: Invalidating current inlined depth.\n");
-} else {
-  // We only need to do something special about inlined blocks when we are
-  // at the beginning of an inlined function:
-  // FIXME: We probably also have to do something special if the PC is at
-  // the END
-  // of an inlined function, which coincides with the end of either its
-  // containing function or another inlined function.
-
-  lldb::addr_t curr_pc = m_thread.GetRegisterContext()->GetPC();
-  Block *block_ptr = m_frames[0]->GetFrameBlock();
-  if (block_ptr) {
-Address pc_as_address;
-pc_as_address.SetLoadAddress(curr_pc,
- &(m_thread.GetProcess()->GetTarget()));
-AddressRange containing_range;
-if (block_ptr->GetRangeContainingAddress(pc_as_address,
- containing_range)) {
-  if (pc_as_address == containing_range.GetBaseAddress()) {
-// If we got here because of a breakpoint hit, then set the inlined
-// depth depending on where the breakpoint was set. If we got here
-// because of a crash, then set the inlined depth to the deepest
-// most block. Otherwise, we stopped here naturally as the result
-// of a step, so set ourselves in the containing frame of the whole
-// set of nested inlines, so the user can then "virtually" step
-// into the frames one by one, or next over the whole mess. Note:
-// We don't have to handle being somewhere in the middle of the
-// stack here, since ResetCurrentInlinedDepth doesn't get called if
-// there is a valid inlined depth set.
-StopInfoSP stop_info_sp = m_thread.GetStopInfo();
-if (stop_info_sp) {
-  switch (stop_info_sp->GetStopReason()) {
-  case eStopReasonWatchpoint:
-  case eStopReasonException:
-  case eStopReasonExec:
-  case eStopReasonSignal:
-// In all these cases we want to stop in the deepest most
-// frame.
-m_current_inlined_pc = curr_pc;
-m_current_inlined_depth = 0;
-break;
-  case eStopReasonBreakpoint: {
-// FIXME: Figure out what this break point is doing, and set 
the
-// inline depth
-// appropriately.  Be careful to take into account breakpoints
-// that implement step over prologue, since that should do the
-// default calculation. For now, if the breakpoints
-// corresponding to this hit are all internal,
-// I set the stop location to the top of the inlined stack,
-// since that will make
-// things like stepping over 

[Lldb-commits] [lldb] r339051 - [IRMemoryMap] Avoid redundant zero-init in the Allocation constructor (NFC)

2018-08-06 Thread Vedant Kumar via lldb-commits
Author: vedantk
Date: Mon Aug  6 13:13:52 2018
New Revision: 339051

URL: http://llvm.org/viewvc/llvm-project?rev=339051&view=rev
Log:
[IRMemoryMap] Avoid redundant zero-init in the Allocation constructor (NFC)

In the lldb-bench/arithmetic benchmark, 1.7% of the total running time
is spent zero-initializing a std::vector that has already been zeroed.

Modified:
lldb/trunk/include/lldb/Utility/DataBufferHeap.h
lldb/trunk/source/Expression/IRMemoryMap.cpp

Modified: lldb/trunk/include/lldb/Utility/DataBufferHeap.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Utility/DataBufferHeap.h?rev=339051&r1=339050&r2=339051&view=diff
==
--- lldb/trunk/include/lldb/Utility/DataBufferHeap.h (original)
+++ lldb/trunk/include/lldb/Utility/DataBufferHeap.h Mon Aug  6 13:13:52 2018
@@ -90,7 +90,8 @@ public:
   /// Set the number of bytes in the data buffer.
   ///
   /// Sets the number of bytes that this object should be able to contain.
-  /// This can be used prior to copying data into the buffer.
+  /// This can be used prior to copying data into the buffer. Note that this
+  /// zero-initializes up to \p byte_size bytes.
   ///
   /// @param[in] byte_size
   /// The new size in bytes that this data buffer should attempt

Modified: lldb/trunk/source/Expression/IRMemoryMap.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/IRMemoryMap.cpp?rev=339051&r1=339050&r2=339051&view=diff
==
--- lldb/trunk/source/Expression/IRMemoryMap.cpp (original)
+++ lldb/trunk/source/Expression/IRMemoryMap.cpp Mon Aug  6 13:13:52 2018
@@ -278,15 +278,11 @@ IRMemoryMap::Allocation::Allocation(lldb
   default:
 assert(0 && "We cannot reach this!");
   case eAllocationPolicyHostOnly:
+  case eAllocationPolicyMirror:
 m_data.SetByteSize(size);
-memset(m_data.GetBytes(), 0, size);
 break;
   case eAllocationPolicyProcessOnly:
 break;
-  case eAllocationPolicyMirror:
-m_data.SetByteSize(size);
-memset(m_data.GetBytes(), 0, size);
-break;
   }
 }
 


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


[Lldb-commits] [lldb] r339206 - Delete a dead Function constructor (NFC)

2018-08-07 Thread Vedant Kumar via lldb-commits
Author: vedantk
Date: Tue Aug  7 16:48:40 2018
New Revision: 339206

URL: http://llvm.org/viewvc/llvm-project?rev=339206&view=rev
Log:
Delete a dead Function constructor (NFC)

Modified:
lldb/trunk/include/lldb/Symbol/Function.h
lldb/trunk/source/Symbol/Function.cpp

Modified: lldb/trunk/include/lldb/Symbol/Function.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/Function.h?rev=339206&r1=339205&r2=339206&view=diff
==
--- lldb/trunk/include/lldb/Symbol/Function.h (original)
+++ lldb/trunk/include/lldb/Symbol/Function.h Tue Aug  7 16:48:40 2018
@@ -349,40 +349,6 @@ public:
Type *func_type, const AddressRange &range);
 
   //--
-  /// Construct with a compile unit, function UID, function type UID, optional
-  /// mangled name, function type, and a section offset based address range.
-  ///
-  /// @param[in] comp_unit
-  /// The compile unit to which this function belongs.
-  ///
-  /// @param[in] func_uid
-  /// The UID for this function. This value is provided by the
-  /// SymbolFile plug-in and can be any value that allows
-  /// the plug-in to quickly find and parse more detailed
-  /// information when and if more information is needed.
-  ///
-  /// @param[in] func_type_uid
-  /// The type UID for the function Type to allow for lazy type
-  /// parsing from the debug information.
-  ///
-  /// @param[in] mangled
-  /// The optional mangled name for this function. If empty, there
-  /// is no mangled information.
-  ///
-  /// @param[in] func_type
-  /// The optional function type. If NULL, the function type will
-  /// be parsed on demand when accessed using the
-  /// Function::GetType() function by asking the SymbolFile
-  /// plug-in to get the type for \a func_type_uid.
-  ///
-  /// @param[in] range
-  /// The section offset based address for this function.
-  //--
-  Function(CompileUnit *comp_unit, lldb::user_id_t func_uid,
-   lldb::user_id_t func_type_uid, const char *mangled, Type *func_type,
-   const AddressRange &range);
-
-  //--
   /// Destructor.
   //--
   ~Function() override;

Modified: lldb/trunk/source/Symbol/Function.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/Function.cpp?rev=339206&r1=339205&r2=339206&view=diff
==
--- lldb/trunk/source/Symbol/Function.cpp (original)
+++ lldb/trunk/source/Symbol/Function.cpp Tue Aug  7 16:48:40 2018
@@ -141,17 +141,6 @@ Function::Function(CompileUnit *comp_uni
   assert(comp_unit != nullptr);
 }
 
-Function::Function(CompileUnit *comp_unit, lldb::user_id_t func_uid,
-   lldb::user_id_t type_uid, const char *mangled, Type *type,
-   const AddressRange &range)
-: UserID(func_uid), m_comp_unit(comp_unit), m_type_uid(type_uid),
-  m_type(type), m_mangled(ConstString(mangled), true), m_block(func_uid),
-  m_range(range), m_frame_base(nullptr), m_flags(),
-  m_prologue_byte_size(0) {
-  m_block.SetParentScope(this);
-  assert(comp_unit != nullptr);
-}
-
 Function::~Function() {}
 
 void Function::GetStartLineSourceInfo(FileSpec &source_file,


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


[Lldb-commits] [lldb] r339205 - [StackFrame] Add more clarifying comments to StackFrameList (NFC)

2018-08-07 Thread Vedant Kumar via lldb-commits
Author: vedantk
Date: Tue Aug  7 16:48:25 2018
New Revision: 339205

URL: http://llvm.org/viewvc/llvm-project?rev=339205&view=rev
Log:
[StackFrame] Add more clarifying comments to StackFrameList (NFC)

Modified:
lldb/trunk/source/Target/StackFrameList.cpp

Modified: lldb/trunk/source/Target/StackFrameList.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/StackFrameList.cpp?rev=339205&r1=339204&r2=339205&view=diff
==
--- lldb/trunk/source/Target/StackFrameList.cpp (original)
+++ lldb/trunk/source/Target/StackFrameList.cpp Tue Aug  7 16:48:25 2018
@@ -234,6 +234,9 @@ void StackFrameList::GetOnlyConcreteFram
 // Done unwinding.
 m_concrete_frames_fetched = UINT32_MAX;
   }
+
+  // Don't create the frames eagerly. Defer this work to GetFrameAtIndex,
+  // which can lazily query the unwinder to create frames.
   m_frames.resize(num_frames);
 }
 
@@ -567,9 +570,6 @@ StackFrameSP StackFrameList::GetFrameWit
 if ((*pos)->GetStackID() == stack_id)
   return *pos;
   }
-
-  //if (m_frames.back()->GetStackID() < stack_id)
-  //frame_idx = m_frames.size();
 }
 do {
   frame_sp = GetFrameAtIndex(frame_idx);


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


[Lldb-commits] [lldb] r339290 - [IRMemoryMap] Shrink Allocation and make it move-only (NFC)

2018-08-08 Thread Vedant Kumar via lldb-commits
Author: vedantk
Date: Wed Aug  8 14:26:49 2018
New Revision: 339290

URL: http://llvm.org/viewvc/llvm-project?rev=339290&view=rev
Log:
[IRMemoryMap] Shrink Allocation and make it move-only (NFC)

Profiling data show that Allocation::operator= is hot (see the data
attached to the Phab review).

Reorder a few fields within Allocation to avoid implicit structure
padding and shrink the structure. This should make copies a bit cheaper.

Also, given that an Allocation contains a std::vector (by way of
DataBufferHeap), it's preferable to make it move-only instead of
permitting expensive copies. As an added benefit this allows us to have
a single Allocation constructor instead of two.

Differential Revision: https://reviews.llvm.org/D50271

Modified:
lldb/trunk/include/lldb/Expression/IRMemoryMap.h
lldb/trunk/source/Expression/IRMemoryMap.cpp

Modified: lldb/trunk/include/lldb/Expression/IRMemoryMap.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Expression/IRMemoryMap.h?rev=339290&r1=339289&r2=339290&view=diff
==
--- lldb/trunk/include/lldb/Expression/IRMemoryMap.h (original)
+++ lldb/trunk/include/lldb/Expression/IRMemoryMap.h Wed Aug  8 14:26:49 2018
@@ -39,7 +39,7 @@ public:
   IRMemoryMap(lldb::TargetSP target_sp);
   ~IRMemoryMap();
 
-  enum AllocationPolicy {
+  enum AllocationPolicy : uint8_t {
 eAllocationPolicyInvalid =
 0, ///< It is an error for an allocation to have this policy.
 eAllocationPolicyHostOnly, ///< This allocation was created in the host and
@@ -91,32 +91,32 @@ protected:
 private:
   struct Allocation {
 lldb::addr_t
-m_process_alloc; ///< The (unaligned) base for the remote allocation
+m_process_alloc; ///< The (unaligned) base for the remote allocation.
 lldb::addr_t
-m_process_start; ///< The base address of the allocation in the process
-size_t m_size;   ///< The size of the requested allocation
-uint32_t m_permissions; ///< The access permissions on the memory in the
-///process.  In the host, the memory is always
-///read/write.
-uint8_t m_alignment;///< The alignment of the requested allocation
+m_process_start; ///< The base address of the allocation in the 
process.
+size_t m_size;   ///< The size of the requested allocation.
 DataBufferHeap m_data;
 
-///< Flags
+/// Flags. Keep these grouped together to avoid structure padding.
 AllocationPolicy m_policy;
 bool m_leak;
+uint8_t m_permissions; ///< The access permissions on the memory in the
+   /// process. In the host, the memory is always
+   /// read/write.
+uint8_t m_alignment;   ///< The alignment of the requested allocation.
 
   public:
 Allocation(lldb::addr_t process_alloc, lldb::addr_t process_start,
size_t size, uint32_t permissions, uint8_t alignment,
AllocationPolicy m_policy);
 
-Allocation()
-: m_process_alloc(LLDB_INVALID_ADDRESS),
-  m_process_start(LLDB_INVALID_ADDRESS), m_size(0), m_permissions(0),
-  m_alignment(0), m_data(), m_policy(eAllocationPolicyInvalid),
-  m_leak(false) {}
+DISALLOW_COPY_AND_ASSIGN(Allocation);
   };
 
+  static_assert(sizeof(Allocation) <=
+(4 * sizeof(lldb::addr_t)) + sizeof(DataBufferHeap),
+"IRMemoryMap::Allocation is larger than expected");
+
   lldb::ProcessWP m_process_wp;
   lldb::TargetWP m_target_wp;
   typedef std::map AllocationMap;

Modified: lldb/trunk/source/Expression/IRMemoryMap.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/IRMemoryMap.cpp?rev=339290&r1=339289&r2=339290&view=diff
==
--- lldb/trunk/source/Expression/IRMemoryMap.cpp (original)
+++ lldb/trunk/source/Expression/IRMemoryMap.cpp Wed Aug  8 14:26:49 2018
@@ -272,8 +272,8 @@ IRMemoryMap::Allocation::Allocation(lldb
 uint32_t permissions, uint8_t alignment,
 AllocationPolicy policy)
 : m_process_alloc(process_alloc), m_process_start(process_start),
-  m_size(size), m_permissions(permissions), m_alignment(alignment),
-  m_policy(policy), m_leak(false) {
+  m_size(size), m_policy(policy), m_leak(false), 
m_permissions(permissions),
+  m_alignment(alignment) {
   switch (policy) {
   default:
 assert(0 && "We cannot reach this!");
@@ -389,9 +389,10 @@ lldb::addr_t IRMemoryMap::Malloc(size_t
   lldb::addr_t mask = alignment - 1;
   aligned_address = (allocation_address + mask) & (~mask);
 
-  m_allocations[aligned_address] =
-  Allocation(allocation_address, aligned_address, allocation_size,
- permissions, alignment, policy);
+  m_allocations.emplace(
+  std::piecewi

Re: [Lldb-commits] [lldb] r339716 - Remove asseration from ConstString::GetConstCStringAndSetMangledCounterPart() to fix more tests first

2018-08-15 Thread Vedant Kumar via lldb-commits
Apologies for double-posting, but I'm not sure that my Phab comment made it to 
you.

---

/lldb/trunk/source/Utility/ConstString.cpp:130 Great catch!

I wonder, what does it mean for the entry value to be non-null but empty?

vedant

> On Aug 14, 2018, at 12:38 PM, Stefan Granitz via lldb-commits 
>  wrote:
> 
> Author: stefan.graenitz
> Date: Tue Aug 14 12:38:54 2018
> New Revision: 339716
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=339716&view=rev
> Log:
> Remove asseration from ConstString::GetConstCStringAndSetMangledCounterPart() 
> to fix more tests first
> 
> Modified:
>lldb/trunk/source/Utility/ConstString.cpp
> 
> Modified: lldb/trunk/source/Utility/ConstString.cpp
> URL: 
> http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Utility/ConstString.cpp?rev=339716&r1=339715&r2=339716&view=diff
> ==
> --- lldb/trunk/source/Utility/ConstString.cpp (original)
> +++ lldb/trunk/source/Utility/ConstString.cpp Tue Aug 14 12:38:54 2018
> @@ -123,11 +123,6 @@ public:
>   StringPool &map = m_string_pools[h].m_string_map;
>   StringPoolEntryType &entry = *map.try_emplace(demangled).first;
> 
> -  assert((entry.second == nullptr || entry.second == mangled_ccstr ||
> -  strlen(entry.second) == 0) &&
> - "The demangled string must have a unique counterpart or 
> otherwise "
> - "it must be empty");
> -
>   entry.second = mangled_ccstr;
> 
>   // Extract the const version of the demangled_cstr
> 
> 
> ___
> lldb-commits mailing list
> lldb-commits@lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

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


[Lldb-commits] [lldb] r339914 - Disable two flaky pexpect-backed tests on Darwin

2018-08-16 Thread Vedant Kumar via lldb-commits
Author: vedantk
Date: Thu Aug 16 11:18:16 2018
New Revision: 339914

URL: http://llvm.org/viewvc/llvm-project?rev=339914&view=rev
Log:
Disable two flaky pexpect-backed tests on Darwin

These tests are sporadically timing out on our bots, e.g here:

  https://ci.swift.org/job/swift-PR-Linux/6841

Modified:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/TestCommandScriptImmediateOutput.py

lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/interpreter/TestMiInterpreterExec.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/TestCommandScriptImmediateOutput.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/TestCommandScriptImmediateOutput.py?rev=339914&r1=339913&r2=339914&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/TestCommandScriptImmediateOutput.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/TestCommandScriptImmediateOutput.py
 Thu Aug 16 11:18:16 2018
@@ -28,6 +28,7 @@ class CommandScriptImmediateOutputTestCa
 oslist=["windows"],
 bugnumber="llvm.org/pr22274: need a pexpect replacement for windows")
 @expectedFailureAll(oslist=["freebsd"], bugnumber="llvm.org/pr26139")
+@skipIfDarwin
 def test_command_script_immediate_output_console(self):
 """Test that LLDB correctly allows scripted commands to set immediate 
output to the console."""
 self.launch(timeout=10)
@@ -50,6 +51,7 @@ class CommandScriptImmediateOutputTestCa
 oslist=["windows"],
 bugnumber="llvm.org/pr22274: need a pexpect replacement for windows")
 @expectedFailureAll(oslist=["freebsd"], bugnumber="llvm.org/pr26139")
+@skipIfDarwin
 def test_command_script_immediate_output_file(self):
 """Test that LLDB correctly allows scripted commands to set immediate 
output to a file."""
 self.launch(timeout=10)

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/interpreter/TestMiInterpreterExec.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/interpreter/TestMiInterpreterExec.py?rev=339914&r1=339913&r2=339914&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/interpreter/TestMiInterpreterExec.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/interpreter/TestMiInterpreterExec.py
 Thu Aug 16 11:18:16 2018
@@ -18,6 +18,7 @@ class MiInterpreterExecTestCase(lldbmi_t
 @skipIfWindows  # llvm.org/pr24452: Get lldb-mi tests working on Windows
 @skipIfFreeBSD  # llvm.org/pr22411: Failure presumably due to known thread 
races
 @skipIfRemote   # We do not currently support remote debugging via the MI.
+@skipIfDarwin
 def test_lldbmi_target_create(self):
 """Test that 'lldb-mi --interpreter' can create target by 'target 
create' command."""
 
@@ -39,6 +40,7 @@ class MiInterpreterExecTestCase(lldbmi_t
 @skipIfRemote   # We do not currently support remote debugging via the MI.
 @skipIfWindows  # llvm.org/pr24452: Get lldb-mi tests working on Windows.
 @skipIfFreeBSD  # llvm.org/pr22411: Failure presumably due to known thread 
races.
+@skipIfDarwin
 def test_lldbmi_target_list(self):
 """Test that 'lldb-mi --interpreter' can list targets by 'target list' 
command."""
 
@@ -58,6 +60,7 @@ class MiInterpreterExecTestCase(lldbmi_t
 @skipIfWindows  # llvm.org/pr24452: Get lldb-mi tests working on Windows
 @skipIfFreeBSD  # llvm.org/pr22411: Failure presumably due to known thread 
races
 @skipIfRemote   # We do not currently support remote debugging via the MI.
+@skipIfDarwin
 def test_lldbmi_breakpoint_set(self):
 """Test that 'lldb-mi --interpreter' can set breakpoint by 'breakpoint 
set' command."""
 
@@ -82,6 +85,7 @@ class MiInterpreterExecTestCase(lldbmi_t
 @skipIfFreeBSD  # llvm.org/pr22411: Failure presumably due to known thread 
races
 @expectedFlakeyLinux(bugnumber="llvm.org/pr25470")
 @skipIfRemote   # We do not currently support remote debugging via the MI.
+@skipIfDarwin
 def test_lldbmi_settings_set_target_run_args_before(self):
 """Test that 'lldb-mi --interpreter' can set target arguments by 
'setting set target.run-args' command before than target was created."""
 
@@ -115,6 +119,7 @@ class MiInterpreterExecTestCase(lldbmi_t
 @skipIfWindows  # llvm.org/pr24452: Get lldb-mi tests working on Windows
 @skipIfFreeBSD  # llvm.org/pr22411: Failure presumably due to known thread 
races
 @skipIfRemote   # We do not currently support remote debugging via the MI.
+@skipIfDarwin

[Lldb-commits] [lldb] r339929 - [dotest] Make --test-subdir work with --no-multiprocess

2018-08-16 Thread Vedant Kumar via lldb-commits
Author: vedantk
Date: Thu Aug 16 12:56:38 2018
New Revision: 339929

URL: http://llvm.org/viewvc/llvm-project?rev=339929&view=rev
Log:
[dotest] Make --test-subdir work with --no-multiprocess

The single-process test runner is invoked in a number of different
scenarios, including when multiple test dirs are specified or (afaict)
when lit is used to drive the test suite.

Unfortunately the --test-subdir option did not work with the single
process test runner, breaking an important use case (using lit to run
swift-lldb Linux tests):

  Failure URL: https://ci.swift.org/job/swift-PR-Linux/6841

We won't be able to run lldb tests within swift PR testing without
filtering down the set of tests.

This change makes --test-subdir work with the single-process runner.

Modified:
lldb/trunk/packages/Python/lldbsuite/test/configuration.py
lldb/trunk/packages/Python/lldbsuite/test/dosep.py
lldb/trunk/packages/Python/lldbsuite/test/dotest.py

Modified: lldb/trunk/packages/Python/lldbsuite/test/configuration.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/configuration.py?rev=339929&r1=339928&r2=339929&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/configuration.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/configuration.py Thu Aug 16 
12:56:38 2018
@@ -110,9 +110,13 @@ lldb_platform_working_dir = None
 # The base directory in which the tests are being built.
 test_build_dir = None
 
+# The only directory to scan for tests. If multiple test directories are
+# specified, and an exclusive test subdirectory is specified, the latter option
+# takes precedence.
+exclusive_test_subdir = None
+
 # Parallel execution settings
 is_inferior_test_runner = False
-multiprocess_test_subdir = None
 num_threads = None
 no_multiprocess_test_runner = False
 test_runner_name = None
@@ -144,3 +148,34 @@ def shouldSkipBecauseOfCategories(test_c
 return True
 
 return False
+
+
+def get_absolute_path_to_exclusive_test_subdir():
+"""
+If an exclusive test subdirectory is specified, return its absolute path.
+Otherwise return None.
+"""
+test_directory = os.path.dirname(os.path.realpath(__file__))
+
+if not exclusive_test_subdir:
+return
+
+if len(exclusive_test_subdir) > 0:
+test_subdir = os.path.join(test_directory, exclusive_test_subdir)
+if os.path.isdir(test_subdir):
+return test_subdir
+
+print('specified test subdirectory {} is not a valid directory\n'
+.format(test_subdir))
+
+
+def get_absolute_path_to_root_test_dir():
+"""
+If an exclusive test subdirectory is specified, return its absolute path.
+Otherwise, return the absolute path of the root test directory.
+"""
+test_subdir = get_absolute_path_to_exclusive_test_subdir()
+if test_subdir:
+return test_subdir
+
+return os.path.dirname(os.path.realpath(__file__))

Modified: lldb/trunk/packages/Python/lldbsuite/test/dosep.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/dosep.py?rev=339929&r1=339928&r2=339929&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/dosep.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/dosep.py Thu Aug 16 12:56:38 2018
@@ -1558,7 +1558,7 @@ def rerun_tests(test_subdir, tests_for_r
 print("\nTest rerun complete\n")
 
 
-def main(num_threads, test_subdir, test_runner_name, results_formatter):
+def main(num_threads, test_runner_name, results_formatter):
 """Run dotest.py in inferior mode in parallel.
 
 @param num_threads the parsed value of the num-threads command line
@@ -1600,16 +1600,7 @@ def main(num_threads, test_subdir, test_
 
 session_dir = os.path.join(os.getcwd(), dotest_options.s)
 
-# The root directory was specified on the command line
-test_directory = os.path.dirname(os.path.realpath(__file__))
-if test_subdir and len(test_subdir) > 0:
-test_subdir = os.path.join(test_directory, test_subdir)
-if not os.path.isdir(test_subdir):
-print(
-'specified test subdirectory {} is not a valid directory\n'
-.format(test_subdir))
-else:
-test_subdir = test_directory
+test_subdir = configuration.get_absolute_path_to_root_test_dir()
 
 # clean core files in test tree from previous runs (Linux)
 cores = find('core.*', test_subdir)

Modified: lldb/trunk/packages/Python/lldbsuite/test/dotest.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/dotest.py?rev=339929&r1=339928&r2=339929&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/dotest.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/dotest.py Thu Aug 16 

[Lldb-commits] [lldb] r342008 - [MIPS] Fix signed overflow in DADDIU emulation

2018-09-11 Thread Vedant Kumar via lldb-commits
Author: vedantk
Date: Tue Sep 11 16:04:05 2018
New Revision: 342008

URL: http://llvm.org/viewvc/llvm-project?rev=342008&view=rev
Log:
[MIPS] Fix signed overflow in DADDIU emulation

This fixes a signed integer overflow diagnostic reported by ubsan.

rdar://44353380

Modified:
lldb/trunk/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp

Modified: 
lldb/trunk/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp?rev=342008&r1=342007&r2=342008&view=diff
==
--- lldb/trunk/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp 
(original)
+++ lldb/trunk/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp 
Tue Sep 11 16:04:05 2018
@@ -1099,13 +1099,24 @@ bool EmulateInstructionMIPS64::Emulate_D
 Context context;
 
 /* read  register */
-const int64_t src_opd_val = ReadRegisterUnsigned(
+const uint64_t src_opd_val = ReadRegisterUnsigned(
 eRegisterKindDWARF, dwarf_zero_mips64 + src, 0, &success);
 if (!success)
   return false;
 
 /* Check if this is daddiu sp, sp, imm16 */
 if (dst == dwarf_sp_mips64) {
+  /*
+   * From the MIPS IV spec:
+   *
+   * The term “unsigned” in the instruction name is a misnomer; this
+   * operation is 64-bit modulo arithmetic that does not trap on overflow.
+   * It is appropriate for arithmetic which is not signed, such as address
+   * arithmetic, or integer arithmetic environments that ignore overflow,
+   * such as “C” language arithmetic.
+   *
+   * Assume 2's complement and rely on unsigned overflow here.
+   */
   uint64_t result = src_opd_val + imm;
   RegisterInfo reg_info_sp;
 


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


[Lldb-commits] [lldb] r342508 - Allow use of self.filecheck in LLDB tests (c.f self.expect)

2018-09-18 Thread Vedant Kumar via lldb-commits
Author: vedantk
Date: Tue Sep 18 12:31:47 2018
New Revision: 342508

URL: http://llvm.org/viewvc/llvm-project?rev=342508&view=rev
Log:
Allow use of self.filecheck in LLDB tests (c.f self.expect)

Add a "filecheck" method to the LLDB test base. This allows test authors
to pattern match command output using FileCheck, making it possible to
write stricter tests than what `self.expect` allows.

For context (motivation, examples of stricter checking, etc), see the
lldb-dev thread: "Using FileCheck in lldb inline tests".

Differential Revision: https://reviews.llvm.org/D50751

Modified:
lldb/trunk/CMakeLists.txt
lldb/trunk/lldb.xcodeproj/project.pbxproj
lldb/trunk/packages/Python/lldbsuite/test/configuration.py
lldb/trunk/packages/Python/lldbsuite/test/dotest.py
lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py

lldb/trunk/packages/Python/lldbsuite/test/expression_command/formatters/TestFormatters.py

lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/typedef_array/main.cpp
lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py
lldb/trunk/test/CMakeLists.txt

Modified: lldb/trunk/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/CMakeLists.txt?rev=342508&r1=342507&r2=342508&view=diff
==
--- lldb/trunk/CMakeLists.txt (original)
+++ lldb/trunk/CMakeLists.txt Tue Sep 18 12:31:47 2018
@@ -93,11 +93,15 @@ option(LLDB_TEST_USE_CUSTOM_C_COMPILER "
 option(LLDB_TEST_USE_CUSTOM_CXX_COMPILER "Use the C++ compiler provided via 
LLDB_TEST_CXX_COMPILER for building test inferiors (instead of the just-built 
compiler). Defaults to OFF." OFF)
 if(LLDB_INCLUDE_TESTS)
 
-  # The difference between the following two paths is significant. The path to
-  # LLDB will point to LLDB's binary directory, while the other will point to
-  # LLVM's binary directory in case the two differ.
+  # Set the path to the default lldb test executable. Make the path relative to
+  # LLVM_RUNTIME_OUTPUT_INTDIR: this will be correct even when LLVM and LLDB
+  # have separate binary directories.
   set(LLDB_DEFAULT_TEST_EXECUTABLE 
"${LLVM_RUNTIME_OUTPUT_INTDIR}/lldb${CMAKE_EXECUTABLE_SUFFIX}")
+
+  # Set the paths to default llvm tools. Make these paths relative to the LLVM
+  # binary directory.
   set(LLDB_DEFAULT_TEST_DSYMUTIL 
"${LLVM_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin/dsymutil${CMAKE_EXECUTABLE_SUFFIX}")
+  set(LLDB_DEFAULT_TEST_FILECHECK 
"${LLVM_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin/FileCheck${CMAKE_EXECUTABLE_SUFFIX}")
 
   if (NOT LLDB_TEST_USE_CUSTOM_C_COMPILER AND TARGET clang)
 set(LLDB_DEFAULT_TEST_C_COMPILER 
"${LLVM_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin/clang${CMAKE_EXECUTABLE_SUFFIX}")
@@ -115,6 +119,7 @@ if(LLDB_INCLUDE_TESTS)
   set(LLDB_TEST_C_COMPILER "${LLDB_DEFAULT_TEST_C_COMPILER}" CACHE PATH "C 
Compiler to use for building LLDB test inferiors")
   set(LLDB_TEST_CXX_COMPILER "${LLDB_DEFAULT_TEST_CXX_COMPILER}" CACHE PATH 
"C++ Compiler to use for building LLDB test inferiors")
   set(LLDB_TEST_DSYMUTIL "${LLDB_DEFAULT_TEST_DSYMUTIL}" CACHE PATH "dsymutil 
used for generating dSYM bundles")
+  set(LLDB_TEST_FILECHECK "${LLDB_DEFAULT_TEST_FILECHECK}" CACHE PATH 
"FileCheck used for testing purposes")
 
   if (("${LLDB_TEST_C_COMPILER}" STREQUAL "") OR
   ("${LLDB_TEST_CXX_COMPILER}" STREQUAL ""))

Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=342508&r1=342507&r2=342508&view=diff
==
--- lldb/trunk/lldb.xcodeproj/project.pbxproj (original)
+++ lldb/trunk/lldb.xcodeproj/project.pbxproj Tue Sep 18 12:31:47 2018
@@ -7091,7 +7091,7 @@
 /* Begin PBXLegacyTarget section */
2387551E1C24974600CCE8C3 /* lldb-python-test-suite */ = {
isa = PBXLegacyTarget;
-   buildArgumentsString = "-u $(SRCROOT)/test/dotest.py 
--apple-sdk $(PLATFORM_NAME) 
--executable=$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/lldb -C 
$(LLDB_PYTHON_TESTSUITE_CC) --arch $(LLDB_PYTHON_TESTSUITE_ARCH) 
--session-file-format fm --results-formatter 
lldbsuite.test_event.formatter.xunit.XunitFormatter --build-dir 
$(BUILD_DIR)/lldb-test-build.noindex --results-file 
$(BUILD_DIR)/test-results-$(LLDB_PYTHON_TESTSUITE_ARCH).xml --rerun-all-issues 
--env TERM=vt100 -O--xpass=ignore";
+   buildArgumentsString = "-u $(SRCROOT)/test/dotest.py 
--apple-sdk $(PLATFORM_NAME) 
--executable=$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/lldb -C 
$(LLDB_PYTHON_TESTSUITE_CC) --arch $(LLDB_PYTHON_TESTSUITE_ARCH) --filecheck 
$(LLVM_BUILD_DIR)/x86_64/bin/FileCheck --session-file-format fm 
--results-formatter lldbsuite.test_event.formatter.xunit.XunitFormatter 
--build-dir $(BUILD_DIR)/lldb-test-build.noindex --results-file 
$(BUILD_DIR)/test-results-$(LLDB_PYTHON_

[Lldb-commits] [lldb] r342699 - [lldbtest] Fix self.filecheck check file lookup

2018-09-20 Thread Vedant Kumar via lldb-commits
Author: vedantk
Date: Thu Sep 20 16:56:39 2018
New Revision: 342699

URL: http://llvm.org/viewvc/llvm-project?rev=342699&view=rev
Log:
[lldbtest] Fix self.filecheck check file lookup

The 'test_filename' property in TestBase changes over time, so
attempting to find a check file relative to the directory containing
'test_filename' is flaky.

Use the absolute path of the check file as that's always correct (and
simpler). This relies on the test driver changing into the test
directory, which it seems we can safely assume.

As a drive-by, make self.filecheck respect the trace (-t) option.

Modified:
lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py

Modified: lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py?rev=342699&r1=342698&r2=342699&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py Thu Sep 20 16:56:39 
2018
@@ -2233,11 +2233,7 @@ class TestBase(Base):
 # a file within the inline test directory.
 if check_file.endswith('.pyc'):
 check_file = check_file[:-1]
-if hasattr(self, 'test_filename'):
-check_file_abs = os.path.join(os.path.dirname(self.test_filename),
-check_file)
-else:
-check_file_abs = os.path.abspath(check_file)
+check_file_abs = os.path.abspath(check_file)
 
 # Run FileCheck.
 filecheck_bin = configuration.get_filecheck_path()
@@ -2248,10 +2244,9 @@ class TestBase(Base):
 cmd_stdout, cmd_stderr = subproc.communicate(input=output)
 cmd_status = subproc.returncode
 
-if cmd_status != 0:
-filecheck_cmd = " ".join(filecheck_args)
-self.assertTrue(cmd_status == 0, """
 FileCheck failed (code={0}) ---
+filecheck_cmd = " ".join(filecheck_args)
+filecheck_trace = """
+--- FileCheck trace (code={0}) ---
 {1}
 
 FileCheck input:
@@ -2260,7 +2255,13 @@ FileCheck input:
 FileCheck output:
 {3}
 {4}
-""".format(cmd_status, filecheck_cmd, output, cmd_stdout, cmd_stderr))
+""".format(cmd_status, filecheck_cmd, output, cmd_stdout, cmd_stderr)
+
+trace = cmd_status != 0 or traceAlways
+with recording(self, trace) as sbuf:
+print(filecheck_trace, file=sbuf)
+
+self.assertTrue(cmd_status == 0)
 
 def expect(
 self,


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


[Lldb-commits] [lldb] r319595 - Fix warnings in DNBDataRef.cpp, NFC

2017-12-01 Thread Vedant Kumar via lldb-commits
Author: vedantk
Date: Fri Dec  1 15:24:12 2017
New Revision: 319595

URL: http://llvm.org/viewvc/llvm-project?rev=319595&view=rev
Log:
Fix warnings in DNBDataRef.cpp, NFC

Modified:
lldb/trunk/tools/debugserver/source/DNBDataRef.cpp

Modified: lldb/trunk/tools/debugserver/source/DNBDataRef.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/DNBDataRef.cpp?rev=319595&r1=319594&r2=319595&view=diff
==
--- lldb/trunk/tools/debugserver/source/DNBDataRef.cpp (original)
+++ lldb/trunk/tools/debugserver/source/DNBDataRef.cpp Fri Dec  1 15:24:12 2017
@@ -60,7 +60,7 @@ uint16_t DNBDataRef::Get16(offset_t *off
   uint16_t val = 0;
   if (ValidOffsetForDataOfSize(*offset_ptr, sizeof(val))) {
 const uint8_t *p = m_start + *offset_ptr;
-val = *(uint16_t *)p;
+memcpy(&val, p, sizeof(uint16_t));
 
 if (m_swap)
   val = OSSwapInt16(val);
@@ -78,7 +78,7 @@ uint32_t DNBDataRef::Get32(offset_t *off
   uint32_t val = 0;
   if (ValidOffsetForDataOfSize(*offset_ptr, sizeof(val))) {
 const uint8_t *p = m_start + *offset_ptr;
-val = *(uint32_t *)p;
+memcpy(&val, p, sizeof(uint32_t));
 if (m_swap)
   val = OSSwapInt32(val);
 
@@ -95,7 +95,7 @@ uint64_t DNBDataRef::Get64(offset_t *off
   uint64_t val = 0;
   if (ValidOffsetForDataOfSize(*offset_ptr, sizeof(val))) {
 const uint8_t *p = m_start + *offset_ptr;
-val = *(uint64_t *)p;
+memcpy(&val, p, sizeof(uint64_t));
 if (m_swap)
   val = OSSwapInt64(val);
 
@@ -123,7 +123,7 @@ uint32_t DNBDataRef::GetMax32(offset_t *
 return Get32(offset_ptr);
 break;
   default:
-assert(!"GetMax32 unhandled case!");
+assert(false && "GetMax32 unhandled case!");
 break;
   }
   return 0;
@@ -150,7 +150,7 @@ uint64_t DNBDataRef::GetMax64(offset_t *
 return Get64(offset_ptr);
 break;
   default:
-assert(!"GetMax64 unhandled case!");
+assert(false && "GetMax64 unhandled case!");
 break;
   }
   return 0;
@@ -174,7 +174,7 @@ const char *DNBDataRef::GetCStr(offset_t
 uint32_t fixed_length) const {
   const char *s = NULL;
   if (m_start < m_end) {
-s = (char *)m_start + *offset_ptr;
+s = (const char *)m_start + *offset_ptr;
 
 // Advance the offset
 if (fixed_length)


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


[Lldb-commits] [lldb] r319596 - Fix warnings in JSON.cpp, NFC

2017-12-01 Thread Vedant Kumar via lldb-commits
Author: vedantk
Date: Fri Dec  1 15:29:04 2017
New Revision: 319596

URL: http://llvm.org/viewvc/llvm-project?rev=319596&view=rev
Log:
Fix warnings in JSON.cpp, NFC

These asserts are no-ops, and are supplanted by -Wcovered-switch.

Modified:
lldb/trunk/tools/debugserver/source/JSON.cpp

Modified: lldb/trunk/tools/debugserver/source/JSON.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/JSON.cpp?rev=319596&r1=319595&r2=319596&view=diff
==
--- lldb/trunk/tools/debugserver/source/JSON.cpp (original)
+++ lldb/trunk/tools/debugserver/source/JSON.cpp Fri Dec  1 15:29:04 2017
@@ -58,7 +58,6 @@ uint64_t JSONNumber::GetAsUnsigned() con
   case DataType::Double:
 return (uint64_t)m_data.m_double;
   }
-  assert("Unhandled data type");
 }
 
 int64_t JSONNumber::GetAsSigned() const {
@@ -70,7 +69,6 @@ int64_t JSONNumber::GetAsSigned() const
   case DataType::Double:
 return (int64_t)m_data.m_double;
   }
-  assert("Unhandled data type");
 }
 
 double JSONNumber::GetAsDouble() const {
@@ -82,7 +80,6 @@ double JSONNumber::GetAsDouble() const {
   case DataType::Double:
 return m_data.m_double;
   }
-  assert("Unhandled data type");
 }
 
 void JSONNumber::Write(std::ostream &s) {


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


[Lldb-commits] [lldb] r319597 - Fix warning in DynamicLoaderDarwinKernel.cpp, NFC

2017-12-01 Thread Vedant Kumar via lldb-commits
Author: vedantk
Date: Fri Dec  1 15:53:01 2017
New Revision: 319597

URL: http://llvm.org/viewvc/llvm-project?rev=319597&view=rev
Log:
Fix warning in DynamicLoaderDarwinKernel.cpp, NFC

Modified:

lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp

Modified: 
lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp?rev=319597&r1=319596&r2=319597&view=diff
==
--- 
lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
 (original)
+++ 
lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
 Fri Dec  1 15:53:01 2017
@@ -1407,7 +1407,7 @@ bool DynamicLoaderDarwinKernel::ReadAllK
 void DynamicLoaderDarwinKernel::KextImageInfo::PutToLog(Log *log) const {
   if (log == NULL)
 return;
-  const uint8_t *u = (uint8_t *)m_uuid.GetBytes();
+  const uint8_t *u = (const uint8_t *)m_uuid.GetBytes();
 
   if (m_load_address == LLDB_INVALID_ADDRESS) {
 if (u) {


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


Re: [Lldb-commits] [PATCH] D40821: Fix const-correctness in RegisterContext methods, NFC

2017-12-04 Thread Vedant Kumar via lldb-commits

> On Dec 4, 2017, at 6:02 PM, Zachary Turner  wrote:
> 
> It almost looks to me like this should be using aggregation instead of 
> inheritance. That would add a 3rd option (mark it mutable).

I don't have my head wrapped around your suggestion. Do you mean that 'const 
GPR &' and friends should be made mutable members of RegisterContext?

thanks,
vedant

> That said, nothing wrong with using this approach either 
> On Mon, Dec 4, 2017 at 5:43 PM Vedant Kumar via Phabricator via lldb-commits 
> mailto:lldb-commits@lists.llvm.org>> wrote:
> vsk created this revision.
> Herald added a subscriber: javed.absar.
> 
> A few methods in RegisterContext classes accept const objects which are
> cast to a non-const thread_state_t. Instead of dropping const-ness, it
> might be simpler and more ergonomic to just not mark the objects const.
> 
> This fixes a slew of warnings.
> 
> One alternative is to drop const-ness in a C++-friendly way, e.g:
> 
>   const_cast(static_cast(&X))
> 
> This would still leave us in a situation where some RegisterContext
> methods accept const objects and others don't, and it doesn't seem
> feasible to apply const everywhere here, because of non-const methods
> like SetRegisterDataFrom_LC_THREAD.
> 
> 
> https://reviews.llvm.org/D40821 
> 
> Files:
>   source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
>   source/Plugins/Process/MacOSX-Kernel/RegisterContextKDP_arm.cpp
>   source/Plugins/Process/MacOSX-Kernel/RegisterContextKDP_arm.h
>   source/Plugins/Process/MacOSX-Kernel/RegisterContextKDP_arm64.cpp
>   source/Plugins/Process/MacOSX-Kernel/RegisterContextKDP_arm64.h
>   source/Plugins/Process/MacOSX-Kernel/RegisterContextKDP_i386.cpp
>   source/Plugins/Process/MacOSX-Kernel/RegisterContextKDP_i386.h
>   source/Plugins/Process/MacOSX-Kernel/RegisterContextKDP_x86_64.cpp
>   source/Plugins/Process/MacOSX-Kernel/RegisterContextKDP_x86_64.h
>   source/Plugins/Process/Utility/RegisterContextDarwin_arm.h
>   source/Plugins/Process/Utility/RegisterContextDarwin_arm64.h
>   source/Plugins/Process/Utility/RegisterContextDarwin_i386.h
>   source/Plugins/Process/Utility/RegisterContextDarwin_x86_64.h
>   source/Plugins/Process/Utility/RegisterContextMach_arm.cpp
>   source/Plugins/Process/Utility/RegisterContextMach_arm.h
>   source/Plugins/Process/Utility/RegisterContextMach_i386.cpp
>   source/Plugins/Process/Utility/RegisterContextMach_i386.h
>   source/Plugins/Process/Utility/RegisterContextMach_x86_64.cpp
>   source/Plugins/Process/Utility/RegisterContextMach_x86_64.h
> 
> ___
> lldb-commits mailing list
> lldb-commits@lists.llvm.org 
> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits 
> 

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


[Lldb-commits] [lldb] r319939 - Fix const-correctness in RegisterContext methods, NFC

2017-12-06 Thread Vedant Kumar via lldb-commits
Author: vedantk
Date: Wed Dec  6 11:21:12 2017
New Revision: 319939

URL: http://llvm.org/viewvc/llvm-project?rev=319939&view=rev
Log:
Fix const-correctness in RegisterContext methods, NFC

A few methods in RegisterContext classes accept const objects which are
cast to a non-const thread_state_t. Drop const-ness more explicitly
where we mean to do so. This fixes a slew of warnings.

Differential Revision: https://reviews.llvm.org/D40821

Modified:
lldb/trunk/source/Plugins/Process/Utility/RegisterContextMach_arm.cpp
lldb/trunk/source/Plugins/Process/Utility/RegisterContextMach_i386.cpp
lldb/trunk/source/Plugins/Process/Utility/RegisterContextMach_x86_64.cpp

Modified: lldb/trunk/source/Plugins/Process/Utility/RegisterContextMach_arm.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/RegisterContextMach_arm.cpp?rev=319939&r1=319938&r2=319939&view=diff
==
--- lldb/trunk/source/Plugins/Process/Utility/RegisterContextMach_arm.cpp 
(original)
+++ lldb/trunk/source/Plugins/Process/Utility/RegisterContextMach_arm.cpp Wed 
Dec  6 11:21:12 2017
@@ -50,22 +50,30 @@ int RegisterContextMach_arm::DoReadDBG(l
 
 int RegisterContextMach_arm::DoWriteGPR(lldb::tid_t tid, int flavor,
 const GPR &gpr) {
-  return ::thread_set_state(tid, flavor, (thread_state_t)&gpr, GPRWordCount);
+  return ::thread_set_state(
+  tid, flavor, reinterpret_cast(const_cast(&gpr)),
+  GPRWordCount);
 }
 
 int RegisterContextMach_arm::DoWriteFPU(lldb::tid_t tid, int flavor,
 const FPU &fpu) {
-  return ::thread_set_state(tid, flavor, (thread_state_t)&fpu, FPUWordCount);
+  return ::thread_set_state(
+  tid, flavor, reinterpret_cast(const_cast(&fpu)),
+  FPUWordCount);
 }
 
 int RegisterContextMach_arm::DoWriteEXC(lldb::tid_t tid, int flavor,
 const EXC &exc) {
-  return ::thread_set_state(tid, flavor, (thread_state_t)&exc, EXCWordCount);
+  return ::thread_set_state(
+  tid, flavor, reinterpret_cast(const_cast(&exc)),
+  EXCWordCount);
 }
 
 int RegisterContextMach_arm::DoWriteDBG(lldb::tid_t tid, int flavor,
 const DBG &dbg) {
-  return ::thread_set_state(tid, flavor, (thread_state_t)&dbg, DBGWordCount);
+  return ::thread_set_state(
+  tid, flavor, reinterpret_cast(const_cast(&dbg)),
+  DBGWordCount);
 }
 
 #endif

Modified: lldb/trunk/source/Plugins/Process/Utility/RegisterContextMach_i386.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/RegisterContextMach_i386.cpp?rev=319939&r1=319938&r2=319939&view=diff
==
--- lldb/trunk/source/Plugins/Process/Utility/RegisterContextMach_i386.cpp 
(original)
+++ lldb/trunk/source/Plugins/Process/Utility/RegisterContextMach_i386.cpp Wed 
Dec  6 11:21:12 2017
@@ -43,17 +43,23 @@ int RegisterContextMach_i386::DoReadEXC(
 
 int RegisterContextMach_i386::DoWriteGPR(lldb::tid_t tid, int flavor,
  const GPR &gpr) {
-  return ::thread_set_state(tid, flavor, (thread_state_t)&gpr, GPRWordCount);
+  return ::thread_set_state(
+  tid, flavor, reinterpret_cast(const_cast(&gpr)),
+  GPRWordCount);
 }
 
 int RegisterContextMach_i386::DoWriteFPU(lldb::tid_t tid, int flavor,
  const FPU &fpu) {
-  return ::thread_set_state(tid, flavor, (thread_state_t)&fpu, FPUWordCount);
+  return ::thread_set_state(
+  tid, flavor, reinterpret_cast(const_cast(&fpu)),
+  FPUWordCount);
 }
 
 int RegisterContextMach_i386::DoWriteEXC(lldb::tid_t tid, int flavor,
  const EXC &exc) {
-  return ::thread_set_state(tid, flavor, (thread_state_t)&exc, EXCWordCount);
+  return ::thread_set_state(
+  tid, flavor, reinterpret_cast(const_cast(&exc)),
+  EXCWordCount);
 }
 
 #endif

Modified: 
lldb/trunk/source/Plugins/Process/Utility/RegisterContextMach_x86_64.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/RegisterContextMach_x86_64.cpp?rev=319939&r1=319938&r2=319939&view=diff
==
--- lldb/trunk/source/Plugins/Process/Utility/RegisterContextMach_x86_64.cpp 
(original)
+++ lldb/trunk/source/Plugins/Process/Utility/RegisterContextMach_x86_64.cpp 
Wed Dec  6 11:21:12 2017
@@ -46,17 +46,23 @@ int RegisterContextMach_x86_64::DoReadEX
 
 int RegisterContextMach_x86_64::DoWriteGPR(lldb::tid_t tid, int flavor,
const GPR &gpr) {
-  return ::thread_set_state(tid, flavor, (thread_state_t)&gpr, GPRWordCount);
+  return ::thread_set_state(
+  tid, flavor, reinterpret_cast(const_cast(&gpr)),
+  GPRWordCount);
 }
 
 int RegisterContextMa

[Lldb-commits] [lldb] r319937 - Fix misc -Wcast-qual warnings, NFC

2017-12-06 Thread Vedant Kumar via lldb-commits
Author: vedantk
Date: Wed Dec  6 11:21:11 2017
New Revision: 319937

URL: http://llvm.org/viewvc/llvm-project?rev=319937&view=rev
Log:
Fix misc -Wcast-qual warnings, NFC

Modified:
lldb/trunk/tools/debugserver/source/MacOSX/MachProcess.mm
lldb/trunk/tools/debugserver/source/MacOSX/MachTask.mm
lldb/trunk/tools/debugserver/source/MacOSX/i386/DNBArchImplI386.cpp
lldb/trunk/tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.cpp
lldb/trunk/tools/debugserver/source/RNBRemote.cpp
lldb/trunk/tools/debugserver/source/RNBServices.cpp
lldb/trunk/tools/debugserver/source/RNBSocket.cpp

Modified: lldb/trunk/tools/debugserver/source/MacOSX/MachProcess.mm
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/MacOSX/MachProcess.mm?rev=319937&r1=319936&r2=319937&view=diff
==
--- lldb/trunk/tools/debugserver/source/MacOSX/MachProcess.mm (original)
+++ lldb/trunk/tools/debugserver/source/MacOSX/MachProcess.mm Wed Dec  6 
11:21:11 2017
@@ -3147,7 +3147,8 @@ pid_t MachProcess::PosixSpawnChildForPTr
   ::chdir(working_directory);
 
 err.SetError(::posix_spawnp(&pid, path, &file_actions, &attr,
-(char *const *)argv, (char *const *)envp),
+const_cast(argv),
+const_cast(envp)),
  DNBError::POSIX);
 if (err.Fail() || DNBLogCheckLogBit(LOG_PROCESS))
   err.LogThreaded("::posix_spawnp ( pid => %i, path = '%s', file_actions = 
"
@@ -3159,8 +3160,9 @@ pid_t MachProcess::PosixSpawnChildForPTr
 if (working_directory)
   ::chdir(working_directory);
 
-err.SetError(::posix_spawnp(&pid, path, NULL, &attr, (char *const *)argv,
-(char *const *)envp),
+err.SetError(::posix_spawnp(&pid, path, NULL, &attr,
+const_cast(argv),
+const_cast(envp)),
  DNBError::POSIX);
 if (err.Fail() || DNBLogCheckLogBit(LOG_PROCESS))
   err.LogThreaded("::posix_spawnp ( pid => %i, path = '%s', file_actions = 
"
@@ -3257,7 +3259,7 @@ pid_t MachProcess::ForkChildForPTraceDeb
   ::sleep(1);
 
   // Turn this process into
-  ::execv(path, (char *const *)argv);
+  ::execv(path, const_cast(argv));
 }
 // Exit with error code. Child process should have taken
 // over in above exec call and if the exec fails it will

Modified: lldb/trunk/tools/debugserver/source/MacOSX/MachTask.mm
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/MacOSX/MachTask.mm?rev=319937&r1=319936&r2=319937&view=diff
==
--- lldb/trunk/tools/debugserver/source/MacOSX/MachTask.mm (original)
+++ lldb/trunk/tools/debugserver/source/MacOSX/MachTask.mm Wed Dec  6 11:21:11 
2017
@@ -188,7 +188,7 @@ nub_size_t MachTask::WriteMemory(nub_add
  (uint64_t)addr, (uint64_t)size, buf, (uint64_t)n);
 if (DNBLogCheckLogBit(LOG_MEMORY_DATA_LONG) ||
 (DNBLogCheckLogBit(LOG_MEMORY_DATA_SHORT) && size <= 8)) {
-  DNBDataRef data((uint8_t *)buf, n, false);
+  DNBDataRef data((const uint8_t *)buf, n, false);
   data.Dump(0, static_cast(n), addr,
 DNBDataRef::TypeUInt8, 16);
 }

Modified: lldb/trunk/tools/debugserver/source/MacOSX/i386/DNBArchImplI386.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/MacOSX/i386/DNBArchImplI386.cpp?rev=319937&r1=319936&r2=319937&view=diff
==
--- lldb/trunk/tools/debugserver/source/MacOSX/i386/DNBArchImplI386.cpp 
(original)
+++ lldb/trunk/tools/debugserver/source/MacOSX/i386/DNBArchImplI386.cpp Wed Dec 
 6 11:21:11 2017
@@ -1886,7 +1886,7 @@ nub_size_t DNBArchImplI386::SetRegisterC
 if (size > buf_len)
   size = buf_len;
 
-uint8_t *p = (uint8_t *)buf;
+const uint8_t *p = (const uint8_t *)buf;
 // Copy the GPR registers
 memcpy(&m_state.context.gpr, p, sizeof(GPR));
 p += sizeof(GPR);
@@ -1927,7 +1927,7 @@ nub_size_t DNBArchImplI386::SetRegisterC
 p += sizeof(EXC);
 
 // make sure we end up with exactly what we think we should have
-size_t bytes_written = p - (uint8_t *)buf;
+size_t bytes_written = p - (const uint8_t *)buf;
 UNUSED_IF_ASSERT_DISABLED(bytes_written);
 assert(bytes_written == size);
 kern_return_t kret;

Modified: 
lldb/trunk/tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.cpp?rev=319937&r1=319936&r2=319937&view=diff
==
--- lldb/trunk/tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.cpp 
(original)
+++ lldb/trunk/tools/debugserver

[Lldb-commits] [lldb] r319938 - Fix an -Wunused-function warning, NFC

2017-12-06 Thread Vedant Kumar via lldb-commits
Author: vedantk
Date: Wed Dec  6 11:21:11 2017
New Revision: 319938

URL: http://llvm.org/viewvc/llvm-project?rev=319938&view=rev
Log:
Fix an -Wunused-function warning, NFC

Modified:
lldb/trunk/tools/debugserver/source/MacOSX/MachProcess.mm

Modified: lldb/trunk/tools/debugserver/source/MacOSX/MachProcess.mm
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/MacOSX/MachProcess.mm?rev=319938&r1=319937&r2=319938&view=diff
==
--- lldb/trunk/tools/debugserver/source/MacOSX/MachProcess.mm (original)
+++ lldb/trunk/tools/debugserver/source/MacOSX/MachProcess.mm Wed Dec  6 
11:21:11 2017
@@ -45,26 +45,6 @@
 #include "CFBundle.h"
 #include "CFString.h"
 
-static void SplitEventData(const char *data, std::vector 
&elements)
-{
-  elements.clear();
-  if (!data)
-return;
-
-  const char *start = data;
-
-  while (*start != '\0') {
-const char *token = strchr(start, ':');
-if (!token) {
-  elements.push_back(std::string(start));
-  return;
-}
-if (token != start)
-  elements.push_back(std::string(start, token - start));
-start = ++token;
-  }
-}
-
 #ifdef WITH_SPRINGBOARD
 
 #include 
@@ -210,6 +190,28 @@ static bool CallBoardSystemServiceOpenAp
 }
 #endif
 
+#if defined(WITH_FBS) || defined(WITH_FBS)
+static void SplitEventData(const char *data, std::vector 
&elements)
+{
+  elements.clear();
+  if (!data)
+return;
+
+  const char *start = data;
+
+  while (*start != '\0') {
+const char *token = strchr(start, ':');
+if (!token) {
+  elements.push_back(std::string(start));
+  return;
+}
+if (token != start)
+  elements.push_back(std::string(start, token - start));
+start = ++token;
+  }
+}
+#endif
+
 #ifdef WITH_BKS
 #import 
 extern "C" {


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


[Lldb-commits] [lldb] r319936 - Remove no-op function pointer null checks, NFC

2017-12-06 Thread Vedant Kumar via lldb-commits
Author: vedantk
Date: Wed Dec  6 11:21:10 2017
New Revision: 319936

URL: http://llvm.org/viewvc/llvm-project?rev=319936&view=rev
Log:
Remove no-op function pointer null checks, NFC

Null-checking functions which aren't marked weak_import is a no-op
(the compiler rewrites the check to 'true'), regardless of whether a
library providing its definition is weak-linked. If the deployment
target is greater than the minimum requirement, the availability markup
on APIs does not lower to weak_import.

Remove no-op null checks to clean up the code and silence warnings.

Differential Revision: https://reviews.llvm.org/D40812

Modified:
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp

lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
lldb/trunk/tools/debugserver/source/MacOSX/OsLogger.cpp
lldb/trunk/tools/debugserver/source/RNBRemote.cpp

Modified: 
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp?rev=319936&r1=319935&r2=319936&view=diff
==
--- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp 
(original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp Wed 
Dec  6 11:21:10 2017
@@ -600,10 +600,9 @@ bool GDBRemoteCommunication::DecompressP
 #if defined(HAVE_LIBCOMPRESSION)
   // libcompression is weak linked so check that compression_decode_buffer() is
   // available
-  if (compression_decode_buffer != NULL &&
-  (m_compression_type == CompressionType::ZlibDeflate ||
-   m_compression_type == CompressionType::LZFSE ||
-   m_compression_type == CompressionType::LZ4)) {
+  if (m_compression_type == CompressionType::ZlibDeflate ||
+  m_compression_type == CompressionType::LZFSE ||
+  m_compression_type == CompressionType::LZ4) {
 compression_algorithm compression_type;
 if (m_compression_type == CompressionType::LZFSE)
   compression_type = COMPRESSION_LZFSE;

Modified: 
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp?rev=319936&r1=319935&r2=319936&view=diff
==
--- 
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp 
(original)
+++ 
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp 
Wed Dec  6 11:21:10 2017
@@ -1022,10 +1022,7 @@ void GDBRemoteCommunicationClient::Maybe
   std::string avail_name;
 
 #if defined(HAVE_LIBCOMPRESSION)
-  // libcompression is weak linked so test if compression_decode_buffer() is
-  // available
-  if (compression_decode_buffer != NULL &&
-  avail_type == CompressionType::None) {
+  if (avail_type == CompressionType::None) {
 for (auto compression : supported_compressions) {
   if (compression == "lzfse") {
 avail_type = CompressionType::LZFSE;
@@ -1037,10 +1034,7 @@ void GDBRemoteCommunicationClient::Maybe
 #endif
 
 #if defined(HAVE_LIBCOMPRESSION)
-  // libcompression is weak linked so test if compression_decode_buffer() is
-  // available
-  if (compression_decode_buffer != NULL &&
-  avail_type == CompressionType::None) {
+  if (avail_type == CompressionType::None) {
 for (auto compression : supported_compressions) {
   if (compression == "zlib-deflate") {
 avail_type = CompressionType::ZlibDeflate;
@@ -1064,10 +1058,7 @@ void GDBRemoteCommunicationClient::Maybe
 #endif
 
 #if defined(HAVE_LIBCOMPRESSION)
-  // libcompression is weak linked so test if compression_decode_buffer() is
-  // available
-  if (compression_decode_buffer != NULL &&
-  avail_type == CompressionType::None) {
+  if (avail_type == CompressionType::None) {
 for (auto compression : supported_compressions) {
   if (compression == "lz4") {
 avail_type = CompressionType::LZ4;
@@ -1079,10 +1070,7 @@ void GDBRemoteCommunicationClient::Maybe
 #endif
 
 #if defined(HAVE_LIBCOMPRESSION)
-  // libcompression is weak linked so test if compression_decode_buffer() is
-  // available
-  if (compression_decode_buffer != NULL &&
-  avail_type == CompressionType::None) {
+  if (avail_type == CompressionType::None) {
 for (auto compression : supported_compressions) {
   if (compression == "lzma") {
 avail_type = CompressionType::LZMA;

Modified: lldb/trunk/tools/debugserver/source/MacOSX/OsLogger.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/MacOSX/OsLogger.cpp?rev=319936&r1=319935&r2=319936&view=diff
==
--- lldb/trunk/tools/debugserver/source/MacOSX/OsLogger.cpp (original)
+++ lldb/trunk/tools/debugserver/source/M

[Lldb-commits] [lldb] r319934 - [MappedHash] Fix alignment violations

2017-12-06 Thread Vedant Kumar via lldb-commits
Author: vedantk
Date: Wed Dec  6 11:21:08 2017
New Revision: 319934

URL: http://llvm.org/viewvc/llvm-project?rev=319934&view=rev
Log:
[MappedHash] Fix alignment violations

This fixes a few alignment problems pointed out by UBSan, and is
otherwise NFC.

Modified:
lldb/trunk/include/lldb/Core/MappedHash.h

Modified: lldb/trunk/include/lldb/Core/MappedHash.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/MappedHash.h?rev=319934&r1=319933&r2=319934&view=diff
==
--- lldb/trunk/include/lldb/Core/MappedHash.h (original)
+++ lldb/trunk/include/lldb/Core/MappedHash.h Wed Dec  6 11:21:08 2017
@@ -357,21 +357,24 @@ public:
 }
 
 uint32_t GetHashIndex(uint32_t bucket_idx) const {
+  uint32_t result = UINT32_MAX;
   if (m_hash_indexes && bucket_idx < m_header.bucket_count)
-return m_hash_indexes[bucket_idx];
-  return UINT32_MAX;
+memcpy(&result, m_hash_indexes + bucket_idx, sizeof(uint32_t));
+  return result;
 }
 
 uint32_t GetHashValue(uint32_t hash_idx) const {
+  uint32_t result = UINT32_MAX;
   if (m_hash_values && hash_idx < m_header.hashes_count)
-return m_hash_values[hash_idx];
-  return UINT32_MAX;
+memcpy(&result, m_hash_values + hash_idx, sizeof(uint32_t));
+  return result;
 }
 
 uint32_t GetHashDataOffset(uint32_t hash_idx) const {
+  uint32_t result = UINT32_MAX;
   if (m_hash_offsets && hash_idx < m_header.hashes_count)
-return m_hash_offsets[hash_idx];
-  return UINT32_MAX;
+memcpy(&result, m_hash_offsets + hash_idx, sizeof(uint32_t));
+  return result;
 }
 
 bool Find(const char *name, Pair &pair) const {


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


[Lldb-commits] [lldb] r319935 - Use a static_cast instead of a C cast, NFC

2017-12-06 Thread Vedant Kumar via lldb-commits
Author: vedantk
Date: Wed Dec  6 11:21:09 2017
New Revision: 319935

URL: http://llvm.org/viewvc/llvm-project?rev=319935&view=rev
Log:
Use a static_cast instead of a C cast, NFC

Pointed out by Davide Italiano in post-commit review.

Modified:

lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp

Modified: 
lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp?rev=319935&r1=319934&r2=319935&view=diff
==
--- 
lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
 (original)
+++ 
lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
 Wed Dec  6 11:21:09 2017
@@ -1407,7 +1407,7 @@ bool DynamicLoaderDarwinKernel::ReadAllK
 void DynamicLoaderDarwinKernel::KextImageInfo::PutToLog(Log *log) const {
   if (log == NULL)
 return;
-  const uint8_t *u = (const uint8_t *)m_uuid.GetBytes();
+  const uint8_t *u = static_cast(m_uuid.GetBytes());
 
   if (m_load_address == LLDB_INVALID_ADDRESS) {
 if (u) {


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


Re: [Lldb-commits] [lldb] r319597 - Fix warning in DynamicLoaderDarwinKernel.cpp, NFC

2017-12-06 Thread Vedant Kumar via lldb-commits

> On Dec 2, 2017, at 12:22 PM, Davide Italiano  wrote:
> 
> On Fri, Dec 1, 2017 at 3:53 PM, Vedant Kumar via lldb-commits
>  wrote:
>> Author: vedantk
>> Date: Fri Dec  1 15:53:01 2017
>> New Revision: 319597
>> 
>> URL: http://llvm.org/viewvc/llvm-project?rev=319597&view=rev
>> Log:
>> Fix warning in DynamicLoaderDarwinKernel.cpp, NFC
>> 
>> Modified:
>>
>> lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
>> 
>> Modified: 
>> lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
>> URL: 
>> http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp?rev=319597&r1=319596&r2=319597&view=diff
>> ==
>> --- 
>> lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
>>  (original)
>> +++ 
>> lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
>>  Fri Dec  1 15:53:01 2017
>> @@ -1407,7 +1407,7 @@ bool DynamicLoaderDarwinKernel::ReadAllK
>> void DynamicLoaderDarwinKernel::KextImageInfo::PutToLog(Log *log) const {
>>   if (log == NULL)
>> return;
>> -  const uint8_t *u = (uint8_t *)m_uuid.GetBytes();
>> +  const uint8_t *u = (const uint8_t *)m_uuid.GetBytes();
>> 
> 
> Nit: I'd rather use static_cast<> :)

Yes, done in r319935.

> 
>>   if (m_load_address == LLDB_INVALID_ADDRESS) {
>> if (u) {
>> 
>> 
>> ___
>> lldb-commits mailing list
>> lldb-commits@lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

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


[Lldb-commits] [lldb] r319943 - Fix the -Wunused-function warning properly (MachProcess.mm)

2017-12-06 Thread Vedant Kumar via lldb-commits
Author: vedantk
Date: Wed Dec  6 11:27:20 2017
New Revision: 319943

URL: http://llvm.org/viewvc/llvm-project?rev=319943&view=rev
Log:
Fix the -Wunused-function warning properly (MachProcess.mm)

r319938 was not NFC, because it got the preprocessor guard wrong. Check
WITH_FBS and WITH_BKS before defining SplitEventData.

Modified:
lldb/trunk/tools/debugserver/source/MacOSX/MachProcess.mm

Modified: lldb/trunk/tools/debugserver/source/MacOSX/MachProcess.mm
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/MacOSX/MachProcess.mm?rev=319943&r1=319942&r2=319943&view=diff
==
--- lldb/trunk/tools/debugserver/source/MacOSX/MachProcess.mm (original)
+++ lldb/trunk/tools/debugserver/source/MacOSX/MachProcess.mm Wed Dec  6 
11:27:20 2017
@@ -190,7 +190,7 @@ static bool CallBoardSystemServiceOpenAp
 }
 #endif
 
-#if defined(WITH_FBS) || defined(WITH_FBS)
+#if defined(WITH_BKS) || defined(WITH_FBS)
 static void SplitEventData(const char *data, std::vector 
&elements)
 {
   elements.clear();


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


[Lldb-commits] [lldb] r320071 - Disable warnings related to anonymous types in the ObjC plugin

2017-12-07 Thread Vedant Kumar via lldb-commits
Author: vedantk
Date: Thu Dec  7 10:57:09 2017
New Revision: 320071

URL: http://llvm.org/viewvc/llvm-project?rev=320071&view=rev
Log:
Disable warnings related to anonymous types in the ObjC plugin

This part of lldb make use of anonymous structs and unions. The usage is
idiomatic and doesn't deserve a warning. Logic in the NSDictionary and NSSet
plugins use anonymous structs in a manner consistent with the relevant Apple
frameworks.

Differential Revision: https://reviews.llvm.org/D40757

Modified:
lldb/trunk/cmake/modules/AddLLDB.cmake
lldb/trunk/cmake/modules/LLDBConfig.cmake
lldb/trunk/source/Plugins/Language/ObjC/CMakeLists.txt

Modified: lldb/trunk/cmake/modules/AddLLDB.cmake
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/cmake/modules/AddLLDB.cmake?rev=320071&r1=320070&r2=320071&view=diff
==
--- lldb/trunk/cmake/modules/AddLLDB.cmake (original)
+++ lldb/trunk/cmake/modules/AddLLDB.cmake Thu Dec  7 10:57:09 2017
@@ -4,7 +4,7 @@ function(add_lldb_library name)
   cmake_parse_arguments(PARAM
 "MODULE;SHARED;STATIC;OBJECT;PLUGIN"
 ""
-"DEPENDS;LINK_LIBS;LINK_COMPONENTS"
+"EXTRA_CXXFLAGS;DEPENDS;LINK_LIBS;LINK_COMPONENTS"
 ${ARGN})
   llvm_process_sources(srcs ${PARAM_UNPARSED_ARGUMENTS})
   list(APPEND LLVM_LINK_COMPONENTS ${PARAM_LINK_COMPONENTS})
@@ -35,6 +35,8 @@ function(add_lldb_library name)
   endif()
 
   #PIC not needed on Win
+  # FIXME: Setting CMAKE_CXX_FLAGS here is a no-op, use target_compile_options
+  # or omit this logic instead.
   if (NOT WIN32)
 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
   endif()
@@ -78,6 +80,9 @@ function(add_lldb_library name)
   # headers without negatively impacting much of anything.
   add_dependencies(${name} clang-tablegen-targets)
 
+  # Add in any extra C++ compilation flags for this library.
+  target_compile_options(${name} PRIVATE ${PARAM_EXTRA_CXXFLAGS})
+
   set_target_properties(${name} PROPERTIES FOLDER "lldb libraries")
 endfunction(add_lldb_library)
 

Modified: lldb/trunk/cmake/modules/LLDBConfig.cmake
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/cmake/modules/LLDBConfig.cmake?rev=320071&r1=320070&r2=320071&view=diff
==
--- lldb/trunk/cmake/modules/LLDBConfig.cmake (original)
+++ lldb/trunk/cmake/modules/LLDBConfig.cmake Thu Dec  7 10:57:09 2017
@@ -231,6 +231,12 @@ if (CXX_SUPPORTS_NO_VLA_EXTENSION)
   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-vla-extension")
 endif ()
 
+check_cxx_compiler_flag("-Wno-gnu-anonymous-struct"
+CXX_SUPPORTS_NO_GNU_ANONYMOUS_STRUCT)
+
+check_cxx_compiler_flag("-Wno-nested-anon-types"
+CXX_SUPPORTS_NO_NESTED_ANON_TYPES)
+
 # Disable MSVC warnings
 if( MSVC )
   add_definitions(

Modified: lldb/trunk/source/Plugins/Language/ObjC/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Language/ObjC/CMakeLists.txt?rev=320071&r1=320070&r2=320071&view=diff
==
--- lldb/trunk/source/Plugins/Language/ObjC/CMakeLists.txt (original)
+++ lldb/trunk/source/Plugins/Language/ObjC/CMakeLists.txt Thu Dec  7 10:57:09 
2017
@@ -1,3 +1,13 @@
+set(EXTRA_CXXFLAGS "")
+
+if (CXX_SUPPORTS_NO_GNU_ANONYMOUS_STRUCT)
+  set(EXTRA_CXXFLAGS ${EXTRA_CXXFLAGS} -Wno-gnu-anonymous-struct)
+endif ()
+
+if (CXX_SUPPORTS_NO_NESTED_ANON_TYPES)
+  set(EXTRA_CXXFLAGS ${EXTRA_CXXFLAGS} -Wno-nested-anon-types)
+endif ()
+
 add_lldb_library(lldbPluginObjCLanguage PLUGIN
   ObjCLanguage.cpp
   CF.cpp
@@ -21,4 +31,6 @@ add_lldb_library(lldbPluginObjCLanguage
 lldbTarget
 lldbUtility
 lldbPluginAppleObjCRuntime
+
+  EXTRA_CXXFLAGS ${EXTRA_CXXFLAGS}
 )


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


[Lldb-commits] [lldb] r320127 - [MachException] Avoid alignment UB, NFC

2017-12-07 Thread Vedant Kumar via lldb-commits
Author: vedantk
Date: Thu Dec  7 17:09:40 2017
New Revision: 320127

URL: http://llvm.org/viewvc/llvm-project?rev=320127&view=rev
Log:
[MachException] Avoid alignment UB, NFC

Fix alignment UB in some Mach exception-handling logic.

This lets us build lldb and debugserver with UBSan in trapping mode, and
get further along in the testing process before a trap is encountered.

rdar://35923991

Modified:
lldb/trunk/tools/debugserver/source/MacOSX/MachException.cpp
lldb/trunk/tools/debugserver/source/MacOSX/MachException.h

Modified: lldb/trunk/tools/debugserver/source/MacOSX/MachException.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/MacOSX/MachException.cpp?rev=320127&r1=320126&r2=320127&view=diff
==
--- lldb/trunk/tools/debugserver/source/MacOSX/MachException.cpp (original)
+++ lldb/trunk/tools/debugserver/source/MacOSX/MachException.cpp Thu Dec  7 
17:09:40 2017
@@ -113,8 +113,7 @@ catch_mach_exception_raise(mach_port_t e
 g_message->task_port = task_port;
 g_message->thread_port = thread_port;
 g_message->exc_type = exc_type;
-for (mach_msg_type_number_t i=0; iexc_data.push_back(exc_data[i]);
+g_message->AppendExceptionData(exc_data, exc_data_count);
 return KERN_SUCCESS;
   } else if (!MachTask::IsValid(g_message->task_port)) {
 // Our original exception port isn't valid anymore check for a SIGTRAP
@@ -126,8 +125,7 @@ catch_mach_exception_raise(mach_port_t e
   g_message->task_port = task_port;
   g_message->thread_port = thread_port;
   g_message->exc_type = exc_type;
-  for (mach_msg_type_number_t i=0; iexc_data.push_back(exc_data[i]);
+  g_message->AppendExceptionData(exc_data, exc_data_count);
   return KERN_SUCCESS;
 }
   }

Modified: lldb/trunk/tools/debugserver/source/MacOSX/MachException.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/MacOSX/MachException.h?rev=320127&r1=320126&r2=320127&view=diff
==
--- lldb/trunk/tools/debugserver/source/MacOSX/MachException.h (original)
+++ lldb/trunk/tools/debugserver/source/MacOSX/MachException.h Thu Dec  7 
17:09:40 2017
@@ -71,6 +71,15 @@ public:
   return (exc_type == EXC_BREAKPOINT ||
   ((exc_type == EXC_SOFTWARE) && exc_data[0] == 1));
 }
+void AppendExceptionData(mach_exception_data_t Data,
+ mach_msg_type_number_t Count) {
+  mach_exception_data_type_t Buf;
+  for (mach_msg_type_number_t i = 0; i < Count; ++i) {
+// Perform an unaligned copy.
+memcpy(&Buf, Data + i, sizeof(mach_exception_data_type_t));
+exc_data.push_back(Buf);
+  }
+}
 void Dump() const;
 void DumpStopReason() const;
 bool GetStopInfo(struct DNBThreadStopInfo *stop_info) const;


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


[Lldb-commits] [lldb] r320126 - Remove extant references to g_message_mutex, NFC

2017-12-07 Thread Vedant Kumar via lldb-commits
Author: vedantk
Date: Thu Dec  7 17:09:39 2017
New Revision: 320126

URL: http://llvm.org/viewvc/llvm-project?rev=320126&view=rev
Log:
Remove extant references to g_message_mutex, NFC

Thanks to Jim Ingham for providing the explanation!

Modified:
lldb/trunk/source/Plugins/Process/Darwin/MachException.cpp
lldb/trunk/tools/debugserver/source/MacOSX/MachException.cpp

Modified: lldb/trunk/source/Plugins/Process/Darwin/MachException.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Darwin/MachException.cpp?rev=320126&r1=320125&r2=320126&view=diff
==
--- lldb/trunk/source/Plugins/Process/Darwin/MachException.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Darwin/MachException.cpp Thu Dec  7 
17:09:39 2017
@@ -57,11 +57,6 @@ extern "C" kern_return_t catch_mach_exce
 extern "C" boolean_t mach_exc_server(mach_msg_header_t *InHeadP,
  mach_msg_header_t *OutHeadP);
 
-// Any access to the g_message variable should be done by locking the
-// g_message_mutex first, using the g_message variable, then unlocking
-// the g_message_mutex. See MachException::Message::CatchExceptionRaise()
-// for sample code.
-
 static MachException::Data *g_message = NULL;
 
 extern "C" kern_return_t catch_mach_exception_raise_state(
@@ -279,9 +274,6 @@ void MachException::Message::Dump(Stream
 
 bool MachException::Message::CatchExceptionRaise(task_t task) {
   bool success = false;
-  // locker will keep a mutex locked until it goes out of scope
-  //PThreadMutex::Locker locker(&g_message_mutex);
-  //DNBLogThreaded("calling  mach_exc_server");
   state.task_port = task;
   g_message = &state;
   // The exc_server function is the MIG generated server handling function

Modified: lldb/trunk/tools/debugserver/source/MacOSX/MachException.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/MacOSX/MachException.cpp?rev=320126&r1=320125&r2=320126&view=diff
==
--- lldb/trunk/tools/debugserver/source/MacOSX/MachException.cpp (original)
+++ lldb/trunk/tools/debugserver/source/MacOSX/MachException.cpp Thu Dec  7 
17:09:39 2017
@@ -47,13 +47,13 @@ extern "C" kern_return_t catch_mach_exce
 extern "C" boolean_t mach_exc_server(mach_msg_header_t *InHeadP,
  mach_msg_header_t *OutHeadP);
 
-// Any access to the g_message variable should be done by locking the
-// g_message_mutex first, using the g_message variable, then unlocking
-// the g_message_mutex. See MachException::Message::CatchExceptionRaise()
-// for sample code.
-
+// Note: g_message points to the storage allocated to catch the data from
+// catching the current exception raise. It's populated when we catch a raised
+// exception which can't immediately be replied to.
+//
+// If it becomes possible to catch exceptions from multiple threads
+// simultaneously, accesses to g_message would need to be mutually exclusive.
 static MachException::Data *g_message = NULL;
-// static pthread_mutex_t g_message_mutex = PTHREAD_MUTEX_INITIALIZER;
 
 extern "C" kern_return_t catch_mach_exception_raise_state(
 mach_port_t exc_port, exception_type_t exc_type,
@@ -272,9 +272,6 @@ kern_return_t MachException::Message::Re
 
 bool MachException::Message::CatchExceptionRaise(task_t task) {
   bool success = false;
-  // locker will keep a mutex locked until it goes out of scope
-  //PThreadMutex::Locker locker(&g_message_mutex);
-  //DNBLogThreaded("calling  mach_exc_server");
   state.task_port = task;
   g_message = &state;
   // The exc_server function is the MIG generated server handling function


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


[Lldb-commits] [lldb] r320456 - Avoid module import in a textual header, NFC

2017-12-11 Thread Vedant Kumar via lldb-commits
Author: vedantk
Date: Mon Dec 11 19:27:13 2017
New Revision: 320456

URL: http://llvm.org/viewvc/llvm-project?rev=320456&view=rev
Log:
Avoid module import in a textual header, NFC

This unbreaks the lldb modules build (-DLLVM_ENABLE_MODULES=On).

Modified:
lldb/trunk/source/Plugins/Process/Utility/RegisterInfos_x86_64.h

Modified: lldb/trunk/source/Plugins/Process/Utility/RegisterInfos_x86_64.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/RegisterInfos_x86_64.h?rev=320456&r1=320455&r2=320456&view=diff
==
--- lldb/trunk/source/Plugins/Process/Utility/RegisterInfos_x86_64.h (original)
+++ lldb/trunk/source/Plugins/Process/Utility/RegisterInfos_x86_64.h Mon Dec 11 
19:27:13 2017
@@ -7,11 +7,8 @@
 //
 
//===--===//
 
-#include "llvm/Support/Compiler.h"
-#include 
-#include 
-
-// Project includes
+// This file is meant to be textually included. Do not #include modular
+// headers here.
 
 // Computes the offset of the given GPR in the user data area.
 #define GPR_OFFSET(regname) (LLVM_EXTENSION offsetof(GPR, regname))


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


[Lldb-commits] [lldb] r320522 - Add an #include to appease an older clang, NFC

2017-12-12 Thread Vedant Kumar via lldb-commits
Author: vedantk
Date: Tue Dec 12 12:19:40 2017
New Revision: 320522

URL: http://llvm.org/viewvc/llvm-project?rev=320522&view=rev
Log:
Add an #include to appease an older clang, NFC

Add in a missing #include that AppleClang-900 complains about when
building with -DLLVM_ENABLE_MODULES.

Modified:
lldb/trunk/source/Utility/SelectHelper.cpp

Modified: lldb/trunk/source/Utility/SelectHelper.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Utility/SelectHelper.cpp?rev=320522&r1=320521&r2=320522&view=diff
==
--- lldb/trunk/source/Utility/SelectHelper.cpp (original)
+++ lldb/trunk/source/Utility/SelectHelper.cpp Tue Dec 12 12:19:40 2017
@@ -32,6 +32,7 @@
 #define NOMINMAX
 #include 
 #else
+#include 
 #include 
 #endif
 


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


Re: [Lldb-commits] [lldb] r320456 - Avoid module import in a textual header, NFC

2017-12-13 Thread Vedant Kumar via lldb-commits
Ah sorry, didn't see this for a while!

Yes -- I agree on both points here.

vedant

> On Dec 11, 2017, at 9:07 PM, Zachary Turner  wrote:
> 
> Long term it would be nice if we could get all these register definitions 
> automatically generated with llvm-tblgen.  That's a big undertaking, though.
> 
> On Mon, Dec 11, 2017 at 7:27 PM Vedant Kumar via lldb-commits 
> mailto:lldb-commits@lists.llvm.org>> wrote:
> Author: vedantk
> Date: Mon Dec 11 19:27:13 2017
> New Revision: 320456
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=320456&view=rev 
> <http://llvm.org/viewvc/llvm-project?rev=320456&view=rev>
> Log:
> Avoid module import in a textual header, NFC
> 
> This unbreaks the lldb modules build (-DLLVM_ENABLE_MODULES=On).
> 
> Modified:
> lldb/trunk/source/Plugins/Process/Utility/RegisterInfos_x86_64.h
> 
> Modified: lldb/trunk/source/Plugins/Process/Utility/RegisterInfos_x86_64.h
> URL: 
> http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/RegisterInfos_x86_64.h?rev=320456&r1=320455&r2=320456&view=diff
>  
> <http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/RegisterInfos_x86_64.h?rev=320456&r1=320455&r2=320456&view=diff>
> ==
> --- lldb/trunk/source/Plugins/Process/Utility/RegisterInfos_x86_64.h 
> (original)
> +++ lldb/trunk/source/Plugins/Process/Utility/RegisterInfos_x86_64.h Mon Dec 
> 11 19:27:13 2017
> @@ -7,11 +7,8 @@
>  //
>  
> //===--===//
> 
> -#include "llvm/Support/Compiler.h"
> -#include 
> -#include 
> -
> -// Project includes
> +// This file is meant to be textually included. Do not #include modular
> +// headers here.
> 
>  // Computes the offset of the given GPR in the user data area.
>  #define GPR_OFFSET(regname) (LLVM_EXTENSION offsetof(GPR, regname))
> 
> 
> ___
> lldb-commits mailing list
> lldb-commits@lists.llvm.org <mailto:lldb-commits@lists.llvm.org>
> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits 
> <http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits>

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


[Lldb-commits] [lldb] r322340 - Skip TestFunctionTemplateParameterPack.py, which unexpectedly asserts (PR35920)

2018-01-11 Thread Vedant Kumar via lldb-commits
Author: vedantk
Date: Thu Jan 11 17:23:52 2018
New Revision: 322340

URL: http://llvm.org/viewvc/llvm-project?rev=322340&view=rev
Log:
Skip TestFunctionTemplateParameterPack.py, which unexpectedly asserts (PR35920)

This test stresses expression evaluation support for template functions.
Currently the support is rudimentary, and running this test causes assertion
failures in clang. This test cannot be XFAIL'ed because the test harness
treats assertion failures as unexpected events. For now, the test must be
skipped.

Modified:

lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/function-template-parameter-pack/TestFunctionTemplateParameterPack.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/function-template-parameter-pack/TestFunctionTemplateParameterPack.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/function-template-parameter-pack/TestFunctionTemplateParameterPack.py?rev=322340&r1=322339&r2=322340&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/function-template-parameter-pack/TestFunctionTemplateParameterPack.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/function-template-parameter-pack/TestFunctionTemplateParameterPack.py
 Thu Jan 11 17:23:52 2018
@@ -1,6 +1,12 @@
 from lldbsuite.test import lldbinline
 from lldbsuite.test import decorators
 
+# https://bugs.llvm.org/show_bug.cgi?id=35920
+# This test stresses expression evaluation support for template functions.
+# Currently the support is rudimentary, and running this test causes assertion
+# failures in clang. This test cannot be XFAIL'ed because the test harness
+# treats assertion failures as unexpected events. For now, the test must be
+# skipped.
 lldbinline.MakeInlineTest(
 __file__, globals(), [
-decorators.expectedFailureAll(bugnumber="rdar://problem/32096064")])
+decorators.skipIf])


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


[Lldb-commits] [lldb] r322728 - Skip a flaky test (TestRdar12408181.py)

2018-01-17 Thread Vedant Kumar via lldb-commits
Author: vedantk
Date: Wed Jan 17 10:53:42 2018
New Revision: 322728

URL: http://llvm.org/viewvc/llvm-project?rev=322728&view=rev
Log:
Skip a flaky test (TestRdar12408181.py)

This test frequently times out on our bots. While we're investigating
the issue, mark the test as skipped so the builds aren't impacted as
much.

rdar://36417163

Modified:

lldb/trunk/packages/Python/lldbsuite/test/lang/objc/rdar-12408181/TestRdar12408181.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/lang/objc/rdar-12408181/TestRdar12408181.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/objc/rdar-12408181/TestRdar12408181.py?rev=322728&r1=322727&r2=322728&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/lang/objc/rdar-12408181/TestRdar12408181.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/lang/objc/rdar-12408181/TestRdar12408181.py
 Wed Jan 17 10:53:42 2018
@@ -13,7 +13,9 @@ from lldbsuite.test.lldbtest import *
 from lldbsuite.test import lldbutil
 
 
-@skipUnlessDarwin
+# TODO: Switch back to @skipUnlessDarwin when the bug preventing the test app
+# from launching is resolved.
+@skipIf
 class Rdar12408181TestCase(TestBase):
 
 mydir = TestBase.compute_mydir(__file__)


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


[Lldb-commits] [lldb] r322740 - Try again to mark TestRdar12408181.py as skipped

2018-01-17 Thread Vedant Kumar via lldb-commits
Author: vedantk
Date: Wed Jan 17 11:25:12 2018
New Revision: 322740

URL: http://llvm.org/viewvc/llvm-project?rev=322740&view=rev
Log:
Try again to mark TestRdar12408181.py as skipped

rdar://36417163

Modified:

lldb/trunk/packages/Python/lldbsuite/test/lang/objc/rdar-12408181/TestRdar12408181.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/lang/objc/rdar-12408181/TestRdar12408181.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/objc/rdar-12408181/TestRdar12408181.py?rev=322740&r1=322739&r2=322740&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/lang/objc/rdar-12408181/TestRdar12408181.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/lang/objc/rdar-12408181/TestRdar12408181.py
 Wed Jan 17 11:25:12 2018
@@ -13,9 +13,13 @@ from lldbsuite.test.lldbtest import *
 from lldbsuite.test import lldbutil
 
 
-# TODO: Switch back to @skipUnlessDarwin when the bug preventing the test app
-# from launching is resolved.
-@skipIf
+# TODO: The Jenkins testers on OS X fail running this test because they don't
+# have access to WindowServer so NSWindow doesn't work.  We should disable this
+# test if WindowServer isn't available.
+# Note: Simply applying the @skipIf decorator here confuses the test harness
+# and gives a spurious failure.
+@skipUnlessDarwin
+@skipIfDarwin
 class Rdar12408181TestCase(TestBase):
 
 mydir = TestBase.compute_mydir(__file__)


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


[Lldb-commits] [lldb] r322756 - A third attempt to mark TestRdar12408181.py as skipped

2018-01-17 Thread Vedant Kumar via lldb-commits
Author: vedantk
Date: Wed Jan 17 12:54:39 2018
New Revision: 322756

URL: http://llvm.org/viewvc/llvm-project?rev=322756&view=rev
Log:
A third attempt to mark TestRdar12408181.py as skipped

Due to an unfortunate difference between the open source test harness
and our internal harness, applying two @skip... decorators to this test
works in the internal build but not in the open source build.

I've tried another approach to skipping this test and tested it out with
the open source harness. Hopefully this sticks!

rdar://36417163

Modified:

lldb/trunk/packages/Python/lldbsuite/test/lang/objc/rdar-12408181/TestRdar12408181.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/lang/objc/rdar-12408181/TestRdar12408181.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/objc/rdar-12408181/TestRdar12408181.py?rev=322756&r1=322755&r2=322756&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/lang/objc/rdar-12408181/TestRdar12408181.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/lang/objc/rdar-12408181/TestRdar12408181.py
 Wed Jan 17 12:54:39 2018
@@ -19,7 +19,6 @@ from lldbsuite.test import lldbutil
 # Note: Simply applying the @skipIf decorator here confuses the test harness
 # and gives a spurious failure.
 @skipUnlessDarwin
-@skipIfDarwin
 class Rdar12408181TestCase(TestBase):
 
 mydir = TestBase.compute_mydir(__file__)
@@ -35,6 +34,9 @@ class Rdar12408181TestCase(TestBase):
 
 def test_nswindow_count(self):
 """Test that we are able to find out how many children NSWindow has."""
+
+self.skipTest("Skipping this test due to timeout flakiness")
+
 d = {'EXE': self.exe_name}
 self.build(dictionary=d)
 self.setTearDownCleanup(dictionary=d)


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


[Lldb-commits] [lldb] r322803 - [CMake] Make check-lldb work with LLDB_CODESIGN_IDENTITY=''

2018-01-17 Thread Vedant Kumar via lldb-commits
Author: vedantk
Date: Wed Jan 17 17:16:30 2018
New Revision: 322803

URL: http://llvm.org/viewvc/llvm-project?rev=322803&view=rev
Log:
[CMake] Make check-lldb work with LLDB_CODESIGN_IDENTITY=''

On Darwin, if a test machine isn't set up for code-signing (see
docs/code-signing.txt), running check-lldb should use the system
debugserver instead of the unsigned one built in-tree. This makes it
possible to run lldb's test suite without having code-signing set up,
which is really convenient.

Differential Revision: https://reviews.llvm.org/D42215

Modified:
lldb/trunk/docs/code-signing.txt
lldb/trunk/test/CMakeLists.txt

Modified: lldb/trunk/docs/code-signing.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/docs/code-signing.txt?rev=322803&r1=322802&r2=322803&view=diff
==
--- lldb/trunk/docs/code-signing.txt (original)
+++ lldb/trunk/docs/code-signing.txt Wed Jan 17 17:16:30 2018
@@ -1,6 +1,11 @@
-On MacOSX lldb needs to be code signed. The Debug, DebugClang and Release 
-builds  are set to code sign using a code signing certificate named 
-"lldb_codesign". 
+To use the in-tree debug server on macOS, lldb needs to be code signed. The
+Debug, DebugClang and Release builds are set to code sign using a code signing
+certificate named "lldb_codesign". This document explains how to set up the
+signing certificate.
+
+Note that it's possible to build and use lldb on macOS without setting up code
+signing by using the system's debug server. To configure lldb in this way with
+cmake, specify -DLLDB_CODESIGN_IDENTITY=''.
 
 If you have re-installed a new OS, please delete all old lldb_codesign items
 from your keychain. There will be a code signing certification and a public

Modified: lldb/trunk/test/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/CMakeLists.txt?rev=322803&r1=322802&r2=322803&view=diff
==
--- lldb/trunk/test/CMakeLists.txt (original)
+++ lldb/trunk/test/CMakeLists.txt Wed Jan 17 17:16:30 2018
@@ -25,7 +25,9 @@ if(TARGET lldb-server)
 endif()
   
 if(TARGET debugserver)
-  list(APPEND LLDB_TEST_DEPS debugserver)
+  if(NOT CMAKE_HOST_APPLE OR LLDB_CODESIGN_IDENTITY)
+list(APPEND LLDB_TEST_DEPS debugserver)
+  endif()
 endif()
 
 if(TARGET lldb-mi)
@@ -95,7 +97,18 @@ if (NOT ${CMAKE_SYSTEM_NAME} MATCHES "Wi
 endif()
 
 if(CMAKE_HOST_APPLE)
-  list(APPEND LLDB_TEST_COMMON_ARGS --server $)
+  if(LLDB_CODESIGN_IDENTITY)
+set(DEBUGSERVER_PATH $)
+  else()
+execute_process(
+  COMMAND xcode-select -p
+  OUTPUT_VARIABLE XCODE_DEV_DIR)
+string(STRIP ${XCODE_DEV_DIR} XCODE_DEV_DIR)
+set(DEBUGSERVER_PATH
+  
"${XCODE_DEV_DIR}/../SharedFrameworks/LLDB.framework/Resources/debugserver")
+  endif()
+  message(STATUS "Path to the lldb debugserver: ${DEBUGSERVER_PATH}")
+  list(APPEND LLDB_TEST_COMMON_ARGS --server ${DEBUGSERVER_PATH})
 endif()
 
 set(LLDB_DOTEST_ARGS ${LLDB_TEST_COMMON_ARGS};${LLDB_TEST_USER_ARGS})


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


[Lldb-commits] [lldb] r323450 - Use test-specific module caches to avoid stale header conflicts

2018-01-25 Thread Vedant Kumar via lldb-commits
Author: vedantk
Date: Thu Jan 25 10:01:27 2018
New Revision: 323450

URL: http://llvm.org/viewvc/llvm-project?rev=323450&view=rev
Log:
Use test-specific module caches to avoid stale header conflicts

Stale global module caches cause problems for the bots. The modules
become invalid when clang headers are updated by version control, and
tests which use these modules fail to compile, e.g:

  fatal error: file '.../__stddef_max_align_t.h' has been modified since the 
module file '/var/.../Darwin.pcm' was built
  note: please rebuild precompiled header '/var/.../Darwin.pcm'

Eventually we should transition to having just a single module cache to speed
tests up. This patch should be just enough to fix the spurious bot failures due
to stale caches.

rdar://36479805, also related to llvm.org/PR36048

Differential Revision: https://reviews.llvm.org/D42277

Modified:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-cpp/TestDataFormatterCpp.py

lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-globals/TestDataFormatterGlobals.py

lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/TestDataFormatterLibcxxList.py

lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/vector/TestDataFormatterLibcxxVector.py

lldb/trunk/packages/Python/lldbsuite/test/lang/objc/modules-auto-import/Makefile

lldb/trunk/packages/Python/lldbsuite/test/lang/objc/modules-auto-import/TestModulesAutoImport.py

lldb/trunk/packages/Python/lldbsuite/test/lang/objc/modules-incomplete/Makefile

lldb/trunk/packages/Python/lldbsuite/test/lang/objc/modules-incomplete/TestIncompleteModules.py

lldb/trunk/packages/Python/lldbsuite/test/lang/objc/modules-inline-functions/Makefile

lldb/trunk/packages/Python/lldbsuite/test/lang/objc/modules-inline-functions/TestModulesInlineFunctions.py
lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-cpp/TestDataFormatterCpp.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-cpp/TestDataFormatterCpp.py?rev=323450&r1=323449&r2=323450&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-cpp/TestDataFormatterCpp.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-cpp/TestDataFormatterCpp.py
 Thu Jan 25 10:01:27 2018
@@ -26,6 +26,8 @@ class CppDataFormatterTestCase(TestBase)
 @expectedFailureAll(
 oslist=["windows"],
 bugnumber="llvm.org/pr24462: Data formatters have problems on Windows")
+@skipIf(debug_info="gmodules",
+bugnumber="https://bugs.llvm.org/show_bug.cgi?id=36048";)
 def test_with_run_command(self):
 """Test that that file and class static variables display correctly."""
 self.build()

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-globals/TestDataFormatterGlobals.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-globals/TestDataFormatterGlobals.py?rev=323450&r1=323449&r2=323450&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-globals/TestDataFormatterGlobals.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-globals/TestDataFormatterGlobals.py
 Thu Jan 25 10:01:27 2018
@@ -9,6 +9,7 @@ import os
 import time
 import lldb
 from lldbsuite.test.lldbtest import *
+from lldbsuite.test.decorators import *
 import lldbsuite.test.lldbutil as lldbutil
 
 
@@ -22,6 +23,8 @@ class GlobalsDataFormatterTestCase(TestB
 # Find the line number to break at.
 self.line = line_number('main.cpp', '// Set break point at this line.')
 
+@skipIf(debug_info="gmodules",
+bugnumber="https://bugs.llvm.org/show_bug.cgi?id=36048";)
 def test_with_run_command(self):
 """Test that that file and class static variables display correctly."""
 self.build()

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/TestDataFormatterLibcxxList.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/TestDataFormatterLibcxxList.py?rev=323450&r1=323449&r2=323450&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/tes

Re: [Lldb-commits] [lldb] r323450 - Use test-specific module caches to avoid stale header conflicts

2018-01-25 Thread Vedant Kumar via lldb-commits
Taking a look. It may be another instance of a test not actually running with 
-fmodules in the -gmodules configuration.

vedant

> On Jan 25, 2018, at 12:40 PM, Davide Italiano  wrote:
> 
> The bot started failing recently, and this commit seems the most likely 
> culprit.
> 
> http://lab.llvm.org:8080/green/view/LLDB/job/lldb-xcode/4513/
> 
> 
> Can you please take a look, Vedant?
> 
> Thanks,
> 
> --
> Davide
> 
> On Thu, Jan 25, 2018 at 10:01 AM, Vedant Kumar via lldb-commits
>  wrote:
>> Author: vedantk
>> Date: Thu Jan 25 10:01:27 2018
>> New Revision: 323450
>> 
>> URL: http://llvm.org/viewvc/llvm-project?rev=323450&view=rev
>> Log:
>> Use test-specific module caches to avoid stale header conflicts
>> 
>> Stale global module caches cause problems for the bots. The modules
>> become invalid when clang headers are updated by version control, and
>> tests which use these modules fail to compile, e.g:
>> 
>>  fatal error: file '.../__stddef_max_align_t.h' has been modified since the 
>> module file '/var/.../Darwin.pcm' was built
>>  note: please rebuild precompiled header '/var/.../Darwin.pcm'
>> 
>> Eventually we should transition to having just a single module cache to speed
>> tests up. This patch should be just enough to fix the spurious bot failures 
>> due
>> to stale caches.
>> 
>> rdar://36479805, also related to llvm.org/PR36048
>> 
>> Differential Revision: https://reviews.llvm.org/D42277
>> 
>> Modified:
>>
>> lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-cpp/TestDataFormatterCpp.py
>>
>> lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-globals/TestDataFormatterGlobals.py
>>
>> lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/TestDataFormatterLibcxxList.py
>>
>> lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/vector/TestDataFormatterLibcxxVector.py
>>
>> lldb/trunk/packages/Python/lldbsuite/test/lang/objc/modules-auto-import/Makefile
>>
>> lldb/trunk/packages/Python/lldbsuite/test/lang/objc/modules-auto-import/TestModulesAutoImport.py
>>
>> lldb/trunk/packages/Python/lldbsuite/test/lang/objc/modules-incomplete/Makefile
>>
>> lldb/trunk/packages/Python/lldbsuite/test/lang/objc/modules-incomplete/TestIncompleteModules.py
>>
>> lldb/trunk/packages/Python/lldbsuite/test/lang/objc/modules-inline-functions/Makefile
>>
>> lldb/trunk/packages/Python/lldbsuite/test/lang/objc/modules-inline-functions/TestModulesInlineFunctions.py
>>lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules
>> 
>> Modified: 
>> lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-cpp/TestDataFormatterCpp.py
>> URL: 
>> http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-cpp/TestDataFormatterCpp.py?rev=323450&r1=323449&r2=323450&view=diff
>> ==
>> --- 
>> lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-cpp/TestDataFormatterCpp.py
>>  (original)
>> +++ 
>> lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-cpp/TestDataFormatterCpp.py
>>  Thu Jan 25 10:01:27 2018
>> @@ -26,6 +26,8 @@ class CppDataFormatterTestCase(TestBase)
>> @expectedFailureAll(
>> oslist=["windows"],
>> bugnumber="llvm.org/pr24462: Data formatters have problems on 
>> Windows")
>> +@skipIf(debug_info="gmodules",
>> +bugnumber="https://bugs.llvm.org/show_bug.cgi?id=36048";)
>> def test_with_run_command(self):
>> """Test that that file and class static variables display 
>> correctly."""
>> self.build()
>> 
>> Modified: 
>> lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-globals/TestDataFormatterGlobals.py
>> URL: 
>> http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-globals/TestDataFormatterGlobals.py?rev=323450&r1=323449&r2=323450&view=diff
>> ==
>> --- 
>> lldb/trunk/packages/Python/lldbs

Re: [Lldb-commits] [lldb] r323450 - Use test-specific module caches to avoid stale header conflicts

2018-01-25 Thread Vedant Kumar via lldb-commits
The test passes locally, but the cmake job is failing in the exact same way as 
the Xcode one. Based on the error, it looks like the compiler invocation has 
failed.

.. and, aha!, here is the failed invocation:

green-dragon-23:non-overlapping-index-variable-i buildslave$ make MAKE_DSYM=NO 
MAKE_GMODULES=YES ARCH=x86_64 
CC="/Users/buildslave/jenkins/workspace/lldb-cmake/host-compiler/bin/clang-7.0"
/Users/buildslave/jenkins/workspace/lldb-cmake/host-compiler/bin/clang-7.0  
-std=c++11 -g -O0 -fno-builtin -arch x86_64  
-I/Users/buildslave/jenkins/workspace/lldb-cmake/src/llvm/tools/lldb/packages/Python/lldbsuite/test/make/../../../../../include
 -include 
/Users/buildslave/jenkins/workspace/lldb-cmake/src/llvm/tools/lldb/packages/Python/lldbsuite/test/make/test_common.h
 
-I/Users/buildslave/jenkins/workspace/lldb-cmake/src/llvm/tools/lldb/packages/Python/lldbsuite/test/make/
  -fno-limit-debug-info   -fmodules -gmodules -fmodules-cache-path=module-cache 
--driver-mode=g++ -c -o main.o main.cpp
main.cpp:27:9: error: no matching constructor for initialization of 'Point'
point(0, 0)
^ 
/usr/include/MacTypes.h:538:8: note: candidate constructor (the implicit copy 
constructor) not viable: requires 1 argument, but 2 were provided
struct Point {
   ^
/usr/include/MacTypes.h:538:8: note: candidate constructor (the implicit move 
constructor) not viable: requires 1 argument, but 2 were provided
/usr/include/MacTypes.h:538:8: note: candidate constructor (the implicit 
default constructor) not viable: requires 0 arguments, but 2 were provided
main.cpp:36:23: error: no member named 'x' in 'Point'
ptr[i]->point.x = i;
~ ^
main.cpp:37:23: error: no member named 'y' in 'Point'
ptr[i]->point.y = i+1;
~ ^
main.cpp:47:77: error: no member named 'x' in 'Point'
printf("data[%d] = %d (%d, %d)\n", i, ptr[i]->id, ptr[i]->point.x, 
ptr[i]->point.y);
  ~ ^
main.cpp:47:94: error: no member named 'y' in 'Point'
printf("data[%d] = %d (%d, %d)\n", i, ptr[i]->id, ptr[i]->point.x, 
ptr[i]->point.y);
   
~ ^
5 errors generated.
make: *** [main.o] Error 1

It looks like we're picking up "struct Point" from /usr/include/MacTypes.h!

vedant

> On Jan 25, 2018, at 1:02 PM, Vedant Kumar  wrote:
> 
> Taking a look. It may be another instance of a test not actually running with 
> -fmodules in the -gmodules configuration.
> 
> vedant
> 
>> On Jan 25, 2018, at 12:40 PM, Davide Italiano  wrote:
>> 
>> The bot started failing recently, and this commit seems the most likely 
>> culprit.
>> 
>> http://lab.llvm.org:8080/green/view/LLDB/job/lldb-xcode/4513/
>> 
>> 
>> Can you please take a look, Vedant?
>> 
>> Thanks,
>> 
>> --
>> Davide
>> 
>> On Thu, Jan 25, 2018 at 10:01 AM, Vedant Kumar via lldb-commits
>>  wrote:
>>> Author: vedantk
>>> Date: Thu Jan 25 10:01:27 2018
>>> New Revision: 323450
>>> 
>>> URL: http://llvm.org/viewvc/llvm-project?rev=323450&view=rev
>>> Log:
>>> Use test-specific module caches to avoid stale header conflicts
>>> 
>>> Stale global module caches cause problems for the bots. The modules
>>> become invalid when clang headers are updated by version control, and
>>> tests which use these modules fail to compile, e.g:
>>> 
>>> fatal error: file '.../__stddef_max_align_t.h' has been modified since the 
>>> module file '/var/.../Darwin.pcm' was built
>>> note: please rebuild precompiled header '/var/.../Darwin.pcm'
>>> 
>>> Eventually we should transition to having just a single module cache to 
>>> speed
>>> tests up. This patch should be just enough to fix the spurious bot failures 
>>> due
>>> to stale caches.
>>> 
>>> rdar://36479805, also related to llvm.org/PR36048
>>> 
>>> Differential Revision: https://reviews.llvm.org/D42277
>>> 
>>> Modified:
>>>   
>>> lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-cpp/TestDataFormatterCpp.py
>>>   
>>> lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-globals/TestDataFormatterGlobals.py
>>>   
>>> lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/TestDataFormatterLibcxxList.py
>&

Re: [Lldb-commits] [lldb] r323450 - Use test-specific module caches to avoid stale header conflicts

2018-01-25 Thread Vedant Kumar via lldb-commits
We *could* x-fail this test on older OS's, but ISTM that we don't need this 
test to printf at all, so let's just remove the #include?

vedant

> On Jan 25, 2018, at 1:14 PM, Vedant Kumar  wrote:
> 
> The test passes locally, but the cmake job is failing in the exact same way 
> as the Xcode one. Based on the error, it looks like the compiler invocation 
> has failed.
> 
> .. and, aha!, here is the failed invocation:
> 
> green-dragon-23:non-overlapping-index-variable-i buildslave$ make 
> MAKE_DSYM=NO MAKE_GMODULES=YES ARCH=x86_64 
> CC="/Users/buildslave/jenkins/workspace/lldb-cmake/host-compiler/bin/clang-7.0"
> /Users/buildslave/jenkins/workspace/lldb-cmake/host-compiler/bin/clang-7.0  
> -std=c++11 -g -O0 -fno-builtin -arch x86_64  
> -I/Users/buildslave/jenkins/workspace/lldb-cmake/src/llvm/tools/lldb/packages/Python/lldbsuite/test/make/../../../../../include
>  -include 
> /Users/buildslave/jenkins/workspace/lldb-cmake/src/llvm/tools/lldb/packages/Python/lldbsuite/test/make/test_common.h
>  
> -I/Users/buildslave/jenkins/workspace/lldb-cmake/src/llvm/tools/lldb/packages/Python/lldbsuite/test/make/
>   -fno-limit-debug-info   -fmodules -gmodules 
> -fmodules-cache-path=module-cache --driver-mode=g++ -c -o main.o main.cpp
> main.cpp:27:9: error: no matching constructor for initialization of 'Point'
> point(0, 0)
> ^ 
> /usr/include/MacTypes.h:538:8: note: candidate constructor (the implicit copy 
> constructor) not viable: requires 1 argument, but 2 were provided
> struct Point {
>^
> /usr/include/MacTypes.h:538:8: note: candidate constructor (the implicit move 
> constructor) not viable: requires 1 argument, but 2 were provided
> /usr/include/MacTypes.h:538:8: note: candidate constructor (the implicit 
> default constructor) not viable: requires 0 arguments, but 2 were provided
> main.cpp:36:23: error: no member named 'x' in 'Point'
> ptr[i]->point.x = i;
> ~ ^
> main.cpp:37:23: error: no member named 'y' in 'Point'
> ptr[i]->point.y = i+1;
> ~ ^
> main.cpp:47:77: error: no member named 'x' in 'Point'
> printf("data[%d] = %d (%d, %d)\n", i, ptr[i]->id, 
> ptr[i]->point.x, ptr[i]->point.y);
>   ~ ^
> main.cpp:47:94: error: no member named 'y' in 'Point'
> printf("data[%d] = %d (%d, %d)\n", i, ptr[i]->id, 
> ptr[i]->point.x, ptr[i]->point.y);
>   
>  ~ ^
> 5 errors generated.
> make: *** [main.o] Error 1
> 
> It looks like we're picking up "struct Point" from /usr/include/MacTypes.h!
> 
> vedant
> 
>> On Jan 25, 2018, at 1:02 PM, Vedant Kumar > <mailto:v...@apple.com>> wrote:
>> 
>> Taking a look. It may be another instance of a test not actually running 
>> with -fmodules in the -gmodules configuration.
>> 
>> vedant
>> 
>>> On Jan 25, 2018, at 12:40 PM, Davide Italiano >> <mailto:dccitali...@gmail.com>> wrote:
>>> 
>>> The bot started failing recently, and this commit seems the most likely 
>>> culprit.
>>> 
>>> http://lab.llvm.org:8080/green/view/LLDB/job/lldb-xcode/4513/ 
>>> <http://lab.llvm.org:8080/green/view/LLDB/job/lldb-xcode/4513/>
>>> 
>>> 
>>> Can you please take a look, Vedant?
>>> 
>>> Thanks,
>>> 
>>> --
>>> Davide
>>> 
>>> On Thu, Jan 25, 2018 at 10:01 AM, Vedant Kumar via lldb-commits
>>>  wrote:
>>>> Author: vedantk
>>>> Date: Thu Jan 25 10:01:27 2018
>>>> New Revision: 323450
>>>> 
>>>> URL: http://llvm.org/viewvc/llvm-project?rev=323450&view=rev
>>>> Log:
>>>> Use test-specific module caches to avoid stale header conflicts
>>>> 
>>>> Stale global module caches cause problems for the bots. The modules
>>>> become invalid when clang headers are updated by version control, and
>>>> tests which use these modules fail to compile, e.g:
>>>> 
>>>> fatal error: file '.../__stddef_max_align_t.h' has been modified since the 
>>>> module file '/var/.../Darwin.pcm' was built
>>>> note: please rebuild precompiled header '/var/.../Darwin.pcm'
>>>> 
>>>> Eventually we should transition to having just a single module cache 

[Lldb-commits] [lldb] r323467 - [test] Fix a test that never compiled under -fmodules

2018-01-25 Thread Vedant Kumar via lldb-commits
Author: vedantk
Date: Thu Jan 25 13:20:29 2018
New Revision: 323467

URL: http://llvm.org/viewvc/llvm-project?rev=323467&view=rev
Log:
[test] Fix a test that never compiled under -fmodules

This test #include's stdio.h, which, on at least two bots results in a
module import of MacTypes.h (due to weird SDK layering issues), which
causes the test to fail to compile.

Just don't #include stdio.h, as it's not needed for the test.

Modified:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/non-overlapping-index-variable-i/main.cpp

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/non-overlapping-index-variable-i/main.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/non-overlapping-index-variable-i/main.cpp?rev=323467&r1=323466&r2=323467&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/non-overlapping-index-variable-i/main.cpp
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/non-overlapping-index-variable-i/main.cpp
 Thu Jan 25 13:20:29 2018
@@ -6,7 +6,6 @@
 // License. See LICENSE.TXT for details.
 //
 
//===--===//
-#include 
 
 class Point {
 public:
@@ -37,15 +36,11 @@ int main(int argc, char const *argv[]) {
 ptr[i]->point.y = i+1;
 }
 
-printf("Finished populating data.\n");
 for (int i = 0; i < 1000; ++i) {
 bool dump = argc > 1; // Set breakpoint here.
   // Evaluate a couple of expressions (2*1000 = 
2000 exprs):
   // expr ptr[i]->point.x
   // expr ptr[i]->point.y
-if (dump) {
-printf("data[%d] = %d (%d, %d)\n", i, ptr[i]->id, ptr[i]->point.x, 
ptr[i]->point.y);
-}
 }
 return 0;
 }


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


Re: [Lldb-commits] [lldb] r323450 - Use test-specific module caches to avoid stale header conflicts

2018-01-25 Thread Vedant Kumar via lldb-commits
Done, r323467

> On Jan 25, 2018, at 1:20 PM, Davide Italiano  wrote:
> 
> yes, sure, I think that's the right thing to do.
> 
> --
> Davide
> 
> On Thu, Jan 25, 2018 at 1:16 PM, Vedant Kumar  wrote:
>> We *could* x-fail this test on older OS's, but ISTM that we don't need this
>> test to printf at all, so let's just remove the #include?
>> 
>> vedant
>> 
>> On Jan 25, 2018, at 1:14 PM, Vedant Kumar  wrote:
>> 
>> The test passes locally, but the cmake job is failing in the exact same way
>> as the Xcode one. Based on the error, it looks like the compiler invocation
>> has failed.
>> 
>> .. and, aha!, here is the failed invocation:
>> 
>> green-dragon-23:non-overlapping-index-variable-i buildslave$ make
>> MAKE_DSYM=NO MAKE_GMODULES=YES ARCH=x86_64
>> CC="/Users/buildslave/jenkins/workspace/lldb-cmake/host-compiler/bin/clang-7.0"
>> /Users/buildslave/jenkins/workspace/lldb-cmake/host-compiler/bin/clang-7.0
>> -std=c++11 -g -O0 -fno-builtin -arch x86_64
>> -I/Users/buildslave/jenkins/workspace/lldb-cmake/src/llvm/tools/lldb/packages/Python/lldbsuite/test/make/../../../../../include
>> -include
>> /Users/buildslave/jenkins/workspace/lldb-cmake/src/llvm/tools/lldb/packages/Python/lldbsuite/test/make/test_common.h
>> -I/Users/buildslave/jenkins/workspace/lldb-cmake/src/llvm/tools/lldb/packages/Python/lldbsuite/test/make/
>> -fno-limit-debug-info   -fmodules -gmodules
>> -fmodules-cache-path=module-cache --driver-mode=g++ -c -o main.o main.cpp
>> main.cpp:27:9: error: no matching constructor for initialization of 'Point'
>>point(0, 0)
>>^ 
>> /usr/include/MacTypes.h:538:8: note: candidate constructor (the implicit
>> copy constructor) not viable: requires 1 argument, but 2 were provided
>> struct Point {
>>   ^
>> /usr/include/MacTypes.h:538:8: note: candidate constructor (the implicit
>> move constructor) not viable: requires 1 argument, but 2 were provided
>> /usr/include/MacTypes.h:538:8: note: candidate constructor (the implicit
>> default constructor) not viable: requires 0 arguments, but 2 were provided
>> main.cpp:36:23: error: no member named 'x' in 'Point'
>>ptr[i]->point.x = i;
>>~ ^
>> main.cpp:37:23: error: no member named 'y' in 'Point'
>>ptr[i]->point.y = i+1;
>>~ ^
>> main.cpp:47:77: error: no member named 'x' in 'Point'
>>printf("data[%d] = %d (%d, %d)\n", i, ptr[i]->id,
>> ptr[i]->point.x, ptr[i]->point.y);
>>  ~
>> ^
>> main.cpp:47:94: error: no member named 'y' in 'Point'
>>printf("data[%d] = %d (%d, %d)\n", i, ptr[i]->id,
>> ptr[i]->point.x, ptr[i]->point.y);
>> 
>> ~ ^
>> 5 errors generated.
>> make: *** [main.o] Error 1
>> 
>> It looks like we're picking up "struct Point" from /usr/include/MacTypes.h!
>> 
>> vedant
>> 
>> On Jan 25, 2018, at 1:02 PM, Vedant Kumar  wrote:
>> 
>> Taking a look. It may be another instance of a test not actually running
>> with -fmodules in the -gmodules configuration.
>> 
>> vedant
>> 
>> On Jan 25, 2018, at 12:40 PM, Davide Italiano  wrote:
>> 
>> The bot started failing recently, and this commit seems the most likely
>> culprit.
>> 
>> http://lab.llvm.org:8080/green/view/LLDB/job/lldb-xcode/4513/
>> 
>> 
>> Can you please take a look, Vedant?
>> 
>> Thanks,
>> 
>> --
>> Davide
>> 
>> On Thu, Jan 25, 2018 at 10:01 AM, Vedant Kumar via lldb-commits
>>  wrote:
>> 
>> Author: vedantk
>> Date: Thu Jan 25 10:01:27 2018
>> New Revision: 323450
>> 
>> URL: http://llvm.org/viewvc/llvm-project?rev=323450&view=rev
>> Log:
>> Use test-specific module caches to avoid stale header conflicts
>> 
>> Stale global module caches cause problems for the bots. The modules
>> become invalid when clang headers are updated by version control, and
>> tests which use these modules fail to compile, e.g:
>> 
>> fatal error: file '.../__stddef_max_align_t.h' has been modified since the
>> module file '/var/.../Darwin.pcm' was built
>> note: please rebuild precompiled header '/var/.../Darwin.pcm'
>> 
>> Eventually we should transition to having just a single module cache to

Re: [Lldb-commits] [lldb] r323450 - Use test-specific module caches to avoid stale header conflicts

2018-01-25 Thread Vedant Kumar via lldb-commits
Green: http://lab.llvm.org:8080/green/view/LLDB/job/lldb-cmake/4760/console 
<http://lab.llvm.org:8080/green/view/LLDB/job/lldb-cmake/4760/console>

> On Jan 25, 2018, at 1:22 PM, Vedant Kumar  wrote:
> 
> Done, r323467
> 
>> On Jan 25, 2018, at 1:20 PM, Davide Italiano  wrote:
>> 
>> yes, sure, I think that's the right thing to do.
>> 
>> --
>> Davide
>> 
>> On Thu, Jan 25, 2018 at 1:16 PM, Vedant Kumar  wrote:
>>> We *could* x-fail this test on older OS's, but ISTM that we don't need this
>>> test to printf at all, so let's just remove the #include?
>>> 
>>> vedant
>>> 
>>> On Jan 25, 2018, at 1:14 PM, Vedant Kumar  wrote:
>>> 
>>> The test passes locally, but the cmake job is failing in the exact same way
>>> as the Xcode one. Based on the error, it looks like the compiler invocation
>>> has failed.
>>> 
>>> .. and, aha!, here is the failed invocation:
>>> 
>>> green-dragon-23:non-overlapping-index-variable-i buildslave$ make
>>> MAKE_DSYM=NO MAKE_GMODULES=YES ARCH=x86_64
>>> CC="/Users/buildslave/jenkins/workspace/lldb-cmake/host-compiler/bin/clang-7.0"
>>> /Users/buildslave/jenkins/workspace/lldb-cmake/host-compiler/bin/clang-7.0
>>> -std=c++11 -g -O0 -fno-builtin -arch x86_64
>>> -I/Users/buildslave/jenkins/workspace/lldb-cmake/src/llvm/tools/lldb/packages/Python/lldbsuite/test/make/../../../../../include
>>> -include
>>> /Users/buildslave/jenkins/workspace/lldb-cmake/src/llvm/tools/lldb/packages/Python/lldbsuite/test/make/test_common.h
>>> -I/Users/buildslave/jenkins/workspace/lldb-cmake/src/llvm/tools/lldb/packages/Python/lldbsuite/test/make/
>>> -fno-limit-debug-info   -fmodules -gmodules
>>> -fmodules-cache-path=module-cache --driver-mode=g++ -c -o main.o main.cpp
>>> main.cpp:27:9: error: no matching constructor for initialization of 'Point'
>>>   point(0, 0)
>>>   ^ 
>>> /usr/include/MacTypes.h:538:8: note: candidate constructor (the implicit
>>> copy constructor) not viable: requires 1 argument, but 2 were provided
>>> struct Point {
>>>  ^
>>> /usr/include/MacTypes.h:538:8: note: candidate constructor (the implicit
>>> move constructor) not viable: requires 1 argument, but 2 were provided
>>> /usr/include/MacTypes.h:538:8: note: candidate constructor (the implicit
>>> default constructor) not viable: requires 0 arguments, but 2 were provided
>>> main.cpp:36:23: error: no member named 'x' in 'Point'
>>>   ptr[i]->point.x = i;
>>>   ~ ^
>>> main.cpp:37:23: error: no member named 'y' in 'Point'
>>>   ptr[i]->point.y = i+1;
>>>   ~ ^
>>> main.cpp:47:77: error: no member named 'x' in 'Point'
>>>   printf("data[%d] = %d (%d, %d)\n", i, ptr[i]->id,
>>> ptr[i]->point.x, ptr[i]->point.y);
>>> ~
>>> ^
>>> main.cpp:47:94: error: no member named 'y' in 'Point'
>>>   printf("data[%d] = %d (%d, %d)\n", i, ptr[i]->id,
>>> ptr[i]->point.x, ptr[i]->point.y);
>>> 
>>> ~ ^
>>> 5 errors generated.
>>> make: *** [main.o] Error 1
>>> 
>>> It looks like we're picking up "struct Point" from /usr/include/MacTypes.h!
>>> 
>>> vedant
>>> 
>>> On Jan 25, 2018, at 1:02 PM, Vedant Kumar  wrote:
>>> 
>>> Taking a look. It may be another instance of a test not actually running
>>> with -fmodules in the -gmodules configuration.
>>> 
>>> vedant
>>> 
>>> On Jan 25, 2018, at 12:40 PM, Davide Italiano  wrote:
>>> 
>>> The bot started failing recently, and this commit seems the most likely
>>> culprit.
>>> 
>>> http://lab.llvm.org:8080/green/view/LLDB/job/lldb-xcode/4513/
>>> 
>>> 
>>> Can you please take a look, Vedant?
>>> 
>>> Thanks,
>>> 
>>> --
>>> Davide
>>> 
>>> On Thu, Jan 25, 2018 at 10:01 AM, Vedant Kumar via lldb-commits
>>>  wrote:
>>> 
>>> Author: vedantk
>>> Date: Thu Jan 25 10:01:27 2018
>>> New Revision: 323450
>>> 
>>> URL: http://llvm.org/viewvc/llvm-project?rev=323450&view=rev
>>> Log:
>>> Use test-specific modul

[Lldb-commits] [lldb] r323723 - dotest: Apply --skip-categories to debug info categories

2018-01-29 Thread Vedant Kumar via lldb-commits
Author: vedantk
Date: Mon Jan 29 19:36:00 2018
New Revision: 323723

URL: http://llvm.org/viewvc/llvm-project?rev=323723&view=rev
Log:
dotest: Apply --skip-categories to debug info categories

Modified:
lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py

Modified: lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py?rev=323723&r1=323722&r2=323723&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py Mon Jan 29 19:36:00 
2018
@@ -1733,7 +1733,7 @@ class LLDBTestCaseFactory(type):
 # authoritative.  If none were specified, try with all debug
 # info formats.
 all_dbginfo_categories = set(
-test_categories.debug_info_categories)
+test_categories.debug_info_categories) - 
set(configuration.skipCategories)
 categories = set(
 getattr(
 attrvalue,


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


[Lldb-commits] [lldb] r323809 - PR25934: Skip EventAPITestCase. It still SEGV's on Darwin.

2018-01-30 Thread Vedant Kumar via lldb-commits
Author: vedantk
Date: Tue Jan 30 11:49:05 2018
New Revision: 323809

URL: http://llvm.org/viewvc/llvm-project?rev=323809&view=rev
Log:
PR25934: Skip EventAPITestCase. It still SEGV's on Darwin.

See: https://ci.swift.org/job/swift-lldb-PR-osx/39

llvm.org/PR25934

Modified:
lldb/trunk/packages/Python/lldbsuite/test/python_api/event/TestEvents.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/python_api/event/TestEvents.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/python_api/event/TestEvents.py?rev=323809&r1=323808&r2=323809&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/python_api/event/TestEvents.py 
(original)
+++ lldb/trunk/packages/Python/lldbsuite/test/python_api/event/TestEvents.py 
Tue Jan 30 11:49:05 2018
@@ -15,6 +15,7 @@ from lldbsuite.test import lldbutil
 
 
 @skipIfLinux   # llvm.org/pr25924, sometimes generating SIGSEGV
+@skipIfDarwin
 class EventAPITestCase(TestBase):
 
 mydir = TestBase.compute_mydir(__file__)


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


[Lldb-commits] [lldb] r323817 - XUnit Formatter: Handle UTF-8 decode errors on invalid XML

2018-01-30 Thread Vedant Kumar via lldb-commits
Author: vedantk
Date: Tue Jan 30 13:16:42 2018
New Revision: 323817

URL: http://llvm.org/viewvc/llvm-project?rev=323817&view=rev
Log:
XUnit Formatter: Handle UTF-8 decode errors on invalid XML

Strings which contain garbage data can trigger an exception in the XUnit
plugin at the UTF-8 decode step because the decode is strict. Use a lax
mode to avoid an exception.

See: https://ci.swift.org/job/oss-lldb-incremental-osx/780

Modified:
lldb/trunk/packages/Python/lldbsuite/test_event/formatter/xunit.py

Modified: lldb/trunk/packages/Python/lldbsuite/test_event/formatter/xunit.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test_event/formatter/xunit.py?rev=323817&r1=323816&r2=323817&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test_event/formatter/xunit.py 
(original)
+++ lldb/trunk/packages/Python/lldbsuite/test_event/formatter/xunit.py Tue Jan 
30 13:16:42 2018
@@ -84,7 +84,9 @@ class XunitFormatter(ResultsFormatter):
 """
 # Get the content into unicode
 if isinstance(str_or_unicode, str):
-unicode_content = str_or_unicode.decode('utf-8')
+# If we hit decoding errors due to data corruption, replace the
+# invalid characters with U+FFFD REPLACEMENT CHARACTER.
+unicode_content = str_or_unicode.decode('utf-8', 'replace')
 else:
 unicode_content = str_or_unicode
 return self.invalid_xml_re.sub(


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


Re: [Lldb-commits] [lldb] r322339 - When parsing the target.xml register file, if no architecture has

2018-02-06 Thread Vedant Kumar via lldb-commits
Barring serious extenuating circumstances, an untested functional change in 
llvm is not complete. And as time goes on it becomes less and less likely that 
we'll revisit this. I think it's a good idea to revert this until there's a 
test.

vedant

> On Feb 6, 2018, at 7:42 AM, Davide Italiano via lldb-commits 
>  wrote:
> 
> ping. I might consider reverting this and the other commits without
> tests bay the end of the week unless we have a story for testing here.
> It's been one month.
> 
> On Mon, Feb 5, 2018 at 9:44 AM, Davide Italiano  wrote:
>> On Mon, Jan 29, 2018 at 10:17 AM, Jason Molenda  wrote:
>>> 
>>> 
 On Jan 28, 2018, at 9:59 PM, Davide Italiano  wrote:
 
 On Thu, Jan 11, 2018 at 5:26 PM, Davide Italiano  
 wrote:
> On Thu, Jan 11, 2018 at 5:16 PM, Jason Molenda via lldb-commits
>  wrote:
>> Author: jmolenda
>> Date: Thu Jan 11 17:16:13 2018
>> New Revision: 322339
>> 
>> URL: http://llvm.org/viewvc/llvm-project?rev=322339&view=rev
>> Log:
>> When parsing the target.xml register file, if no architecture has
>> been specified yet (either by the user, or by one of the lldb
>> extensions like qHostInfo or qProcessInfo), and the target.xml
>> includes a  tag specifying x86_64, set the architecture
>> appropriately.
>> 
>> I'm not sure what we can expect to see in the  tag, so
>> I'm only doing this for x86_64 right now where I've seen "i386:x86_64"
>> used.  I've seen a target.xml from a jtag board that sends just "arm"
>> because it doesn't know more specifically what type of board it is
>> connected to...
>> 
>> 
>> 
> 
> Jason,
> is there a way to test this change?
> 
 
 ping? Any news on this front?
>>> 
>>> Thanks for the reminder.  I need to look at doing this - I'm in the middle 
>>> of another patch right now but I'll return to this after that.
>> 
>> weekly ping :)
>> 
>> --
>> Davide
> ___
> lldb-commits mailing list
> lldb-commits@lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

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


Re: [Lldb-commits] [lldb] r324743 - [Testsuite] Remove leak tests, it's not useful anymore.

2018-02-09 Thread Vedant Kumar via lldb-commits
Nice!

vedant

> On Feb 9, 2018, at 8:06 AM, Davide Italiano via lldb-commits 
>  wrote:
> 
> Author: davide
> Date: Fri Feb  9 08:06:39 2018
> New Revision: 324743
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=324743&view=rev
> Log:
> [Testsuite] Remove leak tests, it's not useful anymore.
> 
> This only worked on MacOS, which now ships a newer version of
> python without this bug. As such, we don't leak the fd, and
> this test is not needed anymore (as it also hardcoded the python
> version in the check).
> 
> Removed:
>
> lldb/trunk/packages/Python/lldbsuite/test/functionalities/avoids-fd-leak/Makefile
>
> lldb/trunk/packages/Python/lldbsuite/test/functionalities/avoids-fd-leak/TestFdLeak.py
>
> lldb/trunk/packages/Python/lldbsuite/test/functionalities/avoids-fd-leak/main.c
> 
> Removed: 
> lldb/trunk/packages/Python/lldbsuite/test/functionalities/avoids-fd-leak/Makefile
> URL: 
> http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/avoids-fd-leak/Makefile?rev=324742&view=auto
> ==
> --- 
> lldb/trunk/packages/Python/lldbsuite/test/functionalities/avoids-fd-leak/Makefile
>  (original)
> +++ 
> lldb/trunk/packages/Python/lldbsuite/test/functionalities/avoids-fd-leak/Makefile
>  (removed)
> @@ -1,5 +0,0 @@
> -LEVEL = ../../make
> -
> -C_SOURCES := main.c
> -
> -include $(LEVEL)/Makefile.rules
> 
> Removed: 
> lldb/trunk/packages/Python/lldbsuite/test/functionalities/avoids-fd-leak/TestFdLeak.py
> URL: 
> http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/avoids-fd-leak/TestFdLeak.py?rev=324742&view=auto
> ==
> --- 
> lldb/trunk/packages/Python/lldbsuite/test/functionalities/avoids-fd-leak/TestFdLeak.py
>  (original)
> +++ 
> lldb/trunk/packages/Python/lldbsuite/test/functionalities/avoids-fd-leak/TestFdLeak.py
>  (removed)
> @@ -1,108 +0,0 @@
> -"""
> -Test whether a process started by lldb has no extra file descriptors open.
> -"""
> -
> -from __future__ import print_function
> -
> -
> -import os
> -import lldb
> -from lldbsuite.test import lldbutil
> -from lldbsuite.test.lldbtest import *
> -from lldbsuite.test.decorators import *
> -
> -
> -def python_leaky_fd_version(test):
> -import sys
> -# Python random module leaks file descriptors on some versions.
> -if sys.version_info >= (2, 7, 8) and sys.version_info < (2, 7, 10):
> -return "Python random module leaks file descriptors in this python 
> version"
> -return None
> -
> -
> -class AvoidsFdLeakTestCase(TestBase):
> -
> -NO_DEBUG_INFO_TESTCASE = True
> -
> -mydir = TestBase.compute_mydir(__file__)
> -
> -@expectedFailure(python_leaky_fd_version, "bugs.freebsd.org/197376")
> -@expectedFailureAll(
> -oslist=['freebsd'],
> -bugnumber="llvm.org/pr25624 still failing with Python 2.7.10")
> -# The check for descriptor leakage needs to be implemented differently
> -# here.
> -@skipIfWindows
> -@skipIfTargetAndroid()  # Android have some other file descriptors open 
> by the shell
> -@skipIfDarwinEmbedded #   # debugserver on ios 
> has an extra fd open on launch
> -def test_fd_leak_basic(self):
> -self.do_test([])
> -
> -@expectedFailure(python_leaky_fd_version, "bugs.freebsd.org/197376")
> -@expectedFailureAll(
> -oslist=['freebsd'],
> -bugnumber="llvm.org/pr25624 still failing with Python 2.7.10")
> -# The check for descriptor leakage needs to be implemented differently
> -# here.
> -@skipIfWindows
> -@skipIfTargetAndroid()  # Android have some other file descriptors open 
> by the shell
> -@skipIfDarwinEmbedded #   # debugserver on ios 
> has an extra fd open on launch
> -def test_fd_leak_log(self):
> -self.do_test(["log enable -f '/dev/null' lldb commands"])
> -
> -def do_test(self, commands):
> -self.build()
> -exe = self.getBuildArtifact("a.out")
> -
> -for c in commands:
> -self.runCmd(c)
> -
> -target = self.dbg.CreateTarget(exe)
> -
> -process = target.LaunchSimple(
> -None, None, self.get_process_working_directory())
> -self.assertTrue(process, PROCESS_IS_VALID)
> -
> -self.assertTrue(
> -process.GetState() == lldb.eStateExited,
> -"Process should have exited.")
> -self.assertTrue(
> -process.GetExitStatus() == 0,
> -"Process returned non-zero status. Were incorrect file 
> descriptors passed?")
> -
> -@expectedFailure(python_leaky_fd_version, "bugs.freebsd.org/197376")
> -@expectedFailureAll(
> -oslist=['freebsd'],
> -bugnumber="llvm.org/pr25624 still failing with Python 2.7.10")
> -# The check for descriptor leakage needs to be implemented differently
> -# here.
> -@skipIfWindows
> -

[Lldb-commits] [lldb] r325068 - [cmake] Darwin: Copy in the system debugserver if needed

2018-02-13 Thread Vedant Kumar via lldb-commits
Author: vedantk
Date: Tue Feb 13 15:05:46 2018
New Revision: 325068

URL: http://llvm.org/viewvc/llvm-project?rev=325068&view=rev
Log:
[cmake] Darwin: Copy in the system debugserver if needed

This makes the built debugger functional on Darwin when compiling
without code signing (as documented in docs/code-signing.txt).

Modified:
lldb/trunk/CMakeLists.txt
lldb/trunk/test/CMakeLists.txt
lldb/trunk/tools/debugserver/source/CMakeLists.txt
lldb/trunk/unittests/tools/lldb-server/CMakeLists.txt

Modified: lldb/trunk/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/CMakeLists.txt?rev=325068&r1=325067&r2=325068&view=diff
==
--- lldb/trunk/CMakeLists.txt (original)
+++ lldb/trunk/CMakeLists.txt Tue Feb 13 15:05:46 2018
@@ -56,6 +56,22 @@ if (NOT LLDB_DISABLE_PYTHON)
 
   add_subdirectory(scripts)
 endif ()
+
+if(CMAKE_HOST_APPLE)
+  if(LLDB_CODESIGN_IDENTITY)
+set(DEBUGSERVER_PATH $)
+  else()
+execute_process(
+  COMMAND xcode-select -p
+  OUTPUT_VARIABLE XCODE_DEV_DIR)
+string(STRIP ${XCODE_DEV_DIR} XCODE_DEV_DIR)
+set(DEBUGSERVER_PATH
+  
"${XCODE_DEV_DIR}/../SharedFrameworks/LLDB.framework/Resources/debugserver")
+set(SKIP_DEBUGSERVER True)
+  endif()
+  message(STATUS "Path to the lldb debugserver: ${DEBUGSERVER_PATH}")
+endif()
+
 add_subdirectory(source)
 add_subdirectory(tools)
 

Modified: lldb/trunk/test/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/CMakeLists.txt?rev=325068&r1=325067&r2=325068&view=diff
==
--- lldb/trunk/test/CMakeLists.txt (original)
+++ lldb/trunk/test/CMakeLists.txt Tue Feb 13 15:05:46 2018
@@ -110,17 +110,6 @@ if (NOT ${CMAKE_SYSTEM_NAME} MATCHES "Wi
 endif()
 
 if(CMAKE_HOST_APPLE)
-  if(LLDB_CODESIGN_IDENTITY)
-set(DEBUGSERVER_PATH $)
-  else()
-execute_process(
-  COMMAND xcode-select -p
-  OUTPUT_VARIABLE XCODE_DEV_DIR)
-string(STRIP ${XCODE_DEV_DIR} XCODE_DEV_DIR)
-set(DEBUGSERVER_PATH
-  
"${XCODE_DEV_DIR}/../SharedFrameworks/LLDB.framework/Resources/debugserver")
-  endif()
-  message(STATUS "Path to the lldb debugserver: ${DEBUGSERVER_PATH}")
   list(APPEND LLDB_TEST_COMMON_ARGS --server ${DEBUGSERVER_PATH})
 endif()
 

Modified: lldb/trunk/tools/debugserver/source/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/CMakeLists.txt?rev=325068&r1=325067&r2=325068&view=diff
==
--- lldb/trunk/tools/debugserver/source/CMakeLists.txt (original)
+++ lldb/trunk/tools/debugserver/source/CMakeLists.txt Tue Feb 13 15:05:46 2018
@@ -195,7 +195,15 @@ if("${LLDB_CODESIGN_IDENTITY}" STREQUAL
 endif()
 option(LLDB_USE_ENTITLEMENTS "Use entitlements when codesigning (Defaults Off 
when using lldb_codesign identity, otherwise On)" 
${LLDB_USE_ENTITLEMENTS_Default})
 
-if (NOT ("${LLDB_CODESIGN_IDENTITY}" STREQUAL ""))
+if ("${LLDB_CODESIGN_IDENTITY}" STREQUAL "")
+  if (CMAKE_HOST_APPLE)
+# If we haven't built a signed debugserver, copy the one from the system.
+add_custom_target(debugserver
+  COMMAND ${CMAKE_COMMAND} -E copy_if_different ${DEBUGSERVER_PATH} 
${CMAKE_BINARY_DIR}/bin
+  VERBATIM
+  COMMENT "Copying the system debugserver to LLDB's binaries directory.")
+  endif()
+else()
   if(LLDB_USE_ENTITLEMENTS)
 set(entitlements_flags --entitlements ${entitlements_xml})
   endif()

Modified: lldb/trunk/unittests/tools/lldb-server/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/tools/lldb-server/CMakeLists.txt?rev=325068&r1=325067&r2=325068&view=diff
==
--- lldb/trunk/unittests/tools/lldb-server/CMakeLists.txt (original)
+++ lldb/trunk/unittests/tools/lldb-server/CMakeLists.txt Tue Feb 13 15:05:46 
2018
@@ -13,7 +13,7 @@ add_lldb_test_executable(thread_inferior
 add_lldb_test_executable(environment_check inferior/environment_check.cpp)
 
 if (CMAKE_SYSTEM_NAME MATCHES "Darwin")
-  add_definitions(-DLLDB_SERVER="$" 
-DLLDB_SERVER_IS_DEBUGSERVER=1)
+  add_definitions(-DLLDB_SERVER="${DEBUGSERVER_PATH}" 
-DLLDB_SERVER_IS_DEBUGSERVER=1)
 else()
   add_definitions(-DLLDB_SERVER="$" 
-DLLDB_SERVER_IS_DEBUGSERVER=0)
 endif()


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


Re: [Lldb-commits] [lldb] r325068 - [cmake] Darwin: Copy in the system debugserver if needed

2018-02-13 Thread Vedant Kumar via lldb-commits
@Davide I think you ran into this issue yesterday, let me know if this resolves 
it for you.

vedant

> On Feb 13, 2018, at 3:05 PM, Vedant Kumar via lldb-commits 
>  wrote:
> 
> Author: vedantk
> Date: Tue Feb 13 15:05:46 2018
> New Revision: 325068
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=325068&view=rev
> Log:
> [cmake] Darwin: Copy in the system debugserver if needed
> 
> This makes the built debugger functional on Darwin when compiling
> without code signing (as documented in docs/code-signing.txt).
> 
> Modified:
>lldb/trunk/CMakeLists.txt
>lldb/trunk/test/CMakeLists.txt
>lldb/trunk/tools/debugserver/source/CMakeLists.txt
>lldb/trunk/unittests/tools/lldb-server/CMakeLists.txt
> 
> Modified: lldb/trunk/CMakeLists.txt
> URL: 
> http://llvm.org/viewvc/llvm-project/lldb/trunk/CMakeLists.txt?rev=325068&r1=325067&r2=325068&view=diff
> ==
> --- lldb/trunk/CMakeLists.txt (original)
> +++ lldb/trunk/CMakeLists.txt Tue Feb 13 15:05:46 2018
> @@ -56,6 +56,22 @@ if (NOT LLDB_DISABLE_PYTHON)
> 
>   add_subdirectory(scripts)
> endif ()
> +
> +if(CMAKE_HOST_APPLE)
> +  if(LLDB_CODESIGN_IDENTITY)
> +set(DEBUGSERVER_PATH $)
> +  else()
> +execute_process(
> +  COMMAND xcode-select -p
> +  OUTPUT_VARIABLE XCODE_DEV_DIR)
> +string(STRIP ${XCODE_DEV_DIR} XCODE_DEV_DIR)
> +set(DEBUGSERVER_PATH
> +  
> "${XCODE_DEV_DIR}/../SharedFrameworks/LLDB.framework/Resources/debugserver")
> +set(SKIP_DEBUGSERVER True)
> +  endif()
> +  message(STATUS "Path to the lldb debugserver: ${DEBUGSERVER_PATH}")
> +endif()
> +
> add_subdirectory(source)
> add_subdirectory(tools)
> 
> 
> Modified: lldb/trunk/test/CMakeLists.txt
> URL: 
> http://llvm.org/viewvc/llvm-project/lldb/trunk/test/CMakeLists.txt?rev=325068&r1=325067&r2=325068&view=diff
> ==
> --- lldb/trunk/test/CMakeLists.txt (original)
> +++ lldb/trunk/test/CMakeLists.txt Tue Feb 13 15:05:46 2018
> @@ -110,17 +110,6 @@ if (NOT ${CMAKE_SYSTEM_NAME} MATCHES "Wi
> endif()
> 
> if(CMAKE_HOST_APPLE)
> -  if(LLDB_CODESIGN_IDENTITY)
> -set(DEBUGSERVER_PATH $)
> -  else()
> -execute_process(
> -  COMMAND xcode-select -p
> -  OUTPUT_VARIABLE XCODE_DEV_DIR)
> -string(STRIP ${XCODE_DEV_DIR} XCODE_DEV_DIR)
> -set(DEBUGSERVER_PATH
> -  
> "${XCODE_DEV_DIR}/../SharedFrameworks/LLDB.framework/Resources/debugserver")
> -  endif()
> -  message(STATUS "Path to the lldb debugserver: ${DEBUGSERVER_PATH}")
>   list(APPEND LLDB_TEST_COMMON_ARGS --server ${DEBUGSERVER_PATH})
> endif()
> 
> 
> Modified: lldb/trunk/tools/debugserver/source/CMakeLists.txt
> URL: 
> http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/CMakeLists.txt?rev=325068&r1=325067&r2=325068&view=diff
> ==
> --- lldb/trunk/tools/debugserver/source/CMakeLists.txt (original)
> +++ lldb/trunk/tools/debugserver/source/CMakeLists.txt Tue Feb 13 15:05:46 
> 2018
> @@ -195,7 +195,15 @@ if("${LLDB_CODESIGN_IDENTITY}" STREQUAL
> endif()
> option(LLDB_USE_ENTITLEMENTS "Use entitlements when codesigning (Defaults Off 
> when using lldb_codesign identity, otherwise On)" 
> ${LLDB_USE_ENTITLEMENTS_Default})
> 
> -if (NOT ("${LLDB_CODESIGN_IDENTITY}" STREQUAL ""))
> +if ("${LLDB_CODESIGN_IDENTITY}" STREQUAL "")
> +  if (CMAKE_HOST_APPLE)
> +# If we haven't built a signed debugserver, copy the one from the system.
> +add_custom_target(debugserver
> +  COMMAND ${CMAKE_COMMAND} -E copy_if_different ${DEBUGSERVER_PATH} 
> ${CMAKE_BINARY_DIR}/bin
> +  VERBATIM
> +  COMMENT "Copying the system debugserver to LLDB's binaries directory.")
> +  endif()
> +else()
>   if(LLDB_USE_ENTITLEMENTS)
> set(entitlements_flags --entitlements ${entitlements_xml})
>   endif()
> 
> Modified: lldb/trunk/unittests/tools/lldb-server/CMakeLists.txt
> URL: 
> http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/tools/lldb-server/CMakeLists.txt?rev=325068&r1=325067&r2=325068&view=diff
> ==
> --- lldb/trunk/unittests/tools/lldb-server/CMakeLists.txt (original)
> +++ lldb/trunk/unittests/tools/lldb-server/CMakeLists.txt Tue Feb 13 15:05:46 
> 2018
> @@ -13,7 +13,7 @@ add_lldb_test_executable(thread_inferior
> add_lldb_test_executable(environme

Re: [Lldb-commits] [lldb] r325068 - [cmake] Darwin: Copy in the system debugserver if needed

2018-02-13 Thread Vedant Kumar via lldb-commits
By default the cmake build doesn't build LLDB.framework, but thanks for raising 
the point, we can avoid the copy when that build setting is in place.

vedant

> On Feb 13, 2018, at 3:11 PM, Greg Clayton  wrote:
> 
> If "debugserver" isn't put into the LLDB.framework, then it falls back to 
> using the one in the currently selected Xcode. We don't really need to copy 
> it if we just want to use the active system version?
> 
>> On Feb 13, 2018, at 3:08 PM, Vedant Kumar via lldb-commits 
>>  wrote:
>> 
>> @Davide I think you ran into this issue yesterday, let me know if this 
>> resolves it for you.
>> 
>> vedant
>> 
>>> On Feb 13, 2018, at 3:05 PM, Vedant Kumar via lldb-commits 
>>>  wrote:
>>> 
>>> Author: vedantk
>>> Date: Tue Feb 13 15:05:46 2018
>>> New Revision: 325068
>>> 
>>> URL: http://llvm.org/viewvc/llvm-project?rev=325068&view=rev
>>> Log:
>>> [cmake] Darwin: Copy in the system debugserver if needed
>>> 
>>> This makes the built debugger functional on Darwin when compiling
>>> without code signing (as documented in docs/code-signing.txt).
>>> 
>>> Modified:
>>>  lldb/trunk/CMakeLists.txt
>>>  lldb/trunk/test/CMakeLists.txt
>>>  lldb/trunk/tools/debugserver/source/CMakeLists.txt
>>>  lldb/trunk/unittests/tools/lldb-server/CMakeLists.txt
>>> 
>>> Modified: lldb/trunk/CMakeLists.txt
>>> URL: 
>>> http://llvm.org/viewvc/llvm-project/lldb/trunk/CMakeLists.txt?rev=325068&r1=325067&r2=325068&view=diff
>>> ==
>>> --- lldb/trunk/CMakeLists.txt (original)
>>> +++ lldb/trunk/CMakeLists.txt Tue Feb 13 15:05:46 2018
>>> @@ -56,6 +56,22 @@ if (NOT LLDB_DISABLE_PYTHON)
>>> 
>>> add_subdirectory(scripts)
>>> endif ()
>>> +
>>> +if(CMAKE_HOST_APPLE)
>>> +  if(LLDB_CODESIGN_IDENTITY)
>>> +set(DEBUGSERVER_PATH $)
>>> +  else()
>>> +execute_process(
>>> +  COMMAND xcode-select -p
>>> +  OUTPUT_VARIABLE XCODE_DEV_DIR)
>>> +string(STRIP ${XCODE_DEV_DIR} XCODE_DEV_DIR)
>>> +set(DEBUGSERVER_PATH
>>> +  
>>> "${XCODE_DEV_DIR}/../SharedFrameworks/LLDB.framework/Resources/debugserver")
>>> +set(SKIP_DEBUGSERVER True)
>>> +  endif()
>>> +  message(STATUS "Path to the lldb debugserver: ${DEBUGSERVER_PATH}")
>>> +endif()
>>> +
>>> add_subdirectory(source)
>>> add_subdirectory(tools)
>>> 
>>> 
>>> Modified: lldb/trunk/test/CMakeLists.txt
>>> URL: 
>>> http://llvm.org/viewvc/llvm-project/lldb/trunk/test/CMakeLists.txt?rev=325068&r1=325067&r2=325068&view=diff
>>> ==
>>> --- lldb/trunk/test/CMakeLists.txt (original)
>>> +++ lldb/trunk/test/CMakeLists.txt Tue Feb 13 15:05:46 2018
>>> @@ -110,17 +110,6 @@ if (NOT ${CMAKE_SYSTEM_NAME} MATCHES "Wi
>>> endif()
>>> 
>>> if(CMAKE_HOST_APPLE)
>>> -  if(LLDB_CODESIGN_IDENTITY)
>>> -set(DEBUGSERVER_PATH $)
>>> -  else()
>>> -execute_process(
>>> -  COMMAND xcode-select -p
>>> -  OUTPUT_VARIABLE XCODE_DEV_DIR)
>>> -string(STRIP ${XCODE_DEV_DIR} XCODE_DEV_DIR)
>>> -set(DEBUGSERVER_PATH
>>> -  
>>> "${XCODE_DEV_DIR}/../SharedFrameworks/LLDB.framework/Resources/debugserver")
>>> -  endif()
>>> -  message(STATUS "Path to the lldb debugserver: ${DEBUGSERVER_PATH}")
>>> list(APPEND LLDB_TEST_COMMON_ARGS --server ${DEBUGSERVER_PATH})
>>> endif()
>>> 
>>> 
>>> Modified: lldb/trunk/tools/debugserver/source/CMakeLists.txt
>>> URL: 
>>> http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/CMakeLists.txt?rev=325068&r1=325067&r2=325068&view=diff
>>> ==
>>> --- lldb/trunk/tools/debugserver/source/CMakeLists.txt (original)
>>> +++ lldb/trunk/tools/debugserver/source/CMakeLists.txt Tue Feb 13 15:05:46 
>>> 2018
>>> @@ -195,7 +195,15 @@ if("${LLDB_CODESIGN_IDENTITY}" STREQUAL
>>> endif()
>>> option(LLDB_USE_ENTITLEMENTS "Use entitlements when codesigning (Defaults 
>>> Off when using lldb_codesign identity, otherwise On)" 
>&

[Lldb-commits] [lldb] r325841 - [ObjC] Fix the NSConcreteData formatter and test it

2018-02-22 Thread Vedant Kumar via lldb-commits
Author: vedantk
Date: Thu Feb 22 15:48:21 2018
New Revision: 325841

URL: http://llvm.org/viewvc/llvm-project?rev=325841&view=rev
Log:
[ObjC] Fix the NSConcreteData formatter and test it

The length field of an NSConcreteData lives one word past the start of
the object, not two.

Modified:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py

lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/main.m
lldb/trunk/source/Plugins/Language/ObjC/Cocoa.cpp

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py?rev=325841&r1=325840&r2=325841&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py
 Thu Feb 22 15:48:21 2018
@@ -243,7 +243,7 @@ class ObjCDataFormatterTestCase(TestBase
 
 def nsdata_data_formatter_commands(self):
 self.expect(
-'frame variable immutableData mutableData data_ref 
mutable_data_ref mutable_string_ref',
+'frame variable immutableData mutableData data_ref 
mutable_data_ref mutable_string_ref concreteData concreteMutableData',
 substrs=[
 '(NSData *) immutableData = ',
 ' 4 bytes',
@@ -254,7 +254,12 @@ class ObjCDataFormatterTestCase(TestBase
 '(CFMutableDataRef) mutable_data_ref = ',
 '@"5 bytes"',
 '(CFMutableStringRef) mutable_string_ref = ',
-' @"Wish ya knew"'])
+' @"Wish ya knew"',
+'(NSData *) concreteData = ',
+' 10 bytes',
+'(NSMutableData *) concreteMutableData = ',
+' 10 bytes'])
+
 
 def nsurl_data_formatter_commands(self):
 self.expect(

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/main.m
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/main.m?rev=325841&r1=325840&r2=325841&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/main.m
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/main.m
 Thu Feb 22 15:48:21 2018
@@ -396,6 +396,12 @@ int main (int argc, const char * argv[])
NSData *immutableData = [[NSData alloc] initWithBytes:"HELLO" 
length:4];
NSData *mutableData = [[NSMutableData alloc] initWithBytes:"NODATA" 
length:6];
 
+   // No-copy versions of NSData initializers use NSConcreteData if 
over 2^16 elements are specified.
+   unsigned concreteLength = 10;
+   void *zeroes = calloc(1, concreteLength);
+   NSData *concreteData = [[NSData alloc] initWithBytesNoCopy:zeroes 
length:concreteLength];
+   NSMutableData *concreteMutableData = [[NSMutableData alloc] 
initWithBytesNoCopy:zeroes length:concreteLength];
+
[mutableData appendBytes:"MOREDATA" length:8];
 
[immutableData length];
@@ -610,6 +616,7 @@ int main (int argc, const char * argv[])
 [molecule setAtoms:nil];
 [molecule setAtoms:[NSMutableArray new]];
 
+free(zeroes);
 [pool drain];
 return 0;
 }

Modified: lldb/trunk/source/Plugins/Language/ObjC/Cocoa.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Language/ObjC/Cocoa.cpp?rev=325841&r1=325840&r2=325841&view=diff
==
--- lldb/trunk/source/Plugins/Language/ObjC/Cocoa.cpp (original)
+++ lldb/trunk/source/Plugins/Language/ObjC/Cocoa.cpp Thu Feb 22 15:48:21 2018
@@ -871,28 +871,34 @@ bool lldb_private::formatters::NSDataSum
 
   uint64_t value = 0;
 
-  const char *class_name = descriptor->GetClassName().GetCString();
+  llvm::StringRef class_name = descriptor->GetClassName().GetCString();
 
-  if (!class_name || !*class_name)
+  if (class_name.empty())
 return false;
 
-  if (!strcmp(class_name, "NSConcreteData") ||
-  !strcmp(class_name, "NSConcreteMutableData") ||
-  !strcmp(class_name, "__NSCFData")) {
-uint32_t offset = (is_64bit ? 16 : 8);
+  bool isNSConcreteData = class_name == "NSConcreteData";
+  bool isNSConcreteMutableData = class_name == "NSConcreteMutableData";
+  bool isNSCFData = class_name == "__NSCFData";
+  if (isNSConcre

[Lldb-commits] [lldb] r325847 - Delete some unused #includes of CleanUp.h, NFC

2018-02-22 Thread Vedant Kumar via lldb-commits
Author: vedantk
Date: Thu Feb 22 16:29:40 2018
New Revision: 325847

URL: http://llvm.org/viewvc/llvm-project?rev=325847&view=rev
Log:
Delete some unused #includes of CleanUp.h, NFC

Modified:
lldb/trunk/source/Commands/CommandCompletions.cpp
lldb/trunk/source/Host/common/Host.cpp
lldb/trunk/source/Host/freebsd/Host.cpp
lldb/trunk/source/Host/netbsd/Host.cpp
lldb/trunk/source/Host/openbsd/Host.cpp
lldb/trunk/source/Interpreter/CommandInterpreter.cpp

Modified: lldb/trunk/source/Commands/CommandCompletions.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandCompletions.cpp?rev=325847&r1=325846&r2=325847&view=diff
==
--- lldb/trunk/source/Commands/CommandCompletions.cpp (original)
+++ lldb/trunk/source/Commands/CommandCompletions.cpp Thu Feb 22 16:29:40 2018
@@ -30,7 +30,6 @@
 #include "lldb/Symbol/CompileUnit.h"
 #include "lldb/Symbol/Variable.h"
 #include "lldb/Target/Target.h"
-#include "lldb/Utility/CleanUp.h"
 #include "lldb/Utility/FileSpec.h"
 #include "lldb/Utility/StreamString.h"
 #include "lldb/Utility/TildeExpressionResolver.h"

Modified: lldb/trunk/source/Host/common/Host.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/Host.cpp?rev=325847&r1=325846&r2=325847&view=diff
==
--- lldb/trunk/source/Host/common/Host.cpp (original)
+++ lldb/trunk/source/Host/common/Host.cpp Thu Feb 22 16:29:40 2018
@@ -59,7 +59,6 @@
 #include "lldb/Target/FileAction.h"
 #include "lldb/Target/ProcessLaunchInfo.h"
 #include "lldb/Target/UnixSignals.h"
-#include "lldb/Utility/CleanUp.h"
 #include "lldb/Utility/DataBufferLLVM.h"
 #include "lldb/Utility/FileSpec.h"
 #include "lldb/Utility/Log.h"

Modified: lldb/trunk/source/Host/freebsd/Host.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/freebsd/Host.cpp?rev=325847&r1=325846&r2=325847&view=diff
==
--- lldb/trunk/source/Host/freebsd/Host.cpp (original)
+++ lldb/trunk/source/Host/freebsd/Host.cpp Thu Feb 22 16:29:40 2018
@@ -29,7 +29,6 @@
 #include "lldb/Host/Host.h"
 #include "lldb/Host/HostInfo.h"
 #include "lldb/Target/Process.h"
-#include "lldb/Utility/CleanUp.h"
 #include "lldb/Utility/DataBufferHeap.h"
 #include "lldb/Utility/DataExtractor.h"
 #include "lldb/Utility/Endian.h"

Modified: lldb/trunk/source/Host/netbsd/Host.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/netbsd/Host.cpp?rev=325847&r1=325846&r2=325847&view=diff
==
--- lldb/trunk/source/Host/netbsd/Host.cpp (original)
+++ lldb/trunk/source/Host/netbsd/Host.cpp Thu Feb 22 16:29:40 2018
@@ -28,7 +28,6 @@
 #include "lldb/Host/Host.h"
 #include "lldb/Host/HostInfo.h"
 #include "lldb/Target/Process.h"
-#include "lldb/Utility/CleanUp.h"
 #include "lldb/Utility/DataBufferHeap.h"
 #include "lldb/Utility/DataExtractor.h"
 #include "lldb/Utility/Endian.h"

Modified: lldb/trunk/source/Host/openbsd/Host.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/openbsd/Host.cpp?rev=325847&r1=325846&r2=325847&view=diff
==
--- lldb/trunk/source/Host/openbsd/Host.cpp (original)
+++ lldb/trunk/source/Host/openbsd/Host.cpp Thu Feb 22 16:29:40 2018
@@ -25,7 +25,6 @@
 #include "lldb/Host/Host.h"
 #include "lldb/Host/HostInfo.h"
 #include "lldb/Target/Process.h"
-#include "lldb/Utility/CleanUp.h"
 #include "lldb/Utility/DataBufferHeap.h"
 #include "lldb/Utility/DataExtractor.h"
 #include "lldb/Utility/Endian.h"

Modified: lldb/trunk/source/Interpreter/CommandInterpreter.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/CommandInterpreter.cpp?rev=325847&r1=325846&r2=325847&view=diff
==
--- lldb/trunk/source/Interpreter/CommandInterpreter.cpp (original)
+++ lldb/trunk/source/Interpreter/CommandInterpreter.cpp Thu Feb 22 16:29:40 
2018
@@ -67,8 +67,6 @@
 #include "lldb/Target/TargetList.h"
 #include "lldb/Target/Thread.h"
 
-#include "lldb/Utility/CleanUp.h"
-
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/ADT/SmallString.h"
 #include "llvm/Support/Path.h"


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


[Lldb-commits] [lldb] r325964 - [Utility] Simplify and generalize the CleanUp helper, NFC

2018-02-23 Thread Vedant Kumar via lldb-commits
Author: vedantk
Date: Fri Feb 23 14:08:38 2018
New Revision: 325964

URL: http://llvm.org/viewvc/llvm-project?rev=325964&view=rev
Log:
[Utility] Simplify and generalize the CleanUp helper, NFC

Removing the template arguments and most of the mutating methods from
CleanUp makes it easier to understand and reuse.

In its present state, CleanUp would be too cumbersome to adapt to cases
where multiple objects need to be released. Take for example this change
in swift-lldb:

  
https://github.com/apple/swift-lldb/pull/334/files#diff-6f474df750f75c8ba675f2a8408a5629R219

This change is simple to express with the new CleanUp, but not so simple
with the old version.

Differential Revision: https://reviews.llvm.org/D43662

Added:
lldb/trunk/unittests/Utility/CleanUpTest.cpp
Modified:
lldb/trunk/include/lldb/Utility/CleanUp.h
lldb/trunk/lldb.xcodeproj/project.pbxproj
lldb/trunk/source/Host/macosx/Host.mm
lldb/trunk/source/Host/macosx/Symbols.cpp
lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
lldb/trunk/unittests/Utility/CMakeLists.txt

Modified: lldb/trunk/include/lldb/Utility/CleanUp.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Utility/CleanUp.h?rev=325964&r1=325963&r2=325964&view=diff
==
--- lldb/trunk/include/lldb/Utility/CleanUp.h (original)
+++ lldb/trunk/include/lldb/Utility/CleanUp.h Fri Feb 23 14:08:38 2018
@@ -13,249 +13,31 @@
 #include "lldb/lldb-public.h"
 #include 
 
-namespace lldb_utility {
+namespace lldb_private {
 
-//--
-// Templated class that guarantees that a cleanup callback function will
-// be called. The cleanup function will be called once under the
-// following conditions:
-// - when the object goes out of scope
-// - when the user explicitly calls clean.
-// - the current value will be cleaned up when a new value is set using
-//   set(T value) as long as the current value hasn't already been cleaned.
-//
-// This class is designed to be used with simple types for type T (like
-// file descriptors, opaque handles, pointers, etc). If more complex
-// type T objects are desired, we need to probably specialize this class
-// to take "const T&" for all input T parameters. Yet if a type T is
-// complex already it might be better to build the cleanup functionality
-// into T.
-//
-// The cleanup function must take one argument that is of type T.
-// The calback function return type is R. The return value is currently
-// needed for "CallbackType". If there is an easy way to get around the
-// need for the return value we can change this class.
-//
-// The two template parameters are:
-//T - The variable type of value that will be stored and used as the
-//  sole argument for the cleanup callback.
-//R - The return type for the cleanup function.
-//
-// EXAMPLES
-//  // Use with file handles that get opened where you want to close
-//  // them. Below we use "int open(const char *path, int oflag, ...)"
-//  // which returns an integer file descriptor. -1 is the invalid file
-//  // descriptor so to make an object that will call "int close(int fd)"
-//  // automatically we can use:
-//
-//  CleanUp  fd(open("/tmp/a.txt", O_RDONLY, 0), -1, close);
-//
-//  // malloc/free example
-//  CleanUp  malloced_bytes(malloc(32), NULL, free);
-//--
-template  class CleanUp {
-public:
-  typedef T value_type;
-  typedef std::function CallbackType;
-
-  //--
-  // Constructor that sets the current value only. No values are
-  // considered to be invalid and the cleanup function will be called
-  // regardless of the value of m_current_value.
-  //--
-  CleanUp(value_type value, CallbackType callback)
-  : m_current_value(value), m_invalid_value(), m_callback(callback),
-m_callback_called(false), m_invalid_value_is_valid(false) {}
-
-  //--
-  // Constructor that sets the current value and also the invalid value.
-  // The cleanup function will be called on "m_value" as long as it isn't
-  // equal to "m_invalid_value".
-  //--
-  CleanUp(value_type value, value_type invalid, CallbackType callback)
-  : m_current_value(value), m_invalid_value(invalid), m_callback(callback),
-m_callback_called(false), m_invalid_value_is_valid(true) {}
-
-  //--
-  // Automatically cleanup when this object goes out of scope.
-  //--
-  ~CleanUp() { clean(); }
-
-  //---

[Lldb-commits] [lldb] r325974 - Fix a compiler warning in ModuleCacheTest.cpp, NFC

2018-02-23 Thread Vedant Kumar via lldb-commits
Author: vedantk
Date: Fri Feb 23 15:18:27 2018
New Revision: 325974

URL: http://llvm.org/viewvc/llvm-project?rev=325974&view=rev
Log:
Fix a compiler warning in ModuleCacheTest.cpp, NFC

Modified:
lldb/trunk/unittests/Target/ModuleCacheTest.cpp

Modified: lldb/trunk/unittests/Target/ModuleCacheTest.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/Target/ModuleCacheTest.cpp?rev=325974&r1=325973&r2=325974&view=diff
==
--- lldb/trunk/unittests/Target/ModuleCacheTest.cpp (original)
+++ lldb/trunk/unittests/Target/ModuleCacheTest.cpp Fri Feb 23 15:18:27 2018
@@ -102,8 +102,8 @@ void ModuleCacheTest::TryGetAndPut(const
 
   Status error = mc.GetAndPut(
   cache_dir, hostname, module_spec,
-  [this, &download_called](const ModuleSpec &module_spec,
-   const FileSpec &tmp_download_file_spec) {
+  [&download_called](const ModuleSpec &module_spec,
+ const FileSpec &tmp_download_file_spec) {
 download_called = true;
 EXPECT_STREQ(GetDummyRemotePath().GetCString(),
  module_spec.GetFileSpec().GetCString());


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


[Lldb-commits] [lldb] r326002 - Delete dead code in MachVMMemory.cpp, NFC

2018-02-23 Thread Vedant Kumar via lldb-commits
Author: vedantk
Date: Fri Feb 23 16:17:05 2018
New Revision: 326002

URL: http://llvm.org/viewvc/llvm-project?rev=326002&view=rev
Log:
Delete dead code in MachVMMemory.cpp, NFC

This addresses a compiler warning.

Modified:
lldb/trunk/tools/debugserver/source/MacOSX/MachVMMemory.cpp

Modified: lldb/trunk/tools/debugserver/source/MacOSX/MachVMMemory.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/MacOSX/MachVMMemory.cpp?rev=326002&r1=326001&r2=326002&view=diff
==
--- lldb/trunk/tools/debugserver/source/MacOSX/MachVMMemory.cpp (original)
+++ lldb/trunk/tools/debugserver/source/MacOSX/MachVMMemory.cpp Fri Feb 23 
16:17:05 2018
@@ -113,42 +113,6 @@ static uint64_t GetPhysicalMemory() {
   return physical_memory;
 }
 
-// Test whether the virtual address is within the architecture's shared region.
-static bool InSharedRegion(mach_vm_address_t addr, cpu_type_t type) {
-  mach_vm_address_t base = 0, size = 0;
-
-  switch (type) {
-#if defined(CPU_TYPE_ARM64) && defined(SHARED_REGION_BASE_ARM64)
-  case CPU_TYPE_ARM64:
-base = SHARED_REGION_BASE_ARM64;
-size = SHARED_REGION_SIZE_ARM64;
-break;
-#endif
-
-  case CPU_TYPE_ARM:
-base = SHARED_REGION_BASE_ARM;
-size = SHARED_REGION_SIZE_ARM;
-break;
-
-  case CPU_TYPE_X86_64:
-base = SHARED_REGION_BASE_X86_64;
-size = SHARED_REGION_SIZE_X86_64;
-break;
-
-  case CPU_TYPE_I386:
-base = SHARED_REGION_BASE_I386;
-size = SHARED_REGION_SIZE_I386;
-break;
-
-  default: {
-// Log error abut unknown CPU type
-break;
-  }
-  }
-
-  return (addr >= base && addr < (base + size));
-}
-
 nub_bool_t MachVMMemory::GetMemoryProfile(
 DNBProfileDataScanType scanType, task_t task, struct task_basic_info ti,
 cpu_type_t cputype, nub_process_t pid, vm_statistics64_data_t &vminfo,


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


[Lldb-commits] [lldb] r326001 - [unittests] Disable lldb-server tests if an external debug server is in use

2018-02-23 Thread Vedant Kumar via lldb-commits
Author: vedantk
Date: Fri Feb 23 16:17:04 2018
New Revision: 326001

URL: http://llvm.org/viewvc/llvm-project?rev=326001&view=rev
Log:
[unittests] Disable lldb-server tests if an external debug server is in use

The lldb-server unit tests don't test the right thing when the debug
server in use is copied from somewhere else. This can lead to spurious
test failures.

Disable these unit tests when an external debug server is in use.

Fixes llvm.org/PR36494.

Modified:
lldb/trunk/tools/debugserver/source/CMakeLists.txt
lldb/trunk/unittests/tools/CMakeLists.txt

Modified: lldb/trunk/tools/debugserver/source/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/CMakeLists.txt?rev=326001&r1=326000&r2=326001&view=diff
==
--- lldb/trunk/tools/debugserver/source/CMakeLists.txt (original)
+++ lldb/trunk/tools/debugserver/source/CMakeLists.txt Fri Feb 23 16:17:04 2018
@@ -100,6 +100,7 @@ set(LLDB_CODESIGN_IDENTITY "lldb_codesig
 
 if(NOT LLDB_CODESIGN_IDENTITY STREQUAL "")
   set(DEBUGSERVER_PATH $ CACHE PATH "Path to 
debugserver.")
+  set(SKIP_DEBUGSERVER OFF CACHE BOOL "Skip building the in-tree debug server")
 else()
   execute_process(
 COMMAND xcode-select -p
@@ -107,7 +108,7 @@ else()
   string(STRIP ${XCODE_DEV_DIR} XCODE_DEV_DIR)
   set(DEBUGSERVER_PATH
 
"${XCODE_DEV_DIR}/../SharedFrameworks/LLDB.framework/Resources/debugserver" 
CACHE PATH "Path to debugserver.")
-  set(SKIP_DEBUGSERVER True)
+  set(SKIP_DEBUGSERVER ON CACHE BOOL "Skip building the in-tree debug server")
 endif()
 message(STATUS "Path to the lldb debugserver: ${DEBUGSERVER_PATH}")
 
@@ -124,7 +125,7 @@ if (APPLE)
 find_library(LOCKDOWN_LIBRARY lockdown)
 
 if(NOT BACKBOARD_LIBRARY)
-  set(SKIP_DEBUGSERVER True)
+  set(SKIP_DEBUGSERVER ON CACHE BOOL "Skip building the in-tree debug 
server" FORCE)
 endif()
   else()
 find_library(COCOA_LIBRARY Cocoa)

Modified: lldb/trunk/unittests/tools/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/tools/CMakeLists.txt?rev=326001&r1=326000&r2=326001&view=diff
==
--- lldb/trunk/unittests/tools/CMakeLists.txt (original)
+++ lldb/trunk/unittests/tools/CMakeLists.txt Fri Feb 23 16:17:04 2018
@@ -1,3 +1,8 @@
 if(CMAKE_SYSTEM_NAME MATCHES "Android|Darwin|Linux|NetBSD")
-  add_subdirectory(lldb-server)
+  if (CMAKE_SYSTEM_NAME MATCHES "Darwin" AND SKIP_DEBUGSERVER)
+# These tests are meant to test lldb-server/debugserver in isolation, and
+# don't provide any value if run against a server copied from somewhere.
+  else()
+add_subdirectory(lldb-server)
+  endif()
 endif()


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


Re: [Lldb-commits] [lldb] r323803 - Compile the LLDB tests out-of-tree.

2018-02-28 Thread Vedant Kumar via lldb-commits
Hey Adrian,

Did you mean to write cls.getBuildArtifact() here?

I'm seeing a Python exception locally when I run check-lldb-single:

Traceback (most recent call last):
  File 
"/Users/vsk/src/llvm.org-lldbsan/llvm/tools/lldb/packages/Python/lldbsuite/test/lldbtest.py",
 line 584, in tearDownClass
cls.classCleanup()
  File 
"/Users/vsk/src/llvm.org-lldbsan/llvm/tools/lldb/packages/Python/lldbsuite/test/settings/quoting/TestQuoting.py",
 line 25, in classCleanup
cls.RemoveTempFile(self.getBuildArtifact("stdout.txt"))
NameError: global name 'self' is not defined

vedant

> On Jan 30, 2018, at 10:29 AM, Adrian Prantl via lldb-commits 
>  wrote:
> 
> ==
> --- lldb/trunk/packages/Python/lldbsuite/test/settings/quoting/TestQuoting.py 
> (original)
> +++ lldb/trunk/packages/Python/lldbsuite/test/settings/quoting/TestQuoting.py 
> Tue Jan 30 10:29:16 2018
> @@ -22,7 +22,7 @@ class SettingsCommandTestCase(TestBase):
> @classmethod
> def classCleanup(cls):
> """Cleanup the test byproducts."""
> -cls.RemoveTempFile("stdout.txt")
> +cls.RemoveTempFile(self.getBuildArtifact("stdout.txt"))

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


Re: [Lldb-commits] [lldb] r323803 - Compile the LLDB tests out-of-tree.

2018-02-28 Thread Vedant Kumar via lldb-commits
Will test and commit momentarily, thanks!

vedant

> On Feb 28, 2018, at 6:47 PM, Adrian Prantl  wrote:
> 
> That looks reasonable, since this is a class method, yes. Thanks for spotting 
> it! Would you mind committing the change?
> 
> -- adrian
> 
>> On Feb 28, 2018, at 6:46 PM, Vedant Kumar > > wrote:
>> 
>> Hey Adrian,
>> 
>> Did you mean to write cls.getBuildArtifact() here?
>> 
>> I'm seeing a Python exception locally when I run check-lldb-single:
>> 
>> Traceback (most recent call last):
>>   File "/Users/vsk/src/llvm.org 
>> -lldbsan/llvm/tools/lldb/packages/Python/lldbsuite/test/lldbtest.py",
>>  line 584, in tearDownClass
>> cls.classCleanup()
>>   File "/Users/vsk/src/llvm.org 
>> -lldbsan/llvm/tools/lldb/packages/Python/lldbsuite/test/settings/quoting/TestQuoting.py",
>>  line 25, in classCleanup
>> cls.RemoveTempFile(self.getBuildArtifact("stdout.txt"))
>> NameError: global name 'self' is not defined
>> 
>> vedant
>> 
>>> On Jan 30, 2018, at 10:29 AM, Adrian Prantl via lldb-commits 
>>> mailto:lldb-commits@lists.llvm.org>> wrote:
>>> 
>>> ==
>>> --- 
>>> lldb/trunk/packages/Python/lldbsuite/test/settings/quoting/TestQuoting.py 
>>> (original)
>>> +++ 
>>> lldb/trunk/packages/Python/lldbsuite/test/settings/quoting/TestQuoting.py 
>>> Tue Jan 30 10:29:16 2018
>>> @@ -22,7 +22,7 @@ class SettingsCommandTestCase(TestBase):
>>> @classmethod
>>> def classCleanup(cls):
>>> """Cleanup the test byproducts."""
>>> -cls.RemoveTempFile("stdout.txt")
>>> +cls.RemoveTempFile(self.getBuildArtifact("stdout.txt"))
>> 
> 

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


[Lldb-commits] [lldb] r326414 - [test] Restore cleanup behavior in TestQuoting.py

2018-02-28 Thread Vedant Kumar via lldb-commits
Author: vedantk
Date: Wed Feb 28 19:03:38 2018
New Revision: 326414

URL: http://llvm.org/viewvc/llvm-project?rev=326414&view=rev
Log:
[test] Restore cleanup behavior in TestQuoting.py

Before the change to compile tests out-of-tree, the cleanup classmethod
in TestQuoting.py would remove a temp file. After the change it threw an
exception due to a malformed call to getBuildArtifact().

Bring back the old behavior.

Modified:
lldb/trunk/packages/Python/lldbsuite/test/settings/quoting/TestQuoting.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/settings/quoting/TestQuoting.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/settings/quoting/TestQuoting.py?rev=326414&r1=326413&r2=326414&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/settings/quoting/TestQuoting.py 
(original)
+++ lldb/trunk/packages/Python/lldbsuite/test/settings/quoting/TestQuoting.py 
Wed Feb 28 19:03:38 2018
@@ -22,7 +22,7 @@ class SettingsCommandTestCase(TestBase):
 @classmethod
 def classCleanup(cls):
 """Cleanup the test byproducts."""
-cls.RemoveTempFile(self.getBuildArtifact("stdout.txt"))
+cls.RemoveTempFile("stdout.txt")
 
 @no_debug_info_test
 def test_no_quote(self):


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


Re: [Lldb-commits] [lldb] r323803 - Compile the LLDB tests out-of-tree.

2018-02-28 Thread Vedant Kumar via lldb-commits
Done, r326414

> On Feb 28, 2018, at 6:48 PM, Vedant Kumar  wrote:
> 
> Will test and commit momentarily, thanks!
> 
> vedant
> 
>> On Feb 28, 2018, at 6:47 PM, Adrian Prantl > > wrote:
>> 
>> That looks reasonable, since this is a class method, yes. Thanks for 
>> spotting it! Would you mind committing the change?
>> 
>> -- adrian
>> 
>>> On Feb 28, 2018, at 6:46 PM, Vedant Kumar >> > wrote:
>>> 
>>> Hey Adrian,
>>> 
>>> Did you mean to write cls.getBuildArtifact() here?
>>> 
>>> I'm seeing a Python exception locally when I run check-lldb-single:
>>> 
>>> Traceback (most recent call last):
>>>   File "/Users/vsk/src/llvm.org 
>>> -lldbsan/llvm/tools/lldb/packages/Python/lldbsuite/test/lldbtest.py",
>>>  line 584, in tearDownClass
>>> cls.classCleanup()
>>>   File "/Users/vsk/src/llvm.org 
>>> -lldbsan/llvm/tools/lldb/packages/Python/lldbsuite/test/settings/quoting/TestQuoting.py",
>>>  line 25, in classCleanup
>>> cls.RemoveTempFile(self.getBuildArtifact("stdout.txt"))
>>> NameError: global name 'self' is not defined
>>> 
>>> vedant
>>> 
 On Jan 30, 2018, at 10:29 AM, Adrian Prantl via lldb-commits 
 mailto:lldb-commits@lists.llvm.org>> wrote:
 
 ==
 --- 
 lldb/trunk/packages/Python/lldbsuite/test/settings/quoting/TestQuoting.py 
 (original)
 +++ 
 lldb/trunk/packages/Python/lldbsuite/test/settings/quoting/TestQuoting.py 
 Tue Jan 30 10:29:16 2018
 @@ -22,7 +22,7 @@ class SettingsCommandTestCase(TestBase):
 @classmethod
 def classCleanup(cls):
 """Cleanup the test byproducts."""
 -cls.RemoveTempFile("stdout.txt")
 +cls.RemoveTempFile(self.getBuildArtifact("stdout.txt"))
>>> 
>> 
> 

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


Re: [Lldb-commits] [lldb] r326552 - [testsuite] Remove workaround for categories and inline tests.

2018-03-02 Thread Vedant Kumar via lldb-commits
Thanks for taking care of this!

vedant

> On Mar 2, 2018, at 2:38 AM, Jonas Devlieghere via lldb-commits 
>  wrote:
> 
> Author: jdevlieghere
> Date: Fri Mar  2 02:38:11 2018
> New Revision: 326552
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=326552&view=rev
> Log:
> [testsuite] Remove workaround for categories and inline tests.
> 
> Adding categories to inline tests does not work because the attribute
> is set at the function level. For methods, this means it applies to all
> instances of that particular class. While this is what we want in most
> cases, it's not for inline tests, where different instances correspond
> to different tests.
> 
> With the workaround in place, assigning a category to one test resulted
> in the category applied to *all* inline tests.
> 
> This patch removes the workaround and throws an exception with an
> informative error message, to prevent this from happening in the future.
> 
> Modified:
>lldb/trunk/packages/Python/lldbsuite/test/decorators.py
> 
> Modified: lldb/trunk/packages/Python/lldbsuite/test/decorators.py
> URL: 
> http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/decorators.py?rev=326552&r1=326551&r2=326552&view=diff
> ==
> --- lldb/trunk/packages/Python/lldbsuite/test/decorators.py (original)
> +++ lldb/trunk/packages/Python/lldbsuite/test/decorators.py Fri Mar  2 
> 02:38:11 2018
> @@ -304,15 +304,12 @@ def add_test_categories(cat):
> if isinstance(func, type) and issubclass(func, unittest2.TestCase):
> raise Exception(
> "@add_test_categories can only be used to decorate a test 
> method")
> -
> -# Update or set the categories attribute. For instance methods, the
> -# attribute must be set on the actual function.
> -func_for_attr = func
> -if inspect.ismethod(func_for_attr):
> -func_for_attr = func.__func__
> -if hasattr(func_for_attr, "categories"):
> -cat.extend(func_for_attr.categories)
> -setattr(func_for_attr, "categories", cat)
> +try:
> +if hasattr(func, "categories"):
> +cat.extend(func.categories)
> +setattr(func, "categories", cat)
> +except AttributeError:
> +raise Exception('Cannot assign categories to inline tests.')
> 
> return func
> 
> 
> 
> ___
> lldb-commits mailing list
> lldb-commits@lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

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


[Lldb-commits] [lldb] r326739 - [test] Skip pexpect-based lldb-mi tests on Darwin

2018-03-05 Thread Vedant Kumar via lldb-commits
Author: vedantk
Date: Mon Mar  5 12:16:52 2018
New Revision: 326739

URL: http://llvm.org/viewvc/llvm-project?rev=326739&view=rev
Log:
[test] Skip pexpect-based lldb-mi tests on Darwin

These tests fail with a relatively frequently on Darwin machines with
errors such as:

  File ".../lldb/third_party/Python/module/pexpect-2.4/pexpect.py", line 1444, 
in expect_loop
raise EOF(str(e) + '\n' + str(self))
EOF: End Of File (EOF) in read_nonblocking(). Empty string style platform.

The unpredictable failures make these tests noisy.

rdar://37046976

Modified:
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/TestMiExit.py
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/TestMiGdbSetShow.py
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/data/TestMiData.py

lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/signal/TestMiSignal.py

Modified: lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/TestMiExit.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/TestMiExit.py?rev=326739&r1=326738&r2=326739&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/TestMiExit.py 
(original)
+++ lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/TestMiExit.py Mon 
Mar  5 12:16:52 2018
@@ -17,6 +17,7 @@ class MiExitTestCase(lldbmi_testcase.MiT
 @expectedFailureAll(
 oslist=["windows"],
 bugnumber="llvm.org/pr22274: need a pexpect replacement for windows")
+@skipIfDarwin   # pexpect is known to be unreliable on Darwin
 @skipIfFreeBSD  # llvm.org/pr22411: Failure presumably due to known thread 
races
 @skipIfRemote   # We do not currently support remote debugging via the MI.
 def test_lldbmi_gdb_exit(self):
@@ -44,6 +45,7 @@ class MiExitTestCase(lldbmi_testcase.MiT
 @expectedFailureAll(
 oslist=["windows"],
 bugnumber="llvm.org/pr22274: need a pexpect replacement for windows")
+@skipIfDarwin   # pexpect is known to be unreliable on Darwin
 @skipIfFreeBSD  # llvm.org/pr22411: Failure presumably due to known thread 
races
 @skipIfRemote   # We do not currently support remote debugging via the MI.
 def test_lldbmi_quit(self):
@@ -70,6 +72,7 @@ class MiExitTestCase(lldbmi_testcase.MiT
 @expectedFailureAll(
 oslist=["windows"],
 bugnumber="llvm.org/pr22274: need a pexpect replacement for windows")
+@skipIfDarwin   # pexpect is known to be unreliable on Darwin
 @skipIfFreeBSD  # llvm.org/pr22411: Failure presumably due to known thread 
races
 @skipIfRemote   # We do not currently support remote debugging via the MI.
 def test_lldbmi_q(self):

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/TestMiGdbSetShow.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/TestMiGdbSetShow.py?rev=326739&r1=326738&r2=326739&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/TestMiGdbSetShow.py 
(original)
+++ lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/TestMiGdbSetShow.py 
Mon Mar  5 12:16:52 2018
@@ -19,6 +19,7 @@ class MiGdbSetShowTestCase(lldbmi_testca
 @expectedFailureAll(
 oslist=["windows"],
 bugnumber="llvm.org/pr22274: need a pexpect replacement for windows")
+@skipIfDarwin   # pexpect is known to be unreliable on Darwin
 @skipIfFreeBSD  # llvm.org/pr22411: Failure presumably due to known thread 
races
 @skipIfRemote   # We do not currently support remote debugging via the MI.
 def test_lldbmi_gdb_set_target_async_default(self):
@@ -41,6 +42,7 @@ class MiGdbSetShowTestCase(lldbmi_testca
 @expectedFailureAll(
 oslist=["windows"],
 bugnumber="llvm.org/pr22274: need a pexpect replacement for windows")
+@skipIfDarwin   # pexpect is known to be unreliable on Darwin
 @skipIfFreeBSD  # llvm.org/pr22411: Failure presumably due to known thread 
races
 @expectedFlakeyLinux("llvm.org/pr26028")  # Fails in ~1% of cases
 @skipIfRemote   # We do not currently support remote debugging via the MI.
@@ -74,6 +76,7 @@ class MiGdbSetShowTestCase(lldbmi_testca
 oslist=["windows"],
 bugnumber="llvm.org/pr22274: need a pexpect replacement for windows")
 @skipIfFreeBSD  # llvm.org/pr22411: Failure presumably due to known thread 
races
+@skipIfDarwin   # pexpect is known to be unreliable on Darwin
 @expectedFailureAll(
 oslist=["linux"],
 bugnumber="Failing in ~11/600 dosep runs (build 3120-3122)")
@@ -103,6 +106,7 @@ class MiGdbSetShowTestCase(lldbmi_testca
 @expectedFailureAll(
 oslist=["windows"],
 bugnumber="llvm.org/pr22274: need a pexpect replacement for windows")
+@skipIfDarwin   # pexpect is known to be unreliable on Darwin
 @skipIfFreeBSD  # llv

[Lldb-commits] [lldb] r327052 - [test] Skip a test when using an out-of-tree debugserver

2018-03-08 Thread Vedant Kumar via lldb-commits
Author: vedantk
Date: Thu Mar  8 11:46:39 2018
New Revision: 327052

URL: http://llvm.org/viewvc/llvm-project?rev=327052&view=rev
Log:
[test] Skip a test when using an out-of-tree debugserver

The test "test_fp_special_purpose_register_read" in TestRegisters.py
fails on Darwin machines configured to use an out-of-tree debugserver.

The error message is: 'register read ftag' returns expected result, got
'ftag = 0x80'. This indicates that the debugserver in use is too old.

This commit introduces a decorator which can be used to skip tests which
rely on having a just-built debugserver. This resolves the issue:

$ ./bin/llvm-dotest -p TestRegisters.py -v
  1 out of 617 test suites processed - TestRegisters.py
  Test Methods:  7
  Success:   6
  Skip:  1
...

Modified:
lldb/trunk/packages/Python/lldbsuite/test/decorators.py
lldb/trunk/packages/Python/lldbsuite/test/dotest.py
lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py

lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/register_command/TestRegisters.py
lldb/trunk/packages/Python/lldbsuite/test/lldbtest_config.py
lldb/trunk/test/CMakeLists.txt

Modified: lldb/trunk/packages/Python/lldbsuite/test/decorators.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/decorators.py?rev=327052&r1=327051&r2=327052&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/decorators.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/decorators.py Thu Mar  8 11:46:39 
2018
@@ -22,6 +22,7 @@ import use_lldb_suite
 import lldb
 from . import configuration
 from . import test_categories
+from . import lldbtest_config
 from lldbsuite.test_event.event_builder import EventBuilder
 from lldbsuite.support import funcutils
 from lldbsuite.test import lldbplatform
@@ -476,6 +477,11 @@ def expectedFlakeyAndroid(bugnumber=None
 archs),
 bugnumber)
 
+def skipIfOutOfTreeDebugserver(func):
+"""Decorate the item to skip tests if using an out-of-tree debugserver."""
+def is_out_of_tree_debugserver():
+return "out-of-tree debugserver" if 
lldbtest_config.out_of_tree_debugserver else None
+return skipTestIfFn(is_out_of_tree_debugserver)(func)
 
 def skipIfRemote(func):
 """Decorate the item to skip tests if testing remotely."""

Modified: lldb/trunk/packages/Python/lldbsuite/test/dotest.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/dotest.py?rev=327052&r1=327051&r2=327052&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/dotest.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/dotest.py Thu Mar  8 11:46:39 2018
@@ -307,6 +307,9 @@ def parseOptionsAndInitTestdirs():
 if args.log_success:
 lldbtest_config.log_success = args.log_success
 
+if args.out_of_tree_debugserver:
+lldbtest_config.out_of_tree_debugserver = args.out_of_tree_debugserver
+
 # Set SDKROOT if we are using an Apple SDK
 if platform_system == 'Darwin' and args.apple_sdk:
 os.environ['SDKROOT'] = seven.get_command_output(

Modified: lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py?rev=327052&r1=327051&r2=327052&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py Thu Mar  8 
11:46:39 2018
@@ -127,6 +127,11 @@ def create_parser():
 metavar='server-path',
 help='The path to the debug server executable to use')
 group.add_argument(
+'--out-of-tree-debugserver',
+dest='out_of_tree_debugserver',
+action='store_true',
+help='A flag to indicate an out-of-tree debug server is being used')
+group.add_argument(
 '-s',
 metavar='name',
 help='Specify the name of the dir created to store the session files 
of tests with errored or failed status. If not specified, the test driver uses 
the timestamp as the session dir name')

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/register_command/TestRegisters.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/register_command/TestRegisters.py?rev=327052&r1=327051&r2=327052&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/register_command/TestRegisters.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/register_command/TestRegisters.py
 Thu Mar  8 11:46:39 2018
@@ -69,6 +69,7 @@ class RegisterC

[Lldb-commits] [lldb] r327089 - [test] Skip a test which sporadically fails in its dsym variant

2018-03-08 Thread Vedant Kumar via lldb-commits
Author: vedantk
Date: Thu Mar  8 16:34:43 2018
New Revision: 327089

URL: http://llvm.org/viewvc/llvm-project?rev=327089&view=rev
Log:
[test] Skip a test which sporadically fails in its dsym variant

There is a mailing list discussion re: r325927 about why this test fails
in the dsym variant. I've marked it skipped for now, until the issue is
resolved.

Modified:

lldb/trunk/packages/Python/lldbsuite/test/lang/c/unicode/TestUnicodeSymbols.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/lang/c/unicode/TestUnicodeSymbols.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/c/unicode/TestUnicodeSymbols.py?rev=327089&r1=327088&r2=327089&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/lang/c/unicode/TestUnicodeSymbols.py 
(original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/lang/c/unicode/TestUnicodeSymbols.py 
Thu Mar  8 16:34:43 2018
@@ -2,12 +2,14 @@
 import lldb
 from lldbsuite.test.lldbtest import *
 import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test.decorators import *
 
 
 class TestUnicodeSymbols(TestBase):
 
 mydir = TestBase.compute_mydir(__file__)
 
+@skipIf(debug_info=["dsym"])
 def test_union_members(self):
 self.build()
 spec = lldb.SBModuleSpec()


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


Re: [Lldb-commits] [lldb] r325927 - Replace HashStringUsingDJB with llvm::djbHash

2018-03-08 Thread Vedant Kumar via lldb-commits
I've gone ahead and skipped this test for the dsym variant until this is 
resolved. r327089.

vedant

> On Mar 8, 2018, at 10:49 AM, Davide Italiano via lldb-commits 
>  wrote:
> 
> On Thu, Mar 8, 2018 at 10:46 AM, Jim Ingham  wrote:
>> 
>> 
>>> On Mar 8, 2018, at 2:49 AM, Pavel Labath  wrote:
>>> 
>>> 
>>> 
>>> 
>>> On Thu, 8 Mar 2018 at 02:46, Davide Italiano  wrote:
>>> On Wed, Mar 7, 2018 at 6:39 PM, Jim Ingham  wrote:
 The hashing algorithm gives different values - at least for foobár - 
 between the two implementations.  So if you build with an older clang, and 
 test with a new lldb, the type lookup fails.
 
>>> When I landed this patch, the two algorithms were identical, but this 
>>> wasn't always the case. The llvm's version of the algorithm used to be 
>>> nondeterministic (as in, it's result depended on the signedness of char on 
>>> your platform). This was recently fixed, and this patch was meant to make 
>>> sure they always stay in sync.
>>> 
>>> We considered a couple of options when we noticed this discrepancy, but 
>>> since this had never really worked (llvm and lldb had always disagreed on 
>>> the hash value of strings with high bit set) and nobody noticed, we decided 
>>> to just fix the llvm implementation. The other option was to create a 
>>> signedDJBHash function, and make lldb&llvm always use that for apple 
>>> accelerator tables. I guess it's still not too late to do that...
>> 
>> 
>> I have no idea how common the use of high bit characters in C identifiers 
>> is.  I can't remember ever seeing a usage in browsing through the Darwin 
>> sources.  We do have to support users who want to debug released products 
>> using older dSYM's, but if high bit identifiers are an uncommon practice, 
>> then just making sure lldb & clang & llvm-dsymutil stay in sync in the 
>> future is probably good enough.  IIRC the old dsymutil could run fixups on 
>> dsym's, and so if somebody ends up being really stuck because of this, we 
>> could teach llvm-dsymutil to regenerate the apple tables in the dSYM with 
>> the new hashes.  dsymutil doesn't use the apple tables from .o files, it 
>> rebuilds them, so doing this should be pretty straightforward.  The harder 
>> part is likely conveying to users when it is necessary to do so...
>> 
>>> 
>>> 
>>> This is not my case, I think? I'm building from the monorepo so clang
>>> and lldb are supposed to be in sync (in fact, the version of clang in
>>> my test is 7.0).
>>> 
>>> 
>>> My best (and only) guess would be that this is because of different 
>>> versions of dsymutil (we are using the system dsymutil to build the dsym 
>>> bundle), though I'm not sure then why the test doesn't fail for me as well, 
>>> as I have the stock dsymutil that ships which XCode, which presumably still 
>>> has the broken hash function.
>>> 
>>> Could you send me the main.o and a.out.dSYM files that are built by this 
>>> test (or at least the output of running llvm-dwarfdump -apple-types on 
>>> them), so I can compare them with mine? The interesting question is what 
>>> does "foobár" hash to (for me it's 0xba721fe1 in both files).
>>> 
>> 
>> IIRC Davide said only the dSYM variant of the test was failing for him.  If 
>> that's true then using the system dsymutil explains the difference.  But I 
>> don't know why the dSYM variant isn't failing for you.
>> 
>> Jim
>> 
> 
> Yes, that's the reason. The tests seem to pick the system `dsymutil`
> instead of the one that's built `in-tree`. I'll have a chat with Jonas
> about this.
> ___
> lldb-commits mailing list
> lldb-commits@lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

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


Re: [Lldb-commits] [lldb] r327318 - Improve prologue handling to support functions with multiple entry points.

2018-03-12 Thread Vedant Kumar via lldb-commits
Hi Jim,

I think this breaks the Xcode bot: 
http://green.lab.llvm.org/green/job/lldb-xcode/5430/ 
. The CMake build looks 
broken too. Mind taking a look or reverting?

CompileC 
build/lldb.build/Release/lldb-core.build/Objects-normal/x86_64/ArchitecturePPC64.o
 source/Plugins/Architecture/PPC64/ArchitecturePPC64.cpp normal x86_64 c++ 
com.apple.compilers.llvm.clang.1_0.compiler
cd /Users/buildslave/jenkins/workspace/lldb-xcode/lldb
export LANG=en_US.US-ASCII

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
 -x c++ -arch x86_64 -fmessage-length=0 -fdiagnostics-show-note-include-stack 
-fmacro-backtrace-limit=0 -std=c++11 -stdlib=libc++ -Wno-trigraphs 
-fpascal-strings -Os -fno-common -Wmissing-field-initializers 
-Wno-missing-prototypes -Wunreachable-code -Wnon-virtual-dtor 
-Woverloaded-virtual -Wno-exit-time-destructors -Wmissing-braces -Wparentheses 
-Wswitch -Wunused-function -Wunused-label -Wno-unused-parameter 
-Wunused-variable -Wunused-value -Wempty-body -Wuninitialized 
-Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion 
-Wconstant-conversion -Wint-conversion -Wbool-conversion -Wenum-conversion 
-Wno-shorten-64-to-32 -Wnewline-eof -Wno-c++11-extensions 
-D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -DLLDB_CONFIGURATION_RELEASE 
-DLLDB_VERSION_STRING=lldb-360.99.0 -isysroot 
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk
 -fasm-blocks -fstrict-aliasing -Wdeprecated-declarations -Winvalid-offsetof 
-mmacosx-version-min=10.12 -g -Wno-sign-conversion -Wno-infinite-recursion 
-Wno-move -iquote 
/Users/buildslave/jenkins/workspace/lldb-xcode/lldb/build/lldb.build/Release/lldb-core.build/liblldb-core-generated-files.hmap
 
-I/Users/buildslave/jenkins/workspace/lldb-xcode/lldb/build/lldb.build/Release/lldb-core.build/liblldb-core-own-target-headers.hmap
 
-I/Users/buildslave/jenkins/workspace/lldb-xcode/lldb/build/lldb.build/Release/lldb-core.build/liblldb-core-all-target-headers.hmap
 -iquote 
/Users/buildslave/jenkins/workspace/lldb-xcode/lldb/build/lldb.build/Release/lldb-core.build/liblldb-core-project-headers.hmap
 -iquote/Users/buildslave/jenkins/workspace/lldb-xcode/lldb/include 
-iquote/Users/buildslave/jenkins/workspace/lldb-xcode/lldb/source 
-iquote/Users/buildslave/jenkins/workspace/lldb-xcode/lldb/llvm/include 
-iquote/Users/buildslave/jenkins/workspace/lldb-xcode/lldb/llvm/tools/clang/include
 
-iquote/Users/buildslave/jenkins/workspace/lldb-xcode/lldb/llvm-build/Release+Asserts/x86_64/include
 
-iquote/Users/buildslave/jenkins/workspace/lldb-xcode/lldb/llvm-build/Release+Asserts/x86_64/tools/clang/include
 
-iquote/Users/buildslave/jenkins/workspace/lldb-xcode/lldb/llvm-build/Release+Asserts/x86_64/lib/Target/ARM
 -I/Users/buildslave/jenkins/workspace/lldb-xcode/lldb/build/Release/include 
-I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include/libxml2
 
-I/Users/buildslave/jenkins/workspace/lldb-xcode/lldb/build/lldb.build/Release/lldb-core.build/DerivedSources/x86_64
 
-I/Users/buildslave/jenkins/workspace/lldb-xcode/lldb/build/lldb.build/Release/lldb-core.build/DerivedSources
 -Wreorder -F/Users/buildslave/jenkins/workspace/lldb-xcode/lldb/build/Release 
-F/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/PrivateFrameworks
 -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 
-fno-rtti -Wglobal-constructors -Wparentheses -DHAVE_LIBZ=1 
-Wimplicit-fallthrough -DLLDB_USE_BUILTIN_DEMANGLER -DLIBXML2_DEFINED -MMD -MT 
dependencies -MF 
/Users/buildslave/jenkins/workspace/lldb-xcode/lldb/build/lldb.build/Release/lldb-core.build/Objects-normal/x86_64/ArchitecturePPC64.d
 --serialize-diagnostics 
/Users/buildslave/jenkins/workspace/lldb-xcode/lldb/build/lldb.build/Release/lldb-core.build/Objects-normal/x86_64/ArchitecturePPC64.dia
 -c 
/Users/buildslave/jenkins/workspace/lldb-xcode/lldb/source/Plugins/Architecture/PPC64/ArchitecturePPC64.cpp
 -o 
/Users/buildslave/jenkins/workspace/lldb-xcode/lldb/build/lldb.build/Release/lldb-core.build/Objects-normal/x86_64/ArchitecturePPC64.o
clang: error: no such file or directory: 
'/Users/buildslave/jenkins/workspace/lldb-xcode/lldb/source/Plugins/Architecture/PPC64/ArchitecturePPC64.cpp'
clang: error: no input files

thanks,
vedant

> On Mar 12, 2018, at 12:21 PM, Jim Ingham via lldb-commits 
>  wrote:
> 
> Author: jingham
> Date: Mon Mar 12 12:21:59 2018
> New Revision: 327318
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=327318&view=rev
> Log:
> Improve prologue handling to support functions with multiple entry points.
> 
> https://reviews.llvm.org/D42582
> 
> Patch from Leandro Lupori.
> 
> Modified:
>lldb/trunk/include/lldb/Core/Architecture.h
>lldb/trunk/lit/lit.cfg
>lldb/trunk/lldb.xcodeproj/project.pb

[Lldb-commits] [lldb] r327327 - Revert "Improve prologue handling to support functions with multiple entry points."

2018-03-12 Thread Vedant Kumar via lldb-commits
Author: vedantk
Date: Mon Mar 12 13:35:33 2018
New Revision: 327327

URL: http://llvm.org/viewvc/llvm-project?rev=327327&view=rev
Log:
Revert "Improve prologue handling to support functions with multiple entry 
points."

This reverts commit r327318. It breaks the Xcode and CMake Darwin
builders:

clang: error: no such file or directory:
'.../source/Plugins/Architecture/PPC64/ArchitecturePPC64.cpp'
clang: error: no input files

More details are in https://reviews.llvm.org/D42582.

Modified:
lldb/trunk/include/lldb/Core/Architecture.h
lldb/trunk/lit/lit.cfg
lldb/trunk/lldb.xcodeproj/project.pbxproj
lldb/trunk/source/API/SystemInitializerFull.cpp
lldb/trunk/source/Breakpoint/BreakpointResolverName.cpp
lldb/trunk/source/Plugins/Architecture/CMakeLists.txt
lldb/trunk/source/Target/ThreadPlanStepInRange.cpp
lldb/trunk/tools/lldb-test/SystemInitializerTest.cpp
lldb/trunk/tools/lldb-test/lldb-test.cpp

Modified: lldb/trunk/include/lldb/Core/Architecture.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/Architecture.h?rev=327327&r1=327326&r2=327327&view=diff
==
--- lldb/trunk/include/lldb/Core/Architecture.h (original)
+++ lldb/trunk/include/lldb/Core/Architecture.h Mon Mar 12 13:35:33 2018
@@ -33,40 +33,6 @@ public:
   //--
   virtual void OverrideStopInfo(Thread &thread) = 0;
 
-  //--
-  /// This method is used to get the number of bytes that should be
-  /// skipped, from function start address, to reach the first
-  /// instruction after the prologue. If overrode, it must return
-  /// non-zero only if the current address matches one of the known
-  /// function entry points.
-  ///
-  /// This method is called only if the standard platform-independent
-  /// code fails to get the number of bytes to skip, giving the plugin
-  /// a chance to try to find the missing info.
-  ///
-  /// This is specifically used for PPC64, where functions may have
-  /// more than one entry point, global and local, so both should
-  /// be compared with current address, in order to find out the
-  /// number of bytes that should be skipped, in case we are stopped
-  /// at either function entry point.
-  //--
-  virtual size_t GetBytesToSkip(Symbol &func, const Address &curr_addr) const {
-return 0;
-  }
-
-  //--
-  /// Adjust function breakpoint address, if needed. In some cases,
-  /// the function start address is not the right place to set the
-  /// breakpoint, specially in functions with multiple entry points.
-  ///
-  /// This is specifically used for PPC64, for functions that have
-  /// both a global and a local entry point. In this case, the
-  /// breakpoint is adjusted to the first function address reached
-  /// by both entry points.
-  //--
-  virtual void AdjustBreakpointAddress(const Symbol &func,
-   Address &addr) const {}
-
 private:
   Architecture(const Architecture &) = delete;
   void operator=(const Architecture &) = delete;

Modified: lldb/trunk/lit/lit.cfg
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/lit.cfg?rev=327327&r1=327326&r2=327327&view=diff
==
--- lldb/trunk/lit/lit.cfg (original)
+++ lldb/trunk/lit/lit.cfg Mon Mar 12 13:35:33 2018
@@ -155,8 +155,6 @@ if re.search(r'ARM', llvm_config_output_
 config.available_features.add('arm')
 if re.search(r'Mips', llvm_config_output_list[2]):
 config.available_features.add('mips')
-if re.search(r'PowerPC', llvm_config_output_list[2]):
-config.available_features.add('powerpc')
 if re.search(r'X86', llvm_config_output_list[2]):
 config.available_features.add('x86')
 llvm_config_cmd.wait()

Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=327327&r1=327326&r2=327327&view=diff
==
--- lldb/trunk/lldb.xcodeproj/project.pbxproj (original)
+++ lldb/trunk/lldb.xcodeproj/project.pbxproj Mon Mar 12 13:35:33 2018
@@ -712,7 +712,6 @@
49F811F31E931B2100F4E163 /* CPlusPlusNameParser.cpp in Sources 
*/ = {isa = PBXBuildFile; fileRef = 49F811EF1E931B1500F4E163 /* 
CPlusPlusNameParser.cpp */; };
4C0083401B9F9BA900D5CF24 /* UtilityFunction.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = 4C00833F1B9F9BA900D5CF24 /* UtilityFunction.cpp 
*/; };
4C05332B1F62121E00DED368 /* SBBreakpointOptionCommon.cpp in 
Sources */ = {isa = PBXBuildFile; fileRef = 4C0533291F6211FB00DED368 /* 

Re: [Lldb-commits] [lldb] r327318 - Improve prologue handling to support functions with multiple entry points.

2018-03-12 Thread Vedant Kumar via lldb-commits
I needed to revert this in r327327 to get the bots going again.

vedant

> On Mar 12, 2018, at 1:26 PM, Vedant Kumar via lldb-commits 
>  wrote:
> 
> Hi Jim,
> 
> I think this breaks the Xcode bot: 
> http://green.lab.llvm.org/green/job/lldb-xcode/5430/ 
> <http://green.lab.llvm.org/green/job/lldb-xcode/5430/>. The CMake build looks 
> broken too. Mind taking a look or reverting?
> 
> CompileC 
> build/lldb.build/Release/lldb-core.build/Objects-normal/x86_64/ArchitecturePPC64.o
>  source/Plugins/Architecture/PPC64/ArchitecturePPC64.cpp normal x86_64 c++ 
> com.apple.compilers.llvm.clang.1_0.compiler
> cd /Users/buildslave/jenkins/workspace/lldb-xcode/lldb
> export LANG=en_US.US-ASCII
> 
> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
>  -x c++ -arch x86_64 -fmessage-length=0 -fdiagnostics-show-note-include-stack 
> -fmacro-backtrace-limit=0 -std=c++11 -stdlib=libc++ -Wno-trigraphs 
> -fpascal-strings -Os -fno-common -Wmissing-field-initializers 
> -Wno-missing-prototypes -Wunreachable-code -Wnon-virtual-dtor 
> -Woverloaded-virtual -Wno-exit-time-destructors -Wmissing-braces 
> -Wparentheses -Wswitch -Wunused-function -Wunused-label -Wno-unused-parameter 
> -Wunused-variable -Wunused-value -Wempty-body -Wuninitialized 
> -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion 
> -Wconstant-conversion -Wint-conversion -Wbool-conversion -Wenum-conversion 
> -Wno-shorten-64-to-32 -Wnewline-eof -Wno-c++11-extensions 
> -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -DLLDB_CONFIGURATION_RELEASE 
> -DLLDB_VERSION_STRING=lldb-360.99.0 -isysroot 
> /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk
>  -fasm-blocks -fstrict-aliasing -Wdeprecated-declarations -Winvalid-offsetof 
> -mmacosx-version-min=10.12 -g -Wno-sign-conversion -Wno-infinite-recursion 
> -Wno-move -iquote 
> /Users/buildslave/jenkins/workspace/lldb-xcode/lldb/build/lldb.build/Release/lldb-core.build/liblldb-core-generated-files.hmap
>  
> -I/Users/buildslave/jenkins/workspace/lldb-xcode/lldb/build/lldb.build/Release/lldb-core.build/liblldb-core-own-target-headers.hmap
>  
> -I/Users/buildslave/jenkins/workspace/lldb-xcode/lldb/build/lldb.build/Release/lldb-core.build/liblldb-core-all-target-headers.hmap
>  -iquote 
> /Users/buildslave/jenkins/workspace/lldb-xcode/lldb/build/lldb.build/Release/lldb-core.build/liblldb-core-project-headers.hmap
>  -iquote/Users/buildslave/jenkins/workspace/lldb-xcode/lldb/include 
> -iquote/Users/buildslave/jenkins/workspace/lldb-xcode/lldb/source 
> -iquote/Users/buildslave/jenkins/workspace/lldb-xcode/lldb/llvm/include 
> -iquote/Users/buildslave/jenkins/workspace/lldb-xcode/lldb/llvm/tools/clang/include
>  
> -iquote/Users/buildslave/jenkins/workspace/lldb-xcode/lldb/llvm-build/Release+Asserts/x86_64/include
>  
> -iquote/Users/buildslave/jenkins/workspace/lldb-xcode/lldb/llvm-build/Release+Asserts/x86_64/tools/clang/include
>  
> -iquote/Users/buildslave/jenkins/workspace/lldb-xcode/lldb/llvm-build/Release+Asserts/x86_64/lib/Target/ARM
>  -I/Users/buildslave/jenkins/workspace/lldb-xcode/lldb/build/Release/include 
> -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include/libxml2
>  
> -I/Users/buildslave/jenkins/workspace/lldb-xcode/lldb/build/lldb.build/Release/lldb-core.build/DerivedSources/x86_64
>  
> -I/Users/buildslave/jenkins/workspace/lldb-xcode/lldb/build/lldb.build/Release/lldb-core.build/DerivedSources
>  -Wreorder 
> -F/Users/buildslave/jenkins/workspace/lldb-xcode/lldb/build/Release 
> -F/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/PrivateFrameworks
>  -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 
> -fno-rtti -Wglobal-constructors -Wparentheses -DHAVE_LIBZ=1 
> -Wimplicit-fallthrough -DLLDB_USE_BUILTIN_DEMANGLER -DLIBXML2_DEFINED -MMD 
> -MT dependencies -MF 
> /Users/buildslave/jenkins/workspace/lldb-xcode/lldb/build/lldb.build/Release/lldb-core.build/Objects-normal/x86_64/ArchitecturePPC64.d
>  --serialize-diagnostics 
> /Users/buildslave/jenkins/workspace/lldb-xcode/lldb/build/lldb.build/Release/lldb-core.build/Objects-normal/x86_64/ArchitecturePPC64.dia
>  -c 
> /Users/buildslave/jenkins/workspace/lldb-xcode/lldb/source/Plugins/Architecture/PPC64/ArchitecturePPC64.cpp
>  -o 
> /Users/buildslave/jenkins/workspace/lldb-xcode/lldb/build/lldb.build/Release/lldb-core.build/Objects-normal/x86_64/ArchitecturePPC64.o
> clang: error: no such file or directory: 
> '/Users/buildslave/jenkins/workspace/lldb-xcode/lldb/source/Plugins/Architecture/PPC64/ArchitecturePPC64.cpp'
> clang: error: no

  1   2   3   >