Re: [Lldb-commits] [PATCH] D12079: [MIPS] microMIPS breakpoints, disassembly and compressed addresses

2015-09-08 Thread Jaydeep Patil via lldb-commits
jaydeep updated this revision to Diff 34199.
jaydeep added a comment.

In this patch:

The bit #0 has been cleared from addresses in the line tables. However we are 
relying upon ArchSpec instead of Target while clearing this bit in 
ParseDWARFLineTableCallback because SymbolContext may not have a valid target 
to call Address::GetOpcodeLoadAddress().

Bare-iron targets (like YAMON, IASim, Qemu) return compressed address (bit #0 
set) when process is stopped in microMIPS address space. For example: bit #0 of 
PC is set when a breakpoint is hit. This bit has been cleared while reading the 
PC in RegisterContext::GetPC(). This would help us find breakpoints set using 
GetOpcodeLoadAddress (bit #0 clear),

DisassemblerLLVMC::DisassemblerLLVMC has been modified to create 
m_alternate_disasm_ap for microMIPS. This would display disassembly in either 
compressed (bit #0 set) or uncompressed (bit #0 clear) address space based on 
ISA mode.


Repository:
  rL LLVM

http://reviews.llvm.org/D12079

Files:
  source/Core/FormatEntity.cpp
  source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp
  source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
  source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
  source/Target/RegisterContext.cpp
  source/Target/Target.cpp

Index: source/Target/Target.cpp
===
--- source/Target/Target.cpp
+++ source/Target/Target.cpp
@@ -2065,6 +2065,27 @@
 addr_t code_addr = load_addr;
 switch (m_arch.GetMachine())
 {
+case llvm::Triple::mips:
+case llvm::Triple::mipsel:
+case llvm::Triple::mips64:
+case llvm::Triple::mips64el:
+switch (addr_class)
+{
+case eAddressClassData:
+case eAddressClassDebug:
+return LLDB_INVALID_ADDRESS;
+
+case eAddressClassUnknown:
+case eAddressClassInvalid:
+case eAddressClassCode:
+case eAddressClassCodeAlternateISA:
+case eAddressClassRuntime:
+if ((code_addr & 2ull) || (addr_class == eAddressClassCodeAlternateISA))
+code_addr |= 1ull;
+break;
+}
+break;
+
 case llvm::Triple::arm:
 case llvm::Triple::thumb:
 switch (addr_class)
@@ -2110,6 +2131,10 @@
 addr_t opcode_addr = load_addr;
 switch (m_arch.GetMachine())
 {
+case llvm::Triple::mips:
+case llvm::Triple::mipsel:
+case llvm::Triple::mips64:
+case llvm::Triple::mips64el:
 case llvm::Triple::arm:
 case llvm::Triple::thumb:
 switch (addr_class)
Index: source/Target/RegisterContext.cpp
===
--- source/Target/RegisterContext.cpp
+++ source/Target/RegisterContext.cpp
@@ -103,7 +103,24 @@
 RegisterContext::GetPC(uint64_t fail_value)
 {
 uint32_t reg = ConvertRegisterKindToRegisterNumber (eRegisterKindGeneric, LLDB_REGNUM_GENERIC_PC);
-return ReadRegisterAsUnsigned (reg, fail_value);
+uint64_t pc = ReadRegisterAsUnsigned (reg, fail_value);
+
+if (pc != fail_value)
+{
+/*
+ * MIPS:
+ * When a breakpoint is hit in microMIPS address space, bit #0 of the PC
+ * is set by the target (CallableLoadAddress). However there is no trace
+ * of bit #0 elsewhere in the debugger. Clear bit #0 so that we can find
+ * breakpoints etc. set using OpcodeLoadAddress.
+*/
+TargetSP target_sp = m_thread.CalculateTarget();
+Target *target = target_sp.get();
+Address addr (pc);
+pc = addr.GetOpcodeLoadAddress (target);
+}
+
+return pc;
 }
 
 bool
Index: source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
===
--- source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
+++ source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
@@ -1394,6 +1394,7 @@
 {
 LineTable* line_table;
 std::unique_ptr sequence_ap;
+ArchSpec arch;
 };
 
 //--
@@ -1422,8 +1423,20 @@
 info->sequence_ap.reset(line_table->CreateLineSequenceContainer());
 assert(info->sequence_ap.get());
 }
+
+/*
+ * MIPS:
+ * The SymbolContext may not have a valid target, thus we may not be able
+ * to call Address::GetOpcodeLoadAddress() which would clear the bit #0
+ * for MIPS. Use ArchSpec to clear the bit #0.
+*/
+lldb::addr_t file_addr = state.address;
+if (info->arch.GetMachine() == llvm::Triple::mips || info->arch.GetMachine() == llvm::Triple::mipsel
+   || info->arch.GetMachine() == llvm::Triple::mips64 || info->arch.GetMachine() == llvm::Triple::mips64el)
+file_addr = state.address & (~1ull);
+
 line_table->AppendLineEntryToSequence (info->sequence_ap.get(),
-   state.address,
+  

[Lldb-commits] [lldb] r247000 - Bug 24733: TestRegisters.py for Clang inferiors

2015-09-08 Thread Abhishek Aggarwal via lldb-commits
Author: abhishek
Date: Tue Sep  8 05:19:37 2015
New Revision: 247000

URL: http://llvm.org/viewvc/llvm-project?rev=247000&view=rev
Log:
Bug 24733: TestRegisters.py for Clang inferiors

Summary:
  - Bug 24457 can now be tested for inferiors compiled
by clang compiler also.

  - A generic test case for GCC and Clang inferiors:
-- Works even when Clang and GCC produce different
   assembly for the same inferior.
  
  - Refer Differential Revision: http://reviews.llvm.org/D12677

Signed-off-by: Abhishek Aggarwal 

Modified:
lldb/trunk/test/functionalities/register/TestRegisters.py
lldb/trunk/test/functionalities/register/a.cpp

Modified: lldb/trunk/test/functionalities/register/TestRegisters.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/register/TestRegisters.py?rev=247000&r1=246999&r2=247000&view=diff
==
--- lldb/trunk/test/functionalities/register/TestRegisters.py (original)
+++ lldb/trunk/test/functionalities/register/TestRegisters.py Tue Sep  8 
05:19:37 2015
@@ -37,7 +37,6 @@ class RegisterCommandsTestCase(TestBase)
 self.fp_register_write()
 
 @expectedFailureAndroid(archs=["i386"]) # "register read fstat" always 
return 0x
-@expectedFailureClang("llvm.org/pr24733")
 def test_fp_special_purpose_register_read(self):
 """Test commands that read fpu special purpose registers."""
 if not self.getArchitecture() in ['amd64', 'i386', 'x86_64']:
@@ -169,15 +168,14 @@ class RegisterCommandsTestCase(TestBase)
 target = self.dbg.CreateTarget(exe)
 self.assertTrue(target, VALID_TARGET)
 
-# Find the line number to break inside a.cpp.
-self.line = line_number('a.cpp', '// Set break point at this line.')
-
-# Set breakpoint
-lldbutil.run_break_set_by_file_and_line (self, "a.cpp", self.line, 
num_expected_locations=1, loc_exact=True)
-
 # Launch the process, and do not stop at the entry point.
 self.runCmd ("run", RUN_SUCCEEDED)
 
+# Check stop reason; Should be SIGTRAP
+stop_reason = 'stop reason = signal SIGTRAP'
+self.expect("thread list", STOPPED_DUE_TO_SIGNAL,
+  substrs = ['stopped', stop_reason])
+
 process = target.GetProcess()
 self.assertTrue(process.GetState() == lldb.eStateStopped,
 PROCESS_STOPPED)

Modified: lldb/trunk/test/functionalities/register/a.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/register/a.cpp?rev=247000&r1=246999&r2=247000&view=diff
==
--- lldb/trunk/test/functionalities/register/a.cpp (original)
+++ lldb/trunk/test/functionalities/register/a.cpp Tue Sep  8 05:19:37 2015
@@ -13,6 +13,7 @@ return_long_double (long double value)
 {
 float a=2, b=4,c=8, d=16, e=32, f=64, k=128, l=256, add=0;
 __asm__ (
+"int3 ;"
 "flds %1 ;"
 "flds %2 ;"
 "flds %3 ;"


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


Re: [Lldb-commits] [PATCH] D12677: Bug 24733: TestRegisters.py for Clang inferiors

2015-09-08 Thread Abhishek via lldb-commits
abhishek.aggarwal closed this revision.
abhishek.aggarwal added a comment.

Couldn't land this patch by arc due to merge conflicts. Hence merging it 
manually and closing this revision.


http://reviews.llvm.org/D12677



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


Re: [Lldb-commits] [PATCH] D12672: add a dependency on terminfo library if llvm uses it

2015-09-08 Thread Jeremi Piotrowski via lldb-commits
jeremi.piotrowski added a comment.

I do not have commit access, so if you could do it for me that would be great.


http://reviews.llvm.org/D12672



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


[Lldb-commits] [lldb] r247009 - Exception registers aren't supported outside of Darwin

2015-09-08 Thread Ed Maste via lldb-commits
Author: emaste
Date: Tue Sep  8 08:05:15 2015
New Revision: 247009

URL: http://llvm.org/viewvc/llvm-project?rev=247009&view=rev
Log:
Exception registers aren't supported outside of Darwin

Apply test update from r234992 to FreeBSD

Modified:
lldb/trunk/test/python_api/lldbutil/iter/TestRegistersIterator.py

Modified: lldb/trunk/test/python_api/lldbutil/iter/TestRegistersIterator.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/python_api/lldbutil/iter/TestRegistersIterator.py?rev=247009&r1=247008&r2=247009&view=diff
==
--- lldb/trunk/test/python_api/lldbutil/iter/TestRegistersIterator.py (original)
+++ lldb/trunk/test/python_api/lldbutil/iter/TestRegistersIterator.py Tue Sep  
8 08:05:15 2015
@@ -18,7 +18,6 @@ class RegistersIteratorTestCase(TestBase
 # Find the line number to break inside main().
 self.line1 = line_number('main.cpp', '// Set break point at this 
line.')
 
-@expectedFailureFreeBSD # llvm.org/pr14600 - Exception state registers not 
supported on FreeBSD
 @python_api_test
 def test_iter_registers(self):
 """Test iterator works correctly for lldbutil.iter_registers()."""


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


[Lldb-commits] [lldb] r247012 - Remove expectedFailureFreeBSD from passing PluginCommandTestCase::test_load_plugin

2015-09-08 Thread Ed Maste via lldb-commits
Author: emaste
Date: Tue Sep  8 08:27:27 2015
New Revision: 247012

URL: http://llvm.org/viewvc/llvm-project?rev=247012&view=rev
Log:
Remove expectedFailureFreeBSD from passing 
PluginCommandTestCase::test_load_plugin

This test was failing due to a libc++ vs libsdc++ conflict which should
be fixed by r200646.

llvm.org/pr17430

Modified:
lldb/trunk/test/functionalities/plugins/commands/TestPluginCommands.py

Modified: lldb/trunk/test/functionalities/plugins/commands/TestPluginCommands.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/plugins/commands/TestPluginCommands.py?rev=247012&r1=247011&r2=247012&view=diff
==
--- lldb/trunk/test/functionalities/plugins/commands/TestPluginCommands.py 
(original)
+++ lldb/trunk/test/functionalities/plugins/commands/TestPluginCommands.py Tue 
Sep  8 08:27:27 2015
@@ -19,7 +19,6 @@ class PluginCommandTestCase(TestBase):
 self.lib_dir = os.environ["LLDB_LIB_DIR"]
 self.implib_dir = os.environ["LLDB_IMPLIB_DIR"]
 
-@expectedFailureFreeBSD('llvm.org/pr17430')
 @skipIfNoSBHeaders
 @skipIfHostIncompatibleWithRemote # Requires a compatible arch and 
platform to link against the host's built lldb lib.
 def test_load_plugin(self):


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


[Lldb-commits] [lldb] r247013 - Enable StopHookForMultipleThreadsTestCase::test_stop_hook_multiple_threads_with_dwarf on FreeBSD

2015-09-08 Thread Ed Maste via lldb-commits
Author: emaste
Date: Tue Sep  8 08:33:21 2015
New Revision: 247013

URL: http://llvm.org/viewvc/llvm-project?rev=247013&view=rev
Log:
Enable 
StopHookForMultipleThreadsTestCase::test_stop_hook_multiple_threads_with_dwarf 
on FreeBSD

This test passes locally but was disabled due to pexpect issues on the
FreeBSD buildbot. That buildbot has been retired as it was overloaded,
and we will investigate again if this fails once a new buildbot is in
place. Noted by John Wolfe.

llvm.org/pr22784

Modified:

lldb/trunk/test/functionalities/stop-hook/multiple_threads/TestStopHookMultipleThreads.py

Modified: 
lldb/trunk/test/functionalities/stop-hook/multiple_threads/TestStopHookMultipleThreads.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/stop-hook/multiple_threads/TestStopHookMultipleThreads.py?rev=247013&r1=247012&r2=247013&view=diff
==
--- 
lldb/trunk/test/functionalities/stop-hook/multiple_threads/TestStopHookMultipleThreads.py
 (original)
+++ 
lldb/trunk/test/functionalities/stop-hook/multiple_threads/TestStopHookMultipleThreads.py
 Tue Sep  8 08:33:21 2015
@@ -23,7 +23,6 @@ class StopHookForMultipleThreadsTestCase
 @expectedFailureFreeBSD("llvm.org/pr15037")
 @expectedFlakeyLinux("llvm.org/pr15037") # stop hooks sometimes fail to 
fire on Linux
 @expectedFailureHostWindows("llvm.org/pr22274: need a pexpect replacement 
for windows")
-@skipIfFreeBSD # llvm.org/pr22784
 def test_stop_hook_multiple_threads_with_dwarf(self):
 """Test that lldb stop-hook works for multiple threads."""
 self.buildDwarf(dictionary=self.d)


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


Re: [Lldb-commits] [PATCH] D12674: Remove an invalid check in DW_OP_piece processing.

2015-09-08 Thread Adrian Prantl via lldb-commits
aprantl accepted this revision.
aprantl added a comment.

Thanks, yes, this check looks like it serves no purpose.


http://reviews.llvm.org/D12674



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


Re: [Lldb-commits] [PATCH] D12291: Add split dwarf support to SymbolFileDWARF

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

One minor IsValid() fix in DWARFDIE to avoid crashes and this is good to go.



Comment at: source/Plugins/SymbolFile/DWARF/DWARFDIE.cpp:28-35
@@ -27,1 +27,10 @@
 
+DIERef
+DWARFDIE::GetDIERef() const
+{
+dw_offset_t cu_offset = m_cu->GetOffset();
+if (m_cu->GetBaseObjOffset() != DW_INVALID_OFFSET)
+cu_offset = m_cu->GetBaseObjOffset();
+return DIERef(cu_offset, m_die->GetOffset());
+}
+

Need to check IsValid() first and place all above code inside the if and have 
the else return a DIERef().


http://reviews.llvm.org/D12291



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


Re: [Lldb-commits] [PATCH] D12667: [cmake] Remove LLDB_ENABLE_PYTHON_SCRIPTS_SWIG_API_GENERATION.

2015-09-08 Thread Greg Clayton via lldb-commits
clayborg added a comment.

Looks good.


Repository:
  rL LLVM

http://reviews.llvm.org/D12667



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


Re: [Lldb-commits] [PATCH] D12683: Fix debugger shutdown when Python interpreter is loaded

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

Looks good.


http://reviews.llvm.org/D12683



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


[Lldb-commits] [lldb] r247022 - Fix assertion failure caused by a bug in 128bit register handling in RegisterValue

2015-09-08 Thread Tamas Berghammer via lldb-commits
Author: tberghammer
Date: Tue Sep  8 11:22:23 2015
New Revision: 247022

URL: http://llvm.org/viewvc/llvm-project?rev=247022&view=rev
Log:
Fix assertion failure caused by a bug in 128bit register handling in 
RegisterValue

Modified:
lldb/trunk/include/lldb/Core/RegisterValue.h
lldb/trunk/source/Core/RegisterValue.cpp

Modified: lldb/trunk/include/lldb/Core/RegisterValue.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/RegisterValue.h?rev=247022&r1=247021&r2=247022&view=diff
==
--- lldb/trunk/include/lldb/Core/RegisterValue.h (original)
+++ lldb/trunk/include/lldb/Core/RegisterValue.h Tue Sep  8 11:22:23 2015
@@ -299,7 +299,7 @@ namespace lldb_private {
 SetUInt128 (llvm::APInt uint)
 {
 m_type = eTypeUInt128;
-m_scalar = llvm::APInt(uint);
+m_scalar = uint;
 }
 bool
 SetUInt (uint64_t uint, uint32_t byte_size);

Modified: lldb/trunk/source/Core/RegisterValue.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/RegisterValue.cpp?rev=247022&r1=247021&r2=247022&view=diff
==
--- lldb/trunk/source/Core/RegisterValue.cpp (original)
+++ lldb/trunk/source/Core/RegisterValue.cpp Tue Sep  8 11:22:23 2015
@@ -892,7 +892,7 @@ RegisterValue::SetUInt (uint64_t uint, u
 }
 else if (byte_size <= 16)
 {
-SetUInt128 (llvm::APInt(64, uint));
+SetUInt128 (llvm::APInt(128, uint));
 }
 else
 return false;


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


Re: [Lldb-commits] [PATCH] D12079: [MIPS] microMIPS breakpoints, disassembly and compressed addresses

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

Open issues:

- In FormatEntity.cpp we probably don't need any changes to DumpAddress()
- Remove MIPS comment from generic code and let the 
"Target::GetOpcodeLoadAddress (...) const" document what is happening.
- Call Target::GetOpcodeLoadAddress (lldb::addr_t load_addr, AddressClass 
addr_class) const to fixup the PC.



Comment at: source/Core/FormatEntity.cpp:421-429
@@ -420,6 +420,11 @@
 addr_t vaddr = LLDB_INVALID_ADDRESS;
+
+// If the address belongs to eAddressClassCodeAlternateISA then
+// dump its callable form.
+Address callable_addr (addr.GetCallableLoadAddress(target));
+
 if (exe_ctx && !target->GetSectionLoadList().IsEmpty())
-vaddr = addr.GetLoadAddress (target);
+vaddr = callable_addr.GetLoadAddress (target);
 if (vaddr == LLDB_INVALID_ADDRESS)
-vaddr = addr.GetFileAddress ();
+vaddr = callable_addr.GetFileAddress ();
 

I repeat this concern: do we still need to do this? There should be no changes 
needed for this function if the bit #0 has been stripped. 


Comment at: source/Target/RegisterContext.cpp:110-116
@@ +109,9 @@
+{
+/*
+ * MIPS:
+ * When a breakpoint is hit in microMIPS address space, bit #0 of the 
PC
+ * is set by the target (CallableLoadAddress). However there is no 
trace
+ * of bit #0 elsewhere in the debugger. Clear bit #0 so that we can 
find
+ * breakpoints etc. set using OpcodeLoadAddress.
+*/
+TargetSP target_sp = m_thread.CalculateTarget();

Probably no need for this MIPS specific comment in here, it should be 
documented once in the Target functions that strip the bit zero.


Comment at: source/Target/RegisterContext.cpp:117-120
@@ +116,6 @@
+*/
+TargetSP target_sp = m_thread.CalculateTarget();
+Target *target = target_sp.get();
+Address addr (pc);
+pc = addr.GetOpcodeLoadAddress (target);
+}

We don't need to make a section + offset address here, we can just use:
```
lldb::addr_t
Target::GetOpcodeLoadAddress (lldb::addr_t load_addr, AddressClass addr_class) 
const;
```

So this code should be:

```
TargetSP target_sp = m_thread.CalculateTarget();
if (target_sp)
pc = target->GetOpcodeLoadAddress (pc, eAddressClassCode);
```



Repository:
  rL LLVM

http://reviews.llvm.org/D12079



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


[Lldb-commits] [lldb] r247023 - Fix debugger shutdown when Python interpreter is loaded.

2015-09-08 Thread Oleksiy Vyalov via lldb-commits
Author: ovyalov
Date: Tue Sep  8 11:26:32 2015
New Revision: 247023

URL: http://llvm.org/viewvc/llvm-project?rev=247023&view=rev
Log:
Fix debugger shutdown when Python interpreter is loaded.

http://reviews.llvm.org/D12683


Modified:
lldb/trunk/source/Core/Debugger.cpp

Modified: lldb/trunk/source/Core/Debugger.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Debugger.cpp?rev=247023&r1=247022&r2=247023&view=diff
==
--- lldb/trunk/source/Core/Debugger.cpp (original)
+++ lldb/trunk/source/Core/Debugger.cpp Tue Sep  8 11:26:32 2015
@@ -421,7 +421,11 @@ Debugger::Terminate ()
 
 // Clear our master list of debugger objects
 Mutex::Locker locker (GetDebuggerListMutex ());
-GetDebuggerList().clear();
+auto& debuggers = GetDebuggerList();
+for (const auto& debugger: debuggers)
+debugger->Clear();
+
+debuggers.clear();
 }
 
 void


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


Re: [Lldb-commits] [PATCH] D12683: Fix debugger shutdown when Python interpreter is loaded

2015-09-08 Thread Oleksiy Vyalov via lldb-commits
ovyalov closed this revision.
ovyalov added a comment.

Files:

  /lldb/trunk/source/Core/Debugger.cpp

Users:

  ovyalov (Author)

http://reviews.llvm.org/rL247023


http://reviews.llvm.org/D12683



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


[Lldb-commits] [lldb] r247024 - Revert "Enable StopHookForMultipleThreadsTestCase::test_stop_hook_multiple_threads_with_dwarf on FreeBSD"

2015-09-08 Thread Ed Maste via lldb-commits
Author: emaste
Date: Tue Sep  8 11:35:28 2015
New Revision: 247024

URL: http://llvm.org/viewvc/llvm-project?rev=247024&view=rev
Log:
Revert "Enable 
StopHookForMultipleThreadsTestCase::test_stop_hook_multiple_threads_with_dwarf 
on FreeBSD"

And update the comment describing the reason this test is skipped.
Unlike the issue described llvm.org/pr22784 this test sometimes causes
a hang on my local machine and is not just a problem on the retired
buildbot.

This reverts commit r247013.

Modified:

lldb/trunk/test/functionalities/stop-hook/multiple_threads/TestStopHookMultipleThreads.py

Modified: 
lldb/trunk/test/functionalities/stop-hook/multiple_threads/TestStopHookMultipleThreads.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/stop-hook/multiple_threads/TestStopHookMultipleThreads.py?rev=247024&r1=247023&r2=247024&view=diff
==
--- 
lldb/trunk/test/functionalities/stop-hook/multiple_threads/TestStopHookMultipleThreads.py
 (original)
+++ 
lldb/trunk/test/functionalities/stop-hook/multiple_threads/TestStopHookMultipleThreads.py
 Tue Sep  8 11:35:28 2015
@@ -23,6 +23,7 @@ class StopHookForMultipleThreadsTestCase
 @expectedFailureFreeBSD("llvm.org/pr15037")
 @expectedFlakeyLinux("llvm.org/pr15037") # stop hooks sometimes fail to 
fire on Linux
 @expectedFailureHostWindows("llvm.org/pr22274: need a pexpect replacement 
for windows")
+@skipIfFreeBSD # Can cause an indefinite hang in dotest.py on FreeBSD
 def test_stop_hook_multiple_threads_with_dwarf(self):
 """Test that lldb stop-hook works for multiple threads."""
 self.buildDwarf(dictionary=self.d)


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


[Lldb-commits] [PATCH] D12699: Change the looping stack detection code

2015-09-08 Thread Tamas Berghammer via lldb-commits
tberghammer created this revision.
tberghammer added a reviewer: jasonmolenda.
tberghammer added a subscriber: lldb-commits.

Change the looping stack detection code

In some special case (e.g. signal handlers, hand written assembly) it is
valid to have 2 stack frame with the same CFA value. This CL change the
looping stack detection code to report a loop only if at least 3
consecutive frames have the same CFA.

Note: I would prefer to get rid of this looping stack detection because the 
implementation is still a bit flaky and rely on the logic in 
UnwindLLDB::GetOneMoreFrame to stop the infinite loop in case of a looping 
stack, but I don't know how big the user impact will be in the cases where the 
unwind go wrong and start looping

http://reviews.llvm.org/D12699

Files:
  source/Plugins/Process/Utility/RegisterContextLLDB.cpp

Index: source/Plugins/Process/Utility/RegisterContextLLDB.cpp
===
--- source/Plugins/Process/Utility/RegisterContextLLDB.cpp
+++ source/Plugins/Process/Utility/RegisterContextLLDB.cpp
@@ -634,28 +634,30 @@
 RegisterContextLLDB::CheckIfLoopingStack ()
 {
 // If we have a bad stack setup, we can get the same CFA value multiple 
times -- or even
-// more devious, we can actually oscillate between two CFA values.  Detect 
that here and
+// more devious, we can actually oscillate between two CFA values. Detect 
that here and
 // break out to avoid a possible infinite loop in lldb trying to unwind 
the stack.
-addr_t next_frame_cfa;
-addr_t next_next_frame_cfa = LLDB_INVALID_ADDRESS;
-if (GetNextFrame().get() && GetNextFrame()->GetCFA(next_frame_cfa))
+// To detect when we have the same CFA value multiple times, we compare 
the CFA of the current
+// frame with the 2nd next frame because in some specail case (e.g. signal 
hanlders, hand
+// written assembly without ABI compiance) we can have 2 frames with the 
same CFA (in theory we
+// can have arbitrary number of frames with the same CFA, but more then 2 
is very very unlikely)
+
+RegisterContextLLDB::SharedPtr next_frame = GetNextFrame();
+if (next_frame)
 {
-if (next_frame_cfa == m_cfa)
-{
-// We have a loop in the stack unwind
-return true;
-}
-if (GetNextFrame()->GetNextFrame().get() && 
GetNextFrame()->GetNextFrame()->GetCFA(next_next_frame_cfa)
-&& next_next_frame_cfa == m_cfa)
+RegisterContextLLDB::SharedPtr next_next_frame = 
next_frame->GetNextFrame();
+addr_t next_next_frame_cfa = LLDB_INVALID_ADDRESS;
+if (next_next_frame && next_next_frame->GetCFA(next_next_frame_cfa))
 {
-// We have a loop in the stack unwind
-return true; 
+if (next_next_frame_cfa == m_cfa)
+{
+// We have a loop in the stack unwind
+return true; 
+}
 }
 }
 return false;
 }
 
-
 bool
 RegisterContextLLDB::IsFrameZero () const
 {


Index: source/Plugins/Process/Utility/RegisterContextLLDB.cpp
===
--- source/Plugins/Process/Utility/RegisterContextLLDB.cpp
+++ source/Plugins/Process/Utility/RegisterContextLLDB.cpp
@@ -634,28 +634,30 @@
 RegisterContextLLDB::CheckIfLoopingStack ()
 {
 // If we have a bad stack setup, we can get the same CFA value multiple times -- or even
-// more devious, we can actually oscillate between two CFA values.  Detect that here and
+// more devious, we can actually oscillate between two CFA values. Detect that here and
 // break out to avoid a possible infinite loop in lldb trying to unwind the stack.
-addr_t next_frame_cfa;
-addr_t next_next_frame_cfa = LLDB_INVALID_ADDRESS;
-if (GetNextFrame().get() && GetNextFrame()->GetCFA(next_frame_cfa))
+// To detect when we have the same CFA value multiple times, we compare the CFA of the current
+// frame with the 2nd next frame because in some specail case (e.g. signal hanlders, hand
+// written assembly without ABI compiance) we can have 2 frames with the same CFA (in theory we
+// can have arbitrary number of frames with the same CFA, but more then 2 is very very unlikely)
+
+RegisterContextLLDB::SharedPtr next_frame = GetNextFrame();
+if (next_frame)
 {
-if (next_frame_cfa == m_cfa)
-{
-// We have a loop in the stack unwind
-return true;
-}
-if (GetNextFrame()->GetNextFrame().get() && GetNextFrame()->GetNextFrame()->GetCFA(next_next_frame_cfa)
-&& next_next_frame_cfa == m_cfa)
+RegisterContextLLDB::SharedPtr next_next_frame = next_frame->GetNextFrame();
+addr_t next_next_frame_cfa = LLDB_INVALID_ADDRESS;
+if (next_next_frame && next_next_frame->GetCFA(next_next_frame_cfa))
 {
-// We have a loop in the stack unwind
-return 

Re: [Lldb-commits] [lldb] r247024 - Revert "Enable StopHookForMultipleThreadsTestCase::test_stop_hook_multiple_threads_with_dwarf on FreeBSD"

2015-09-08 Thread Ed Maste via lldb-commits
On 8 September 2015 at 12:35, Ed Maste via lldb-commits
 wrote:
> Author: emaste
> Date: Tue Sep  8 11:35:28 2015
> New Revision: 247024
>
> URL: http://llvm.org/viewvc/llvm-project?rev=247024&view=rev
> Log:
> Revert "Enable 
> StopHookForMultipleThreadsTestCase::test_stop_hook_multiple_threads_with_dwarf
>  on FreeBSD"
>
> And update the comment describing the reason this test is skipped.
> Unlike the issue described llvm.org/pr22784 this test sometimes causes
> a hang on my local machine and is not just a problem on the retired
> buildbot.

Actually, I'm not sure this is the culprit -- I tried a few times with
and without the change and the hang happened only with
test_stop_hook_multiple_threads_with_dwarf in the mix, but it seems
the same hang is now happening with it removed. Anyway, I'll leave it
skipped for now until I can investigate further.
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r247034 - Add missing include for va_list in MIUtilString.h

2015-09-08 Thread Stephane Sezer via lldb-commits
Author: sas
Date: Tue Sep  8 12:47:17 2015
New Revision: 247034

URL: http://llvm.org/viewvc/llvm-project?rev=247034&view=rev
Log:
Add missing include for va_list in MIUtilString.h

Summary: Problem was caught on NetBSD.

Reviewers: joerg, sas

Subscribers: lldb-commits

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

Change by Kamil Rytarowski 

Modified:
lldb/trunk/tools/lldb-mi/MIUtilString.h

Modified: lldb/trunk/tools/lldb-mi/MIUtilString.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MIUtilString.h?rev=247034&r1=247033&r2=247034&view=diff
==
--- lldb/trunk/tools/lldb-mi/MIUtilString.h (original)
+++ lldb/trunk/tools/lldb-mi/MIUtilString.h Tue Sep  8 12:47:17 2015
@@ -13,6 +13,7 @@
 #include 
 #include 
 #include 
+#include 
 
 // In-house headers:
 #include "MIDataTypes.h"


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


Re: [Lldb-commits] [PATCH] D12654: Add missing include for va_list in MIUtilString.h

2015-09-08 Thread Stephane Sezer via lldb-commits
sas closed this revision.
sas added a comment.

Committed as r247034.


Repository:
  rL LLVM

http://reviews.llvm.org/D12654



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


[Lldb-commits] [lldb] r247041 - Use LLVM casting for TypeSystem so you can cast it to subclasses.

2015-09-08 Thread Greg Clayton via lldb-commits
Author: gclayton
Date: Tue Sep  8 13:15:05 2015
New Revision: 247041

URL: http://llvm.org/viewvc/llvm-project?rev=247041&view=rev
Log:
Use LLVM casting for TypeSystem so you can cast it to subclasses.

This will keep our code cleaner and it removes the need for intrusive additions 
to TypeSystem like:

class TypeSystem
{
virtual ClangASTContext *
AsClangASTContext() = 0;
}

As you can now just use the llvm::dyn_cast and other casts.


Modified:
lldb/trunk/include/lldb/Symbol/ClangASTContext.h
lldb/trunk/include/lldb/Symbol/TypeSystem.h
lldb/trunk/source/DataFormatters/CoreMedia.cpp
lldb/trunk/source/DataFormatters/NSArray.cpp
lldb/trunk/source/DataFormatters/NSIndexPath.cpp
lldb/trunk/source/DataFormatters/VectorType.cpp
lldb/trunk/source/Expression/ClangASTSource.cpp
lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp
lldb/trunk/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
lldb/trunk/source/Symbol/ClangASTContext.cpp
lldb/trunk/source/Symbol/CompilerDeclContext.cpp
lldb/trunk/source/Symbol/TypeSystem.cpp

Modified: lldb/trunk/include/lldb/Symbol/ClangASTContext.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/ClangASTContext.h?rev=247041&r1=247040&r2=247041&view=diff
==
--- lldb/trunk/include/lldb/Symbol/ClangASTContext.h (original)
+++ lldb/trunk/include/lldb/Symbol/ClangASTContext.h Tue Sep  8 13:15:05 2015
@@ -40,7 +40,15 @@ class ClangASTContext : public TypeSyste
 public:
 typedef void (*CompleteTagDeclCallback)(void *baton, clang::TagDecl *);
 typedef void (*CompleteObjCInterfaceDeclCallback)(void *baton, 
clang::ObjCInterfaceDecl *);
-
+
+//--
+// llvm casting support
+//--
+static bool classof(const TypeSystem *ts)
+{
+return ts->getKind() == TypeSystem::eKindClang;
+}
+
 //--
 // Constructors and Destructors
 //--
@@ -482,12 +490,6 @@ public:
 // TypeSystem methods
 //--
 
-ClangASTContext*
-AsClangASTContext() override
-{
-return this;
-}
-
 DWARFASTParser *
 GetDWARFParser () override;
 
@@ -532,7 +534,7 @@ public:
 static bool
 IsClangType (const CompilerType &ct)
 {
-return (ct.GetTypeSystem()->AsClangASTContext() != nullptr);
+return llvm::dyn_cast_or_null(ct.GetTypeSystem()) != 
nullptr;
 }
 
 //--
@@ -1049,7 +1051,9 @@ public:
 static clang::QualType
 GetQualType (const CompilerType& type)
 {
-if (type && type.GetTypeSystem()->AsClangASTContext())
+// Make sure we have a clang type before making a clang::QualType
+ClangASTContext *ast = 
llvm::dyn_cast_or_null(type.GetTypeSystem());
+if (ast)
 return clang::QualType::getFromOpaquePtr(type.GetOpaqueQualType());
 return clang::QualType();
 }
@@ -1057,7 +1061,9 @@ public:
 static clang::QualType
 GetCanonicalQualType (const CompilerType& type)
 {
-if (type && type.GetTypeSystem()->AsClangASTContext())
+// Make sure we have a clang type before making a clang::QualType
+ClangASTContext *ast = 
llvm::dyn_cast_or_null(type.GetTypeSystem());
+if (ast)
 return 
clang::QualType::getFromOpaquePtr(type.GetOpaqueQualType()).getCanonicalType();
 return clang::QualType();
 }

Modified: lldb/trunk/include/lldb/Symbol/TypeSystem.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/TypeSystem.h?rev=247041&r1=247040&r2=247041&view=diff
==
--- lldb/trunk/include/lldb/Symbol/TypeSystem.h (original)
+++ lldb/trunk/include/lldb/Symbol/TypeSystem.h Tue Sep  8 13:15:05 2015
@@ -17,6 +17,7 @@
 #include "lldb/Symbol/CompilerDeclContext.h"
 #include "clang/AST/CharUnits.h"
 #include "clang/AST/Type.h"
+#include "llvm/Support/Casting.h"
 
 class DWARFDIE;
 class DWARFASTParser;
@@ -30,14 +31,51 @@ class TypeSystem
 {
 public:
 //--
+// Intrusive type system that allows us to use llvm casting.
+//
+// To add a new type system:
+//
+// 1 - Add a new enumeration for llvm casting below for your TypeSystem
+// subclass, here we will use eKindFoo
+//
+// 2 - Your TypeSystem subclass will inherit from TypeSystem and needs
+// to implement a static classof() function that returns your
+

[Lldb-commits] [lldb] r247046 - SBThread::StepOutOfFrame should check that the SBStackFrame it gets passed

2015-09-08 Thread Jim Ingham via lldb-commits
Author: jingham
Date: Tue Sep  8 13:40:59 2015
New Revision: 247046

URL: http://llvm.org/viewvc/llvm-project?rev=247046&view=rev
Log:
SBThread::StepOutOfFrame should check that the SBStackFrame it gets passed
is valid, and that its thread is the same as this SBThread.

Modified:
lldb/trunk/source/API/SBThread.cpp

Modified: lldb/trunk/source/API/SBThread.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBThread.cpp?rev=247046&r1=247045&r2=247046&view=diff
==
--- lldb/trunk/source/API/SBThread.cpp (original)
+++ lldb/trunk/source/API/SBThread.cpp Tue Sep  8 13:40:59 2015
@@ -826,7 +826,6 @@ SBThread::StepOut ()
 Mutex::Locker api_locker;
 ExecutionContext exe_ctx (m_opaque_sp.get(), api_locker);
 
-
 if (log)
 log->Printf ("SBThread(%p)::StepOut ()",
  static_cast(exe_ctx.GetThreadPtr()));
@@ -861,6 +860,14 @@ SBThread::StepOutOfFrame (lldb::SBFrame
 Mutex::Locker api_locker;
 ExecutionContext exe_ctx (m_opaque_sp.get(), api_locker);
 
+if (!sb_frame.IsValid())
+{
+if (log)
+log->Printf("SBThread(%p)::StepOutOfFrame passed an invalid frame, 
returning.",
+static_cast(exe_ctx.GetThreadPtr()));
+return;
+}
+
 StackFrameSP frame_sp (sb_frame.GetFrameSP());
 if (log)
 {
@@ -877,6 +884,13 @@ SBThread::StepOutOfFrame (lldb::SBFrame
 bool abort_other_plans = false;
 bool stop_other_threads = false;
 Thread *thread = exe_ctx.GetThreadPtr();
+if (sb_frame.GetThread().GetThreadID() != thread->GetID())
+{
+log->Printf("SBThread(%p)::StepOutOfFrame passed a frame from 
another thread (0x" PRIx64 " vrs. 0x" PRIx64 ", returning.",
+static_cast(exe_ctx.GetThreadPtr()),
+sb_frame.GetThread().GetThreadID(),
+thread->GetID());
+}
 
 ThreadPlanSP new_plan_sp(thread->QueueThreadPlanForStepOut 
(abort_other_plans,
 NULL,


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


[Lldb-commits] LLVM buildmaster will be restarted tonight

2015-09-08 Thread Galina Kistanova via lldb-commits
Hello everyone,

LLVM buildmaster will be restarted after 6 PM Pacific time today.

Thanks

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


Re: [Lldb-commits] [PATCH] D12651: Add ctrl-c support to parallel dotest.py.

2015-09-08 Thread Adrian McCarthy via lldb-commits
amccarth added a subscriber: amccarth.
amccarth added a comment.

After applying the patch, I get three additional test case failures on Windows. 
 I'm trying to figure out now which ones.

Is there something specific I'm supposed to be trying, with regard to Ctrl+C 
itself.


http://reviews.llvm.org/D12651



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


Re: [Lldb-commits] [PATCH] D12651: Add ctrl-c support to parallel dotest.py.

2015-09-08 Thread Zachary Turner via lldb-commits
If the patch is busted, pretty much every test should start failing.  As
long as ninja check-lldb actually runs, completes, and behaves pretty much
the same way as before, that's pretty much all that needs to be verified.

Ctrl+C shouldn't behave any differently with this patch, the idea was to
refactor it so that on Windows it would be identical to pre-patch, but on
other platforms there would be improved Ctrl+C handling

On Tue, Sep 8, 2015 at 1:08 PM Adrian McCarthy  wrote:

> amccarth added a subscriber: amccarth.
> amccarth added a comment.
>
> After applying the patch, I get three additional test case failures on
> Windows.  I'm trying to figure out now which ones.
>
> Is there something specific I'm supposed to be trying, with regard to
> Ctrl+C itself.
>
>
> http://reviews.llvm.org/D12651
>
>
>
>
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D12651: Add ctrl-c support to parallel dotest.py.

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

If the patch is busted, pretty much every test should start failing.  As
long as ninja check-lldb actually runs, completes, and behaves pretty much
the same way as before, that's pretty much all that needs to be verified.

Ctrl+C shouldn't behave any differently with this patch, the idea was to
refactor it so that on Windows it would be identical to pre-patch, but on
other platforms there would be improved Ctrl+C handling


http://reviews.llvm.org/D12651



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


Re: [Lldb-commits] [PATCH] D12615: Teach utilsOsType about NetBSD

2015-09-08 Thread Ed Maste via lldb-commits
emaste added a subscriber: emaste.


Comment at: scripts/utilsOsType.py:33
@@ -32,2 +32,3 @@
 "FreeBSD",
+"NetBSD",
 "Linux", 

Please keep these in alpha order (other than Unknown at the top)


Repository:
  rL LLVM

http://reviews.llvm.org/D12615



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


Re: [Lldb-commits] [PATCH] D12651: Add ctrl-c support to parallel dotest.py.

2015-09-08 Thread Adrian McCarthy via lldb-commits
amccarth added a comment.

Ninja check-lldb works.

But...

Before the patch, there are 53 failing test suites and 71 failing test cases.
After the patch there are 54 failing test suites and 74 failing test cases.

Diffing the list of failed suites at the end of the output shows only one 
difference:  TestCPPBreakpoints.py is listed twice after the patch.

That may be unrelated to the patch, but it seems consistent.


http://reviews.llvm.org/D12651



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


Re: [Lldb-commits] [PATCH] D12651: Add ctrl-c support to parallel dotest.py.

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

Can you confirm with 2 runs before and 2 runs after the patch that you see
the same results every time?

Todd, can you think of a reason why this might happen?  I don't think it's
worth holding the patch up too long over this because I want to see the
other improvements come through, but if you can think of an obvious cause
for this Todd (or if you feel like looking into it before I get back
tomorrow Adrian) we could probably fix it before it goes in.  Either In any
case, I'm willing to let it go in this way and fix it tomorrow if necessary.


http://reviews.llvm.org/D12651



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


Re: [Lldb-commits] [PATCH] D12651: Add ctrl-c support to parallel dotest.py.

2015-09-08 Thread Zachary Turner via lldb-commits
Can you confirm with 2 runs before and 2 runs after the patch that you see
the same results every time?

Todd, can you think of a reason why this might happen?  I don't think it's
worth holding the patch up too long over this because I want to see the
other improvements come through, but if you can think of an obvious cause
for this Todd (or if you feel like looking into it before I get back
tomorrow Adrian) we could probably fix it before it goes in.  Either In any
case, I'm willing to let it go in this way and fix it tomorrow if necessary.

On Tue, Sep 8, 2015 at 1:29 PM Adrian McCarthy  wrote:

> amccarth added a comment.
>
> Ninja check-lldb works.
>
> But...
>
> Before the patch, there are 53 failing test suites and 71 failing test
> cases.
> After the patch there are 54 failing test suites and 74 failing test cases.
>
> Diffing the list of failed suites at the end of the output shows only one
> difference:  TestCPPBreakpoints.py is listed twice after the patch.
>
> That may be unrelated to the patch, but it seems consistent.
>
>
> http://reviews.llvm.org/D12651
>
>
>
>
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D12651: Add ctrl-c support to parallel dotest.py.

2015-09-08 Thread Adrian McCarthy via lldb-commits
amccarth added a comment.

I'm re-running the tests now, but I agree this is probably not worth holding up 
this patch.


http://reviews.llvm.org/D12651



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


Re: [Lldb-commits] [PATCH] D12651: Add ctrl-c support to parallel dotest.py.

2015-09-08 Thread Todd Fiala via lldb-commits
tfiala added a comment.

In http://reviews.llvm.org/D12651#241810, @zturner wrote:

> Can you confirm with 2 runs before and 2 runs after the patch that you see
>  the same results every time?
>
> Todd, can you think of a reason why this might happen?


Hmm, I vaguely recall finding what looked like a bug in the pre-change code 
where we might have been losing a count on something, so we might be counting 
something we previously didn't.  But I went through so much code on  this in 
the last 72 hours that I might be misremembering now.

What I can say is that if we're miscounting something (possibly newly so), it 
shouldn't be too hard to find and fix when we list everything.  (i.e. if we're 
counting something, we should be able to say what it was that was counted, and 
if there's something being misrepresented, that should be relatively easy to 
track down).

> worth holding the patch up too long over this because I want to see the

>  other improvements come through, but if you can think of an obvious cause

>  for this Todd (or if you feel like looking into it before I get back

>  tomorrow Adrian) we could probably fix it before it goes in.  Either In any

>  case, I'm willing to let it go in this way and fix it tomorrow if necessary.


That would be great.

Let me know when you're comfortable with it going in, Zachary.  And thanks for 
trying it, Adrian!

> Diffing the list of failed suites at the end of the output shows only one 
> difference: TestCPPBreakpoints.py is listed twice after the patch.


We should be able to hunt that down.  What is your command line?


http://reviews.llvm.org/D12651



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


Re: [Lldb-commits] [PATCH] D12651: Add ctrl-c support to parallel dotest.py.

2015-09-08 Thread Adrian McCarthy via lldb-commits
amccarth added a comment.

It seems to be general flakiness.  In three runs without the patch, I got the 
lower numbers every time.  In three runs with the patch, I got higher numbers 
twice and the lower numbers once.

I have no objection to this patch based on this.


http://reviews.llvm.org/D12651



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


Re: [Lldb-commits] [PATCH] D12115: [LLDB-MI] Fix -data-info-line and -symbol-list-lines when Windows filenames are used.

2015-09-08 Thread Dawn Perchik via lldb-commits
dawn retitled this revision from "[LLDB-MI] Fix -data-info-line when Windows 
filenames are used." to "[LLDB-MI] Fix -data-info-line and -symbol-list-lines 
when Windows filenames are used.".
dawn updated the summary for this revision.
dawn updated this revision to Diff 34255.
dawn added a comment.

This changes the code to use regex to handle the parsing.  It is cleaner, more 
accurate, and faster than the previous code, while not requiring special 
support to check for Windows paths.

In reworking this patch, I discovered a major bug in -symbol-list-lines where 
it didn't check the filename so would report lines in header files as belonging 
to the compilation unit.  That is fixed in this patch and a test added, but to 
fix -symbol-list-lines for header files requires a rewrite of 
-symbol-list-lines which I didn't have time for.   I've added a FIXME for now.


Repository:
  rL LLVM

http://reviews.llvm.org/D12115

Files:
  test/tools/lldb-mi/symbol/Makefile
  test/tools/lldb-mi/symbol/TestMiSymbol.py
  test/tools/lldb-mi/symbol/main.cpp
  test/tools/lldb-mi/symbol/x.cpp
  test/tools/lldb-mi/symbol/x.h
  tools/lldb-mi/MICmdCmdData.cpp
  tools/lldb-mi/MICmdCmdSymbol.cpp
  tools/lldb-mi/MIUtilString.cpp
  tools/lldb-mi/MIUtilString.h

Index: tools/lldb-mi/MIUtilString.h
===
--- tools/lldb-mi/MIUtilString.h
+++ tools/lldb-mi/MIUtilString.h
@@ -43,6 +43,7 @@
 /* ctor */ CMIUtilString();
 /* ctor */ CMIUtilString(const char *vpData);
 /* ctor */ CMIUtilString(const char *const *vpData);
+/* ctor */ CMIUtilString(const char *vpData, size_t nLen);
 //
 bool ExtractNumber(MIint64 &vwrNumber) const;
 CMIUtilString FindAndReplace(const CMIUtilString &vFind, const CMIUtilString &vReplaceWith) const;
Index: tools/lldb-mi/MIUtilString.cpp
===
--- tools/lldb-mi/MIUtilString.cpp
+++ tools/lldb-mi/MIUtilString.cpp
@@ -55,6 +55,20 @@
 }
 
 //++ 
+// Details: CMIUtilString constructor.
+// Type:Method.
+// Args:vpData  - Pointer to UTF8 text data.
+//  nLen- Length of string.
+// Return:  None.
+// Throws:  None.
+//--
+CMIUtilString::CMIUtilString(const char *vpData, size_t nLen)
+: std::string(vpData, nLen)
+{
+}
+
+
+//++ 
 // Details: CMIUtilString assignment operator.
 // Type:Method.
 // Args:vpRhs   - Pointer to UTF8 text data.
Index: tools/lldb-mi/MICmdCmdSymbol.cpp
===
--- tools/lldb-mi/MICmdCmdSymbol.cpp
+++ tools/lldb-mi/MICmdCmdSymbol.cpp
@@ -11,6 +11,9 @@
 
 // Third Party Headers:
 #include "lldb/API/SBCommandInterpreter.h"
+#include "lldb/Host/FileSpec.h"
+#include "lldb/Core/RegularExpression.h"
+#include "llvm/ADT/StringRef.h"
 
 // In-house headers:
 #include "MICmdArgValFile.h"
@@ -20,6 +23,8 @@
 #include "MICmnMIValueList.h"
 #include "MICmnMIValueTuple.h"
 
+using namespace lldb_private;
+
 //++ 
 // Details: CMICmdCmdSymbolListLines constructor.
 // Type:Method.
@@ -81,6 +86,10 @@
 CMICMDBASE_GETOPTION(pArgFile, File, m_constStrArgNameFile);
 
 const CMIUtilString &strFilePath(pArgFile->GetValue());
+// FIXME: this won't work for header files!  To try and use existing
+// commands to get this to work for header files would be too slow.
+// Instead, this code should be rewritten to use APIs and/or support
+// should be added to lldb which would work for header files.
 const CMIUtilString strCmd(CMIUtilString::Format("target modules dump line-table \"%s\"", strFilePath.AddSlashes().c_str()));
 
 CMICmnLLDBDebugSessionInfo &rSessionInfo(CMICmnLLDBDebugSessionInfo::Instance());
@@ -91,6 +100,100 @@
 }
 
 //++ 
+// Details: Helper function for parsing the header returned from lldb for the command:
+//  target modules dump line-table 
+//  where the header is of the format:
+//  Line table for /path/to/file in `/path/to/module
+// Args:input - (R) Input string to parse.
+//  file  - (W) String representing the file.
+// Return:  bool - True = input was parsed successfully, false = input could not be parsed.
+// Throws:  None.
+//--
+static bool
+ParseLLDBLineAddressHeader (const char *input, CMIUtilString &file)
+{
+// Match LineEntry using regex.
+static RegularExpression g_lineentry_header_regex( 
+"^ *Line table for (.+) in `(.+)$");
+// ^1=file
+
+llvm::StringRef fileRef;
+RegularExpression::Match match(3);
+
+if (g_lineentry_header_regex.Execute (input, &match))
+{
+match.GetMatchAtI

Re: [Lldb-commits] [PATCH] D12651: Add ctrl-c support to parallel dotest.py.

2015-09-08 Thread Zachary Turner via lldb-commits
Cool, lgtm as well.  Sorry for the holdup

On Tue, Sep 8, 2015 at 1:58 PM Adrian McCarthy  wrote:

> amccarth added a comment.
>
> It seems to be general flakiness.  In three runs without the patch, I got
> the lower numbers every time.  In three runs with the patch, I got higher
> numbers twice and the lower numbers once.
>
> I have no objection to this patch based on this.
>
>
> http://reviews.llvm.org/D12651
>
>
>
>
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D12651: Add ctrl-c support to parallel dotest.py.

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

Cool, lgtm as well.  Sorry for the holdup


http://reviews.llvm.org/D12651



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


Re: [Lldb-commits] [PATCH] D12651: Add ctrl-c support to parallel dotest.py.

2015-09-08 Thread Todd Fiala via lldb-commits
tfiala added a comment.

In http://reviews.llvm.org/D12651#241903, @zturner wrote:

> Cool, lgtm as well.  Sorry for the holdup


Absolutely no worries.  Thanks for checking, Zachary!

It would also be good if we could get either the --test-runner-name with 
"threading" or "mulltiprocessing" working on Windows at some point (i.e. look 
into that original failure when ctrl-c was added), if for no other reason than 
I suspect you'd get a performance win on Windows based on other platforms.  You 
might also find, even if you're stuck with using the pool implementation, that 
"threading-pool" might just be faster than "multiprocessing-pool" on Windows.  
The threading-pool test runner strategy should be identical in behavior on 
Windows to the multiprocessing-pool strategy that you're using over there, with 
the diff of using "threading" rather than the "multiprocessing" module for the 
underlying implementation.

I'll get this checked in.  Thanks!


http://reviews.llvm.org/D12651



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


Re: [Lldb-commits] [PATCH] D12615: Teach utilsOsType about NetBSD

2015-09-08 Thread Kamil Rytarowski via lldb-commits
krytarowski updated this revision to Diff 34265.
krytarowski added a comment.

abc order


Repository:
  rL LLVM

http://reviews.llvm.org/D12615

Files:
  scripts/utilsOsType.py

Index: scripts/utilsOsType.py
===
--- scripts/utilsOsType.py
+++ scripts/utilsOsType.py
@@ -31,6 +31,7 @@
 "Darwin",
 "FreeBSD",
 "Linux", 
+"NetBSD",
 "Windows" ]
 class __metaclass__( type ):
 #++---
@@ -71,6 +72,8 @@
 eOSType = EnumOsType.FreeBSD
 elif (strOS.startswith("linux")):
 eOSType = EnumOsType.Linux
+elif (strOS.startswith("netbsd")):
+eOSType = EnumOsType.NetBSD
 elif strOS == "win32":
 eOSType = EnumOsType.Windows
 


Index: scripts/utilsOsType.py
===
--- scripts/utilsOsType.py
+++ scripts/utilsOsType.py
@@ -31,6 +31,7 @@
 "Darwin",
 "FreeBSD",
 "Linux", 
+"NetBSD",
 "Windows" ]
 class __metaclass__( type ):
 #++---
@@ -71,6 +72,8 @@
 eOSType = EnumOsType.FreeBSD
 elif (strOS.startswith("linux")):
 eOSType = EnumOsType.Linux
+elif (strOS.startswith("netbsd")):
+eOSType = EnumOsType.NetBSD
 elif strOS == "win32":
 eOSType = EnumOsType.Windows
 
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D12662: Prevent from a redefinition of _GLIBCXX_USE_NANOSLEEP

2015-09-08 Thread Kamil Rytarowski via lldb-commits
krytarowski added a comment.

Thank you. Place commit.


Repository:
  rL LLVM

http://reviews.llvm.org/D12662



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


Re: [Lldb-commits] [PATCH] D12661: NetBSD doesn't provide struct statfs, make use of struct statvfs

2015-09-08 Thread Kamil Rytarowski via lldb-commits
krytarowski added a comment.

Thank you. Place commit.


Repository:
  rL LLVM

http://reviews.llvm.org/D12661



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


[Lldb-commits] [lldb] r247082 - Implement a Target::GetTypeSystemForLanguage API, as well as provide helpers on the TypeSystem to get numeric types of specific sizes and signedness

2015-09-08 Thread Enrico Granata via lldb-commits
Author: enrico
Date: Tue Sep  8 17:09:19 2015
New Revision: 247082

URL: http://llvm.org/viewvc/llvm-project?rev=247082&view=rev
Log:
Implement a Target::GetTypeSystemForLanguage API, as well as provide helpers on 
the TypeSystem to get numeric types of specific sizes and signedness

Modified:
lldb/trunk/include/lldb/Symbol/ClangASTContext.h
lldb/trunk/include/lldb/Symbol/TypeSystem.h
lldb/trunk/include/lldb/Target/Target.h
lldb/trunk/source/DataFormatters/CoreMedia.cpp
lldb/trunk/source/DataFormatters/VectorType.cpp
lldb/trunk/source/Target/Target.cpp

Modified: lldb/trunk/include/lldb/Symbol/ClangASTContext.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/ClangASTContext.h?rev=247082&r1=247081&r2=247082&view=diff
==
--- lldb/trunk/include/lldb/Symbol/ClangASTContext.h (original)
+++ lldb/trunk/include/lldb/Symbol/ClangASTContext.h Tue Sep  8 17:09:19 2015
@@ -454,7 +454,7 @@ public:
 //--
 
 CompilerType
-GetIntTypeFromBitSize (size_t bit_size, bool is_signed)
+GetIntTypeFromBitSize (size_t bit_size, bool is_signed) override
 {
 return GetIntTypeFromBitSize (getASTContext(), bit_size, is_signed);
 }
@@ -477,7 +477,7 @@ public:
 //--
 
 CompilerType
-GetFloatTypeFromBitSize (size_t bit_size)
+GetFloatTypeFromBitSize (size_t bit_size) override
 {
 return GetFloatTypeFromBitSize (getASTContext(), bit_size);
 }

Modified: lldb/trunk/include/lldb/Symbol/TypeSystem.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/TypeSystem.h?rev=247082&r1=247081&r2=247082&view=diff
==
--- lldb/trunk/include/lldb/Symbol/TypeSystem.h (original)
+++ lldb/trunk/include/lldb/Symbol/TypeSystem.h Tue Sep  8 17:09:19 2015
@@ -400,6 +400,12 @@ public:
 virtual CompilerType
 GetBasicTypeFromAST (lldb::BasicType basic_type) = 0;
 
+virtual CompilerType
+GetIntTypeFromBitSize (size_t bit_size, bool is_signed) = 0;
+
+virtual CompilerType
+GetFloatTypeFromBitSize (size_t bit_size) = 0;
+
 virtual bool
 IsBeingDefined (void *type) = 0;
 

Modified: lldb/trunk/include/lldb/Target/Target.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Target.h?rev=247082&r1=247081&r2=247082&view=diff
==
--- lldb/trunk/include/lldb/Target/Target.h (original)
+++ lldb/trunk/include/lldb/Target/Target.h Tue Sep  8 17:09:19 2015
@@ -1230,6 +1230,14 @@ public:
 ClangASTContext *
 GetScratchClangASTContext(bool create_on_demand=true);
 
+TypeSystem*
+GetTypeSystemForLanguage (lldb::LanguageType language);
+
+CompilerType
+GetBasicType (lldb::LanguageType language,
+  lldb::BasicType basic_type,
+  size_t size = 0);
+
 ClangASTImporter *
 GetClangASTImporter();
 

Modified: lldb/trunk/source/DataFormatters/CoreMedia.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/CoreMedia.cpp?rev=247082&r1=247081&r2=247082&view=diff
==
--- lldb/trunk/source/DataFormatters/CoreMedia.cpp (original)
+++ lldb/trunk/source/DataFormatters/CoreMedia.cpp Tue Sep  8 17:09:19 2015
@@ -10,7 +10,7 @@
 #include "lldb/DataFormatters/CoreMedia.h"
 
 #include "lldb/Core/Flags.h"
-#include "lldb/Symbol/ClangASTContext.h"
+#include "lldb/Symbol/TypeSystem.h"
 #include "lldb/Target/Target.h"
 #include 
 
@@ -25,13 +25,13 @@ lldb_private::formatters::CMTimeSummaryP
 if (!type.IsValid())
 return false;
 
-ClangASTContext *ast_ctx = 
valobj.GetExecutionContextRef().GetTargetSP()->GetScratchClangASTContext();
-if (!ast_ctx)
+TypeSystem *type_system = 
valobj.GetExecutionContextRef().GetTargetSP()->GetTypeSystemForLanguage(lldb::eLanguageTypeC);
+if (!type_system)
 return false;
 
 // fetch children by offset to compensate for potential lack of debug info
-auto int64_ty = ast_ctx->GetIntTypeFromBitSize(64, true);
-auto int32_ty = ast_ctx->GetIntTypeFromBitSize(32, true);
+auto int64_ty = type_system->GetIntTypeFromBitSize(64, true);
+auto int32_ty = type_system->GetIntTypeFromBitSize(32, true);
 
 auto value_sp(valobj.GetSyntheticChildAtOffset(0, int64_ty, true));
 auto timescale_sp(valobj.GetSyntheticChildAtOffset(8, int32_ty, true));

Modified: lldb/trunk/source/DataFormatters/VectorType.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/VectorType.cpp?rev=247082&r1=247081&r2=247082&view=diff
=

[Lldb-commits] [lldb] r247084 - dotest.py ctrl-c support, addition of --test-runner-name option.

2015-09-08 Thread Todd Fiala via lldb-commits
Author: tfiala
Date: Tue Sep  8 17:22:33 2015
New Revision: 247084

URL: http://llvm.org/viewvc/llvm-project?rev=247084&view=rev
Log:
dotest.py ctrl-c support, addition of --test-runner-name option.

See http://reviews.llvm.org/D12651 for more details.

For the parallel test runner, -v now also implies --output-on-success.

Modified:
lldb/trunk/test/dosep.py
lldb/trunk/test/dotest.py
lldb/trunk/test/dotest_args.py

Modified: lldb/trunk/test/dosep.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/dosep.py?rev=247084&r1=247083&r2=247084&view=diff
==
--- lldb/trunk/test/dosep.py (original)
+++ lldb/trunk/test/dosep.py Tue Sep  8 17:22:33 2015
@@ -32,14 +32,19 @@ ulimit -c unlimited
 echo core.%p | sudo tee /proc/sys/kernel/core_pattern
 """
 
+import fnmatch
 import multiprocessing
+import multiprocessing.pool
 import os
-import fnmatch
 import platform
+import Queue
 import re
-import dotest_args
+import signal
 import subprocess
 import sys
+import threading
+
+import dotest_args
 
 from optparse import OptionParser
 
@@ -142,7 +147,7 @@ def parse_test_results(output):
 return passes, failures, unexpected_successes
 
 
-def call_with_timeout(command, timeout, name):
+def call_with_timeout(command, timeout, name, inferior_pid_events):
 """Run command with a timeout if possible."""
 """-s QUIT will create a coredump if they are enabled on your system"""
 process = None
@@ -161,8 +166,14 @@ def call_with_timeout(command, timeout,
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
+inferior_pid = process.pid
+if inferior_pid_events:
+inferior_pid_events.put_nowait(('created', inferior_pid))
 output = process.communicate()
 exit_status = process.returncode
+if inferior_pid_events:
+inferior_pid_events.put_nowait(('destroyed', inferior_pid))
+
 passes, failures, unexpected_successes = parse_test_results(output)
 if exit_status == 0:
 # stdout does not have any useful information from 'dotest.py',
@@ -173,7 +184,7 @@ def call_with_timeout(command, timeout,
 return name, exit_status, passes, failures, unexpected_successes
 
 
-def process_dir(root, files, test_root, dotest_argv):
+def process_dir(root, files, test_root, dotest_argv, inferior_pid_events):
 """Examine a directory for tests, and invoke any found within it."""
 results = []
 for name in files:
@@ -187,7 +198,8 @@ def process_dir(root, files, test_root,
 timeout = (os.getenv("LLDB_%s_TIMEOUT" % timeout_name) or
getDefaultTimeout(dotest_options.lldb_platform_name))
 
-results.append(call_with_timeout(command, timeout, name))
+results.append(call_with_timeout(
+command, timeout, name, inferior_pid_events))
 
 # result = (name, status, passes, failures, unexpected_successes)
 timed_out = [name for name, status, _, _, _ in results
@@ -208,39 +220,175 @@ in_q = None
 out_q = None
 
 
-def process_dir_worker(arg_tuple):
-"""Worker thread main loop when in multithreaded mode.
+def process_dir_worker_multiprocessing(
+a_output_lock, a_test_counter, a_total_tests, a_test_name_len,
+a_dotest_options, job_queue, result_queue, inferior_pid_events):
+"""Worker thread main loop when in multiprocessing mode.
 Takes one directory specification at a time and works on it."""
-return process_dir(*arg_tuple)
 
+# Shut off interrupt handling in the child process.
+signal.signal(signal.SIGINT, signal.SIG_IGN)
 
-def walk_and_invoke(test_directory, test_subdir, dotest_argv, num_threads):
-"""Look for matched files and invoke test driver on each one.
-In single-threaded mode, each test driver is invoked directly.
-In multi-threaded mode, submit each test driver to a worker
-queue, and then wait for all to complete.
+# Setup the global state for the worker process.
+setup_global_variables(
+a_output_lock, a_test_counter, a_total_tests, a_test_name_len,
+a_dotest_options)
 
-test_directory - lldb/test/ directory
-test_subdir - lldb/test/ or a subfolder with the tests we're interested in
-  running
+# Keep grabbing entries from the queue until done.
+while not job_queue.empty():
+try:
+job = job_queue.get(block=False)
+result = process_dir(job[0], job[1], job[2], job[3],
+ inferior_pid_events)
+result_queue.put(result)
+except Queue.Empty:
+# Fine, we're done.
+pass
+
+
+def process_dir_worker_multiprocessing_pool(args):
+return process_dir(*args)
+
+
+def process_dir_worker_threading(
+a_test_counter, a_total_tests, a_test_name_len,
+a_dotest_options, job_queue, result_queue,

Re: [Lldb-commits] [PATCH] D12651: Add ctrl-c support to parallel dotest.py.

2015-09-08 Thread Todd Fiala via lldb-commits
tfiala closed this revision.
tfiala added a comment.

Committed here:

  Sendingtest/dosep.py
  Sendingtest/dotest.py
  Sendingtest/dotest_args.py
  Transmitting file data ...
  Committed revision 247084.


http://reviews.llvm.org/D12651



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


[Lldb-commits] [lldb] r247085 - ExpressionVariable now uses llvm::cast() instead of As...() for RTTI.

2015-09-08 Thread Sean Callanan via lldb-commits
Author: spyffe
Date: Tue Sep  8 17:23:39 2015
New Revision: 247085

URL: http://llvm.org/viewvc/llvm-project?rev=247085&view=rev
Log:
ExpressionVariable now uses llvm::cast() instead of As...() for RTTI.
As part of our overall switch from hand-rolling RTTI to using LLVM-compatible
methods, I've done the same for ExpressionVariable.  The main documentation for
how to do this is in TypeSystem.h, so I've simply referred to that.

Modified:
lldb/trunk/include/lldb/Expression/ExpressionVariable.h
lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp
lldb/trunk/source/Expression/Materializer.cpp
lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionVariable.cpp
lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionVariable.h

Modified: lldb/trunk/include/lldb/Expression/ExpressionVariable.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Expression/ExpressionVariable.h?rev=247085&r1=247084&r2=247085&view=diff
==
--- lldb/trunk/include/lldb/Expression/ExpressionVariable.h (original)
+++ lldb/trunk/include/lldb/Expression/ExpressionVariable.h Tue Sep  8 17:23:39 
2015
@@ -33,6 +33,23 @@ class ExpressionVariable :
 public std::enable_shared_from_this
 {
 public:
+//--
+// See TypeSystem.h for how to add subclasses to this.
+//--
+enum LLVMCastKind {
+eKindClang,
+eKindSwift,
+eKindGo,
+kNumKinds
+};
+
+LLVMCastKind getKind() const { return m_kind; }
+
+ExpressionVariable(LLVMCastKind kind) :
+m_kind(kind)
+{
+}
+
 size_t
 GetByteSize ()
 {
@@ -51,10 +68,6 @@ public:
 return m_frozen_sp;
 }
 
-virtual ClangExpressionVariable *AsClangExpressionVariable() {
-return nullptr;
-}
-
 uint8_t *GetValueBytes();
 
 void
@@ -135,6 +148,7 @@ public:
 // these should be private
 lldb::ValueObjectSP m_frozen_sp;
 lldb::ValueObjectSP m_live_sp;
+LLVMCastKindm_kind;
 };
 
 //--

Modified: lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp?rev=247085&r1=247084&r2=247085&view=diff
==
--- lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp (original)
+++ lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp Tue Sep  8 17:23:39 
2015
@@ -136,7 +136,7 @@ ClangExpressionDeclMap::DidParse()
 {
 ExpressionVariableSP 
var_sp(m_found_entities.GetVariableAtIndex(entity_index));
 if (var_sp)
-
var_sp->AsClangExpressionVariable()->DisableParserVars(GetParserID());
+
llvm::cast(var_sp.get())->DisableParserVars(GetParserID());
 }
 
 for (size_t pvar_index = 0, num_pvars = 
m_parser_vars->m_persistent_vars->GetSize();
@@ -145,7 +145,7 @@ ClangExpressionDeclMap::DidParse()
 {
 ExpressionVariableSP 
pvar_sp(m_parser_vars->m_persistent_vars->GetVariableAtIndex(pvar_index));
 if (pvar_sp)
-
pvar_sp->AsClangExpressionVariable()->DisableParserVars(GetParserID());
+
llvm::cast(pvar_sp.get())->DisableParserVars(GetParserID());
 }
 
 DisableParserVars();
@@ -350,11 +350,11 @@ ClangExpressionDeclMap::AddValueToStruct
 // We know entity->m_parser_vars is valid because we used a parser variable
 // to find it
 
-ClangExpressionVariable::ParserVars *parser_vars = 
var->AsClangExpressionVariable()->GetParserVars(GetParserID());
+ClangExpressionVariable::ParserVars *parser_vars = 
llvm::cast(var)->GetParserVars(GetParserID());
 
 parser_vars->m_llvm_value = value;
 
-if (ClangExpressionVariable::JITVars *jit_vars = 
var->AsClangExpressionVariable()->GetJITVars(GetParserID()))
+if (ClangExpressionVariable::JITVars *jit_vars = 
llvm::cast(var)->GetJITVars(GetParserID()))
 {
 // We already laid this out; do not touch
 
@@ -362,9 +362,9 @@ ClangExpressionDeclMap::AddValueToStruct
 log->Printf("Already placed at 0x%llx", (unsigned long 
long)jit_vars->m_offset);
 }
 
-var->AsClangExpressionVariable()->EnableJITVars(GetParserID());
+llvm::cast(var)->EnableJITVars(GetParserID());
 
-ClangExpressionVariable::JITVars *jit_vars = 
var->AsClangExpressionVariable()->GetJITVars(GetParserID());
+ClangExpressionVariable::JITVars *jit_vars = 
llvm::cast(var)->GetJITVars(GetParserID());
 
 jit_vars->m_alignment = alignment;
 jit_vars->m_size = size;
@@ -463,8 +463,8 @@ ClangExpressionDeclMap::GetStructElement
 if (!member_sp)
 return false

Re: [Lldb-commits] [PATCH] D12699: Change the looping stack detection code

2015-09-08 Thread Jason Molenda via lldb-commits
jasonmolenda accepted this revision.
jasonmolenda added a comment.
This revision is now accepted and ready to land.

I'm fine with this change.  On x86, where the CALL instruction pushes the 
return address on the stack, you can't have two stack frames with the CFA.  If 
we have a loop, I don't think it's a big problem if we only break out once it's 
a 3-stack-frame loop.

I'm not sure it's possible to have an arbitrary number of stack frames with the 
same CFA - the return addresses have to be saved somewhere.  The register file 
only gives us so many volatile registers we can use to save multiple stack 
frame's return addresses before we need to write something to the stack.


http://reviews.llvm.org/D12699



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


[Lldb-commits] [lldb] r247090 - Reverting r247000 since it's causing TestRegisters.test_fp_special_purpose_register_read to fail on OSX.

2015-09-08 Thread Oleksiy Vyalov via lldb-commits
Author: ovyalov
Date: Tue Sep  8 17:41:13 2015
New Revision: 247090

URL: http://llvm.org/viewvc/llvm-project?rev=247090&view=rev
Log:
Reverting r247000 since it's causing 
TestRegisters.test_fp_special_purpose_register_read to fail on OSX.


Modified:
lldb/trunk/test/functionalities/register/TestRegisters.py
lldb/trunk/test/functionalities/register/a.cpp

Modified: lldb/trunk/test/functionalities/register/TestRegisters.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/register/TestRegisters.py?rev=247090&r1=247089&r2=247090&view=diff
==
--- lldb/trunk/test/functionalities/register/TestRegisters.py (original)
+++ lldb/trunk/test/functionalities/register/TestRegisters.py Tue Sep  8 
17:41:13 2015
@@ -37,6 +37,7 @@ class RegisterCommandsTestCase(TestBase)
 self.fp_register_write()
 
 @expectedFailureAndroid(archs=["i386"]) # "register read fstat" always 
return 0x
+@expectedFailureClang("llvm.org/pr24733")
 def test_fp_special_purpose_register_read(self):
 """Test commands that read fpu special purpose registers."""
 if not self.getArchitecture() in ['amd64', 'i386', 'x86_64']:
@@ -168,14 +169,15 @@ class RegisterCommandsTestCase(TestBase)
 target = self.dbg.CreateTarget(exe)
 self.assertTrue(target, VALID_TARGET)
 
+# Find the line number to break inside a.cpp.
+self.line = line_number('a.cpp', '// Set break point at this line.')
+
+# Set breakpoint
+lldbutil.run_break_set_by_file_and_line (self, "a.cpp", self.line, 
num_expected_locations=1, loc_exact=True)
+
 # Launch the process, and do not stop at the entry point.
 self.runCmd ("run", RUN_SUCCEEDED)
 
-# Check stop reason; Should be SIGTRAP
-stop_reason = 'stop reason = signal SIGTRAP'
-self.expect("thread list", STOPPED_DUE_TO_SIGNAL,
-  substrs = ['stopped', stop_reason])
-
 process = target.GetProcess()
 self.assertTrue(process.GetState() == lldb.eStateStopped,
 PROCESS_STOPPED)

Modified: lldb/trunk/test/functionalities/register/a.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/register/a.cpp?rev=247090&r1=247089&r2=247090&view=diff
==
--- lldb/trunk/test/functionalities/register/a.cpp (original)
+++ lldb/trunk/test/functionalities/register/a.cpp Tue Sep  8 17:41:13 2015
@@ -13,7 +13,6 @@ return_long_double (long double value)
 {
 float a=2, b=4,c=8, d=16, e=32, f=64, k=128, l=256, add=0;
 __asm__ (
-"int3 ;"
 "flds %1 ;"
 "flds %2 ;"
 "flds %3 ;"


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


Re: [Lldb-commits] [PATCH] D12677: Bug 24733: TestRegisters.py for Clang inferiors

2015-09-08 Thread Oleksiy Vyalov via lldb-commits
ovyalov added a subscriber: ovyalov.
ovyalov added a comment.

I reverted the CL because it was causing 
TestRegisters.test_fp_special_purpose_register_read to fail on OSX:

- stop reason = EXC_BREAKPOINT
- "register read ftag" yields 0x80 instead of expected 0x8000




http://reviews.llvm.org/D12677



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


Re: [Lldb-commits] [PATCH] D12651: Add ctrl-c support to parallel dotest.py.

2015-09-08 Thread Todd Fiala via lldb-commits
tfiala added a comment.

> On OS X there was at least one test that would hang each run, so I didn't get 
> any kind of real timing numbers there since everything was always maxed out 
> by the hanging test.


Well wonders abound.  On my OS X setup, I am not seeing the hanging tests with 
TOT from mid day.  And, surprisingly, the '--test-runner-name threading' is no 
longer grabbing the parallel test runner's Python global interpreter lock on 
the exec.  This means the threads are really working in parallel as originally 
intended last year.  This might be related to changes since OS X 10.9 when I 
was last messing with this.  The better news is that, unlike Linux, the 
'threading' test runner *is* a speed improvement over the 'multiprocessing' 
test runner: on a 4 core MBP mid 2013 with 8 GB RAM using 8 threads, I shaved 
off 16% (~1.2 times speedup) on my runtime using 'threading' over 
'multiprocessing'.

I'm not sure if this is related to the version of OS X and the bundled Python, 
so I may do some experimentation before considering flipping it to default to 
'threading' for OS X.


http://reviews.llvm.org/D12651



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


[Lldb-commits] [lldb] r247101 - Fix regressions in dotest.py when passing filters or directories.

2015-09-08 Thread Todd Fiala via lldb-commits
Author: tfiala
Date: Tue Sep  8 18:22:19 2015
New Revision: 247101

URL: http://llvm.org/viewvc/llvm-project?rev=247101&view=rev
Log:
Fix regressions in dotest.py when passing filters or directories.

See https://llvm.org/bugs/show_bug.cgi?id=24708 for details.
Using '-f FILTER' or unnamed arguments (directories) to dotest.py
will now force no-multiprocessing mode.  This stops a bombardment
of test output spam when following the instructions we provide
in a test session trace for rerunning the test.

Modified:
lldb/trunk/test/dotest.py

Modified: lldb/trunk/test/dotest.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/dotest.py?rev=247101&r1=247100&r2=247101&view=diff
==
--- lldb/trunk/test/dotest.py (original)
+++ lldb/trunk/test/dotest.py Tue Sep  8 18:22:19 2015
@@ -635,6 +635,17 @@ def parseOptionsAndInitTestdirs():
 if any([x.startswith('-') for x in args.f]):
 usage(parser)
 filters.extend(args.f)
+# Shut off multiprocessing mode when additional filters are specified.
+# The rational is that the user is probably going after a very specific
+# test and doesn't need a bunch of parallel test runners all looking 
for
+# it in a frenzy.  Also, '-v' now spits out all test run output even
+# on success, so the standard recipe for redoing a failing test (with 
-v
+# and a -f to filter to the specific test) now causes all test scanning
+# (in parallel) to print results for do-nothing runs in a very 
distracting
+# manner.  If we really need filtered parallel runs in the future, 
consider
+# adding a --no-output-on-success that prevents -v from setting
+# output-on-success.
+no_multiprocess_test_runner = True
 
 if args.g:
 fs4all = False
@@ -780,6 +791,8 @@ def parseOptionsAndInitTestdirs():
 # Gather all the dirs passed on the command line.
 if len(args.args) > 0:
 testdirs = map(os.path.abspath, args.args)
+# Shut off multiprocessing mode when test directories are specified.
+no_multiprocess_test_runner = True
 
 # If '-r dir' is specified, the tests should be run under the relocated
 # directory.  Let's copy the testdirs over.


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


[Lldb-commits] [PATCH] D12714: Fix log message warning in SBThread.

2015-09-08 Thread Bruce Mitchener via lldb-commits
brucem created this revision.
brucem added reviewers: clayborg, jingham.
brucem added a subscriber: lldb-commits.

The format string was not set up correctly as it was missing the %.
This resulted in a warning (correctly) that the data arguments were
not all used.

http://reviews.llvm.org/D12714

Files:
  source/API/SBThread.cpp

Index: source/API/SBThread.cpp
===
--- source/API/SBThread.cpp
+++ source/API/SBThread.cpp
@@ -886,7 +886,7 @@
 Thread *thread = exe_ctx.GetThreadPtr();
 if (sb_frame.GetThread().GetThreadID() != thread->GetID())
 {
-log->Printf("SBThread(%p)::StepOutOfFrame passed a frame from 
another thread (0x" PRIx64 " vrs. 0x" PRIx64 ", returning.",
+log->Printf("SBThread(%p)::StepOutOfFrame passed a frame from 
another thread (0x%" PRIx64 " vrs. 0x%" PRIx64 ", returning.",
 static_cast(exe_ctx.GetThreadPtr()),
 sb_frame.GetThread().GetThreadID(),
 thread->GetID());


Index: source/API/SBThread.cpp
===
--- source/API/SBThread.cpp
+++ source/API/SBThread.cpp
@@ -886,7 +886,7 @@
 Thread *thread = exe_ctx.GetThreadPtr();
 if (sb_frame.GetThread().GetThreadID() != thread->GetID())
 {
-log->Printf("SBThread(%p)::StepOutOfFrame passed a frame from another thread (0x" PRIx64 " vrs. 0x" PRIx64 ", returning.",
+log->Printf("SBThread(%p)::StepOutOfFrame passed a frame from another thread (0x%" PRIx64 " vrs. 0x%" PRIx64 ", returning.",
 static_cast(exe_ctx.GetThreadPtr()),
 sb_frame.GetThread().GetThreadID(),
 thread->GetID());
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D12615: Teach utilsOsType about NetBSD

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

Nice commit summary ;)


Repository:
  rL LLVM

http://reviews.llvm.org/D12615



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


[Lldb-commits] [lldb] r247111 - Fix log message warning in SBThread.

2015-09-08 Thread Bruce Mitchener via lldb-commits
Author: brucem
Date: Tue Sep  8 19:56:25 2015
New Revision: 247111

URL: http://llvm.org/viewvc/llvm-project?rev=247111&view=rev
Log:
Fix log message warning in SBThread.

Summary:
The format string was not set up correctly as it was missing the %.
This resulted in a warning (correctly) that the data arguments were
not all used.

Reviewers: clayborg, jingham

Subscribers: lldb-commits

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

Modified:
lldb/trunk/source/API/SBThread.cpp

Modified: lldb/trunk/source/API/SBThread.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBThread.cpp?rev=247111&r1=247110&r2=247111&view=diff
==
--- lldb/trunk/source/API/SBThread.cpp (original)
+++ lldb/trunk/source/API/SBThread.cpp Tue Sep  8 19:56:25 2015
@@ -886,7 +886,7 @@ SBThread::StepOutOfFrame (lldb::SBFrame
 Thread *thread = exe_ctx.GetThreadPtr();
 if (sb_frame.GetThread().GetThreadID() != thread->GetID())
 {
-log->Printf("SBThread(%p)::StepOutOfFrame passed a frame from 
another thread (0x" PRIx64 " vrs. 0x" PRIx64 ", returning.",
+log->Printf("SBThread(%p)::StepOutOfFrame passed a frame from 
another thread (0x%" PRIx64 " vrs. 0x%" PRIx64 ", returning.",
 static_cast(exe_ctx.GetThreadPtr()),
 sb_frame.GetThread().GetThreadID(),
 thread->GetID());


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


Re: [Lldb-commits] [PATCH] D12714: Fix log message warning in SBThread.

2015-09-08 Thread Bruce Mitchener via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL247111: Fix log message warning in SBThread. (authored by 
brucem).

Changed prior to commit:
  http://reviews.llvm.org/D12714?vs=34282&id=34288#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D12714

Files:
  lldb/trunk/source/API/SBThread.cpp

Index: lldb/trunk/source/API/SBThread.cpp
===
--- lldb/trunk/source/API/SBThread.cpp
+++ lldb/trunk/source/API/SBThread.cpp
@@ -886,7 +886,7 @@
 Thread *thread = exe_ctx.GetThreadPtr();
 if (sb_frame.GetThread().GetThreadID() != thread->GetID())
 {
-log->Printf("SBThread(%p)::StepOutOfFrame passed a frame from 
another thread (0x" PRIx64 " vrs. 0x" PRIx64 ", returning.",
+log->Printf("SBThread(%p)::StepOutOfFrame passed a frame from 
another thread (0x%" PRIx64 " vrs. 0x%" PRIx64 ", returning.",
 static_cast(exe_ctx.GetThreadPtr()),
 sb_frame.GetThread().GetThreadID(),
 thread->GetID());


Index: lldb/trunk/source/API/SBThread.cpp
===
--- lldb/trunk/source/API/SBThread.cpp
+++ lldb/trunk/source/API/SBThread.cpp
@@ -886,7 +886,7 @@
 Thread *thread = exe_ctx.GetThreadPtr();
 if (sb_frame.GetThread().GetThreadID() != thread->GetID())
 {
-log->Printf("SBThread(%p)::StepOutOfFrame passed a frame from another thread (0x" PRIx64 " vrs. 0x" PRIx64 ", returning.",
+log->Printf("SBThread(%p)::StepOutOfFrame passed a frame from another thread (0x%" PRIx64 " vrs. 0x%" PRIx64 ", returning.",
 static_cast(exe_ctx.GetThreadPtr()),
 sb_frame.GetThread().GetThreadID(),
 thread->GetID());
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D12658: Search variables based on clang::DeclContext and clang::Decl tree

2015-09-08 Thread Jim Ingham via lldb-commits
jingham added a subscriber: jingham.
jingham added a reviewer: spyffe.
jingham added a comment.

Sean should take a look at this as well, since it directly affects how the 
expression parser lookup works.


http://reviews.llvm.org/D12658



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


[Lldb-commits] [lldb] r247112 - Data formatter candidate matches can be generated in a number of ways; language-based dynamic type discovery being one of them (for instance, this is what takes an 'id'

2015-09-08 Thread Enrico Granata via lldb-commits
Author: enrico
Date: Tue Sep  8 20:10:46 2015
New Revision: 247112

URL: http://llvm.org/viewvc/llvm-project?rev=247112&view=rev
Log:
Data formatter candidate matches can be generated in a number of ways; 
language-based dynamic type discovery being one of them (for instance, this is 
what takes an 'id' and discovers that it truly is an __NSArrayI, so it should 
probably use the NSArray formatter)

This used to be hardcoded in the FormatManager, but in a pluginized world that 
is not the right way to go

So, move this step to the Language plugin such that appropriate language 
plugins for a type get a say about adding candidates to the formatters lookup 
tables


Modified:
lldb/trunk/include/lldb/DataFormatters/FormatManager.h
lldb/trunk/include/lldb/Target/Language.h
lldb/trunk/include/lldb/lldb-private-enumerations.h
lldb/trunk/source/DataFormatters/FormatManager.cpp
lldb/trunk/source/Plugins/Language/ObjC/ObjCLanguage.cpp
lldb/trunk/source/Plugins/Language/ObjC/ObjCLanguage.h
lldb/trunk/source/Target/Language.cpp

Modified: lldb/trunk/include/lldb/DataFormatters/FormatManager.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/FormatManager.h?rev=247112&r1=247111&r2=247112&view=diff
==
--- lldb/trunk/include/lldb/DataFormatters/FormatManager.h (original)
+++ lldb/trunk/include/lldb/DataFormatters/FormatManager.h Tue Sep  8 20:10:46 
2015
@@ -264,6 +264,9 @@ public:
 
 private:
 
+static std::vector
+GetCandidateLanguages (ValueObject& valobj);
+
 static void
 GetPossibleMatches (ValueObject& valobj,
 CompilerType clang_type,

Modified: lldb/trunk/include/lldb/Target/Language.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Language.h?rev=247112&r1=247111&r2=247112&view=diff
==
--- lldb/trunk/include/lldb/Target/Language.h (original)
+++ lldb/trunk/include/lldb/Target/Language.h Tue Sep  8 20:10:46 2015
@@ -13,6 +13,7 @@
 // C Includes
 // C++ Includes
 #include 
+#include 
 
 // Other libraries and framework includes
 // Project includes
@@ -22,11 +23,10 @@
 
 namespace lldb_private {
 
-class Language :
-public PluginInterface
-{
-public:
-
+class Language :
+public PluginInterface
+{
+public:
 ~Language() override;
 
 static Language*
@@ -42,6 +42,9 @@ namespace lldb_private {
 virtual lldb::TypeCategoryImplSP
 GetFormatters ();
 
+virtual std::vector
+GetPossibleFormattersMatches (ValueObject& valobj, lldb::DynamicValueType 
use_dynamic);
+
 // These are accessors for general information about the Languages lldb 
knows about:
 
 static lldb::LanguageType
@@ -70,16 +73,16 @@ namespace lldb_private {
 LanguageIsPascal (lldb::LanguageType language);
 
 
-protected:
-//--
-// Classes that inherit from Language can see and modify these
-//--
-
-Language();
-private:
-
-DISALLOW_COPY_AND_ASSIGN (Language);
-};
+protected:
+//--
+// Classes that inherit from Language can see and modify these
+//--
+
+Language();
+private:
+
+DISALLOW_COPY_AND_ASSIGN (Language);
+};
 
 } // namespace lldb_private
 

Modified: lldb/trunk/include/lldb/lldb-private-enumerations.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/lldb-private-enumerations.h?rev=247112&r1=247111&r2=247112&view=diff
==
--- lldb/trunk/include/lldb/lldb-private-enumerations.h (original)
+++ lldb/trunk/include/lldb/lldb-private-enumerations.h Tue Sep  8 20:10:46 2015
@@ -188,7 +188,7 @@ typedef enum FormatterChoiceCriterion
 eFormatterChoiceCriterionNavigatedTypedefs = 0x0002,
 eFormatterChoiceCriterionRegularExpressionSummary =  0x0004,
 eFormatterChoiceCriterionRegularExpressionFilter =   0x0004,
-eFormatterChoiceCriterionDynamicObjCDiscovery =  0x0008,
+eFormatterChoiceCriterionLanguagePlugin =0x0008,
 eFormatterChoiceCriterionStrippedBitField =  0x0010,
 eFormatterChoiceCriterionWentToStaticValue = 0x0020
 } FormatterChoiceCriterion;

Modified: lldb/trunk/source/DataFormatters/FormatManager.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/FormatManager.cpp?rev=247112&r1=247111&r2=247112&view=diff
==
--- lldb/trunk/source/DataFo

[Lldb-commits] [lldb] r247114 - Prevent from a redefinition of _GLIBCXX_USE_NANOSLEEP

2015-09-08 Thread Stephane Sezer via lldb-commits
Author: sas
Date: Tue Sep  8 20:17:24 2015
New Revision: 247114

URL: http://llvm.org/viewvc/llvm-project?rev=247114&view=rev
Log:
Prevent from a redefinition of _GLIBCXX_USE_NANOSLEEP

Summary: Build warning caught on NetBSD.

Reviewers: joerg, sas

Subscribers: lldb-commits

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

Change by Kamil Rytarowski 

Modified:
lldb/trunk/source/Host/posix/PipePosix.cpp

Modified: lldb/trunk/source/Host/posix/PipePosix.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/posix/PipePosix.cpp?rev=247114&r1=247113&r2=247114&view=diff
==
--- lldb/trunk/source/Host/posix/PipePosix.cpp (original)
+++ lldb/trunk/source/Host/posix/PipePosix.cpp Tue Sep  8 20:17:24 2015
@@ -14,8 +14,10 @@
 #include "llvm/Support/FileSystem.h"
 
 #if defined(__GNUC__) && (__GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 
8))
+#ifndef _GLIBCXX_USE_NANOSLEEP
 #define _GLIBCXX_USE_NANOSLEEP
 #endif
+#endif
 
 #include 
 #include 


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


Re: [Lldb-commits] [PATCH] D12662: Prevent from a redefinition of _GLIBCXX_USE_NANOSLEEP

2015-09-08 Thread Stephane Sezer via lldb-commits
sas closed this revision.
sas added a comment.

Committed as r247114.


Repository:
  rL LLVM

http://reviews.llvm.org/D12662



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


[Lldb-commits] [lldb] r247115 - NetBSD doesn't provide struct statfs, make use of struct statvfs

2015-09-08 Thread Stephane Sezer via lldb-commits
Author: sas
Date: Tue Sep  8 20:19:05 2015
New Revision: 247115

URL: http://llvm.org/viewvc/llvm-project?rev=247115&view=rev
Log:
NetBSD doesn't provide struct statfs, make use of struct statvfs

Reviewers: joerg, sas

Subscribers: labath, lldb-commits

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

Change by Kamil Rytarowski 

Modified:
lldb/trunk/source/Host/posix/FileSystem.cpp

Modified: lldb/trunk/source/Host/posix/FileSystem.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/posix/FileSystem.cpp?rev=247115&r1=247114&r2=247115&view=diff
==
--- lldb/trunk/source/Host/posix/FileSystem.cpp (original)
+++ lldb/trunk/source/Host/posix/FileSystem.cpp Tue Sep  8 20:19:05 2015
@@ -20,6 +20,9 @@
 #include 
 #include 
 #endif
+#if defined(__NetBSD__)
+#include 
+#endif
 
 // lldb Includes
 #include "lldb/Core/Error.h"
@@ -213,6 +216,12 @@ FileSystem::Readlink(const FileSpec &src
 return error;
 }
 
+#if defined(__NetBSD__)
+static bool IsLocal(const struct statvfs& info)
+{
+return (info.f_flag & MNT_LOCAL) != 0;
+}
+#else
 static bool IsLocal(const struct statfs& info)
 {
 #ifdef __linux__
@@ -230,7 +239,19 @@ static bool IsLocal(const struct statfs&
 return (info.f_flags & MNT_LOCAL) != 0;
 #endif
 }
+#endif
 
+#if defined(__NetBSD__)
+bool
+FileSystem::IsLocal(const FileSpec &spec)
+{
+struct statvfs statfs_info;
+std::string path (spec.GetPath());
+if (statvfs(path.c_str(), &statfs_info) == 0)
+return ::IsLocal(statfs_info);
+return false;
+}
+#else
 bool
 FileSystem::IsLocal(const FileSpec &spec)
 {
@@ -240,3 +261,4 @@ FileSystem::IsLocal(const FileSpec &spec
 return ::IsLocal(statfs_info);
 return false;
 }
+#endif


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


Re: [Lldb-commits] [PATCH] D12661: NetBSD doesn't provide struct statfs, make use of struct statvfs

2015-09-08 Thread Stephane Sezer via lldb-commits
sas closed this revision.
sas added a comment.

Committed as r247115.


Repository:
  rL LLVM

http://reviews.llvm.org/D12661



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


Re: [Lldb-commits] [PATCH] D12615: Teach utilsOsType about NetBSD

2015-09-08 Thread Stephane Sezer via lldb-commits
sas added a comment.

I suppose you'll want this to go in as well so I'll just do it along with the 
rest.


Repository:
  rL LLVM

http://reviews.llvm.org/D12615



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


[Lldb-commits] [lldb] r247116 - Teach utilsOsType about NetBSD

2015-09-08 Thread Stephane Sezer via lldb-commits
Author: sas
Date: Tue Sep  8 20:22:05 2015
New Revision: 247116

URL: http://llvm.org/viewvc/llvm-project?rev=247116&view=rev
Log:
Teach utilsOsType about NetBSD

Summary: NetBSD is a free, fast, secure, and highly portable Unix-like Open 
Source operating system.

Reviewers: joerg, sas

Subscribers: sas, emaste, lldb-commits

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

Change by Kamil Rytarowski 

Modified:
lldb/trunk/scripts/utilsOsType.py

Modified: lldb/trunk/scripts/utilsOsType.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/utilsOsType.py?rev=247116&r1=247115&r2=247116&view=diff
==
--- lldb/trunk/scripts/utilsOsType.py (original)
+++ lldb/trunk/scripts/utilsOsType.py Tue Sep  8 20:22:05 2015
@@ -31,6 +31,7 @@ class EnumOsType( object ):
 "Darwin",
 "FreeBSD",
 "Linux", 
+"NetBSD",
 "Windows" ]
 class __metaclass__( type ):
 #++---
@@ -71,6 +72,8 @@ def determine_os_type():
 eOSType = EnumOsType.FreeBSD
 elif (strOS.startswith("linux")):
 eOSType = EnumOsType.Linux
+elif (strOS.startswith("netbsd")):
+eOSType = EnumOsType.NetBSD
 elif strOS == "win32":
 eOSType = EnumOsType.Windows
 


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


Re: [Lldb-commits] [PATCH] D12615: Teach utilsOsType about NetBSD

2015-09-08 Thread Stephane Sezer via lldb-commits
sas closed this revision.
sas added a comment.

Committed as r247116.


Repository:
  rL LLVM

http://reviews.llvm.org/D12615



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


[Lldb-commits] [lldb] r247120 - A change I'm open to reverting if there is disagreement:

2015-09-08 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Tue Sep  8 22:24:52 2015
New Revision: 247120

URL: http://llvm.org/viewvc/llvm-project?rev=247120&view=rev
Log:
A change I'm open to reverting if there is disagreement:
When lldb receives a gdb-remote protocol packet that has
nonprintable characters, it will print the packet in
gdb-remote logging with binary-hex encoding so we don't 
dump random 8-bit characters into the packet log.

I'm changing this check to allow whitespace characters
(newlines, linefeeds, tabs) to be printed if those are
the only non-printable characters in the packet. 

This is primarily to get the response to the 
qXfer:features:read:target.xml packet to show up in the
packet logs in human readable form.  Right now we just
get a dozen kilobytes of hex-ascii and it's hard to 
figure out what register number scheme is being used.

Modified:
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.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=247120&r1=247119&r2=247120&view=diff
==
--- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp 
(original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp Tue 
Sep  8 22:24:52 2015
@@ -936,8 +936,10 @@ GDBRemoteCommunication::CheckForPacket (
 {
 for (size_t i=0; !binary && ihttp://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r247121 - When lldb gets the register definitions from the response of a

2015-09-08 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Tue Sep  8 22:36:24 2015
New Revision: 247121

URL: http://llvm.org/viewvc/llvm-project?rev=247121&view=rev
Log:
When lldb gets the register definitions from the response of a
qXfer:features:read:target.xml packet, or via the
plugin.process.gdb-remote.target-definition-file setting, if the
register definition doesn't give us eh_frame or DWARF register
numbers for that register, try to get that information from the ABI
plugin.

The DWARF/eh_frame register numbers are defined in the ABI
standardization documents - so getting this from the ABI plugin is
reasonable.  There's little value in having the remote stub inform
us of this generic information, as long as we can all agree on the
names of the registers.

There's some additional information we could get from the ABI.  For
instance, on ABIs where function arguments are passed in registers,
lldb defines alternate names like "arg1", "arg2", "arg3" for these
registers so they can be referred to that way by the user.  We could
get this from the ABI if the remote stub doesn't provide that.  That
may be something worth doing in the future - but for now, I'm keeping
this a little more minimal.

Thinking about this, what we want/need from the remote stub at a
minimum are:

 1. The names of the register
 2. The number that the stub will use to refer to the register with
the p/P packets and in the ? response packets (T/S) where 
expedited register values are provided
 3. The size of the register in bytes
   
(nice to have, to remove any doubt)
 4. The offset of the register in the g/G packet if we're going to
use that for reading/writing registers.

debugserver traditionally provides a lot more information in
addition to this via the qRegisterInfo packet, and debugserver 
augments its response to the qXfer:features:read:target.xml
query to include this information.  Including:

DWARF regnum, eh_frame regnum, stabs regnum, encoding (ieee754,
Uint, Vector, Sint), format (hex, unsigned, pointer, vectorof*,
float), registers that should be marked as invalid if this 
register is modified, and registers that contain this register.

We might want to get all of this from the ABI - I'm not convinced
that it makes sense for the remote stub to provide any of these 
details, as long as the ABI and remote stub can agree on register
names.

Anyway, start with eh_frame and DWARF coming from the ABI if 
they're not provided by the remote stub.  We can look at doing
more in the future.

 

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

Modified: lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp?rev=247121&r1=247120&r2=247121&view=diff
==
--- lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp (original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp Tue Sep  
8 22:36:24 2015
@@ -56,6 +56,7 @@
 #include "lldb/Interpreter/OptionGroupUInt64.h"
 #include "lldb/Interpreter/Property.h"
 #include "lldb/Symbol/ObjectFile.h"
+#include "lldb/Target/ABI.h"
 #include "lldb/Target/DynamicLoader.h"
 #include "lldb/Target/Target.h"
 #include "lldb/Target/TargetList.h"
@@ -513,6 +514,35 @@ ProcessGDBRemote::ParsePythonTargetDefin
 return false;
 }
 
+// If the remote stub didn't give us eh_frame or DWARF register numbers for a 
register,
+// see if the ABI can provide them.
+// DWARF and eh_frame register numbers are defined as a part of the ABI.
+static void
+AugmentRegisterInfoViaABI (RegisterInfo ®_info, ConstString reg_name, ABISP 
abi_sp)
+{
+if (reg_info.kinds[eRegisterKindEHFrame] == LLDB_INVALID_REGNUM
+|| reg_info.kinds[eRegisterKindDWARF] == LLDB_INVALID_REGNUM)
+{
+if (abi_sp)
+{
+RegisterInfo abi_reg_info;
+if (abi_sp->GetRegisterInfoByName (reg_name, abi_reg_info))
+{
+if (reg_info.kinds[eRegisterKindEHFrame] == LLDB_INVALID_REGNUM
+&& abi_reg_info.kinds[eRegisterKindEHFrame] != 
LLDB_INVALID_REGNUM)
+{
+reg_info.kinds[eRegisterKindEHFrame] = 
abi_reg_info.kinds[eRegisterKindEHFrame];
+}
+if (reg_info.kinds[eRegisterKindDWARF] == LLDB_INVALID_REGNUM
+&& abi_reg_info.kinds[eRegisterKindDWARF] != 
LLDB_INVALID_REGNUM)
+{
+reg_info.kinds[eRegisterKindDWARF] = 
abi_reg_info.kinds[eRegisterKindDWARF];
+}
+}
+}
+}
+}
+
 static size_t
 SplitCommaSeparatedRegisterNumberString(const llvm::StringRef 
&comma_separated_regiter_numbers, std::vector ®nums, int base)
 {
@@ -715,6 +745,8 @@ ProcessGDBRemote::BuildDynamicRegisterIn
 reg_info.invalidate_regs = invalidate_regs.data();
 }
 
+   

Re: [Lldb-commits] [PATCH] D12079: [MIPS] microMIPS breakpoints, disassembly and compressed addresses

2015-09-08 Thread Jaydeep Patil via lldb-commits
jaydeep updated this revision to Diff 34292.
jaydeep added a comment.

In this patch:

- Removed MIPS comment from generic code
- Used Target::GetOpcodeLoadAddress to fixup the PC

Regarding change in FormatEntity.cpp:

We still need to do this. The bit #0 of ‘addr’ has already been striped and 
thus it does not represent its true address space (microMIPS or MIPS). We need 
to call GetCallableLoadAddress here because we want to set the bit #0 of this 
address if it belongs to eAddressClassCodeAlternateISA.

This change displays the microMIPS disassembly (and other addresses) in compact 
address space:

  0x8020067d <+0>:  addiusp -16
  0x8020067f <+2>:  sw $fp, 12($sp)
  0x80200681 <+4>:  move   $fp, $sp

- thread #1: tid = 0x0001, 0x802006c5 micro.elf`foo(a=0, b=0) + 16 at 
micro.c:19, stop reason = breakpoint 2.1 frame #0: 0x802006c5 
micro.elf`foo(a=0, b=0) + 16 at micro.c:19

Without this change the microMIPS disassembly would be displayed in uncompact 
(MIPS) address space:

  0x8020067c <+0>:  addiusp -16
  0x8020067e <+2>:  sw $fp, 12($sp)
  0x80200680 <+4>:  move   $fp, $sp

- thread #1: tid = 0x0001, 0x802006c4 micro.elf`foo(a=0, b=0) + 16 at 
micro.c:19, stop reason = breakpoint 2.1 frame #0: 0x802006c4 
micro.elf`foo(a=0, b=0) + 16 at micro.c:19


Repository:
  rL LLVM

http://reviews.llvm.org/D12079

Files:
  source/Core/FormatEntity.cpp
  source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp
  source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
  source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
  source/Target/RegisterContext.cpp
  source/Target/Target.cpp

Index: source/Target/Target.cpp
===
--- source/Target/Target.cpp
+++ source/Target/Target.cpp
@@ -2065,6 +2065,27 @@
 addr_t code_addr = load_addr;
 switch (m_arch.GetMachine())
 {
+case llvm::Triple::mips:
+case llvm::Triple::mipsel:
+case llvm::Triple::mips64:
+case llvm::Triple::mips64el:
+switch (addr_class)
+{
+case eAddressClassData:
+case eAddressClassDebug:
+return LLDB_INVALID_ADDRESS;
+
+case eAddressClassUnknown:
+case eAddressClassInvalid:
+case eAddressClassCode:
+case eAddressClassCodeAlternateISA:
+case eAddressClassRuntime:
+if ((code_addr & 2ull) || (addr_class == eAddressClassCodeAlternateISA))
+code_addr |= 1ull;
+break;
+}
+break;
+
 case llvm::Triple::arm:
 case llvm::Triple::thumb:
 switch (addr_class)
@@ -2110,6 +2131,10 @@
 addr_t opcode_addr = load_addr;
 switch (m_arch.GetMachine())
 {
+case llvm::Triple::mips:
+case llvm::Triple::mipsel:
+case llvm::Triple::mips64:
+case llvm::Triple::mips64el:
 case llvm::Triple::arm:
 case llvm::Triple::thumb:
 switch (addr_class)
Index: source/Target/RegisterContext.cpp
===
--- source/Target/RegisterContext.cpp
+++ source/Target/RegisterContext.cpp
@@ -20,6 +20,7 @@
 #include "lldb/Target/StackFrame.h"
 #include "lldb/Target/Process.h"
 #include "lldb/Target/Thread.h"
+#include "lldb/Target/Target.h"
 
 using namespace lldb;
 using namespace lldb_private;
@@ -103,7 +104,20 @@
 RegisterContext::GetPC(uint64_t fail_value)
 {
 uint32_t reg = ConvertRegisterKindToRegisterNumber (eRegisterKindGeneric, LLDB_REGNUM_GENERIC_PC);
-return ReadRegisterAsUnsigned (reg, fail_value);
+uint64_t pc = ReadRegisterAsUnsigned (reg, fail_value);
+
+if (pc != fail_value)
+{
+TargetSP target_sp = m_thread.CalculateTarget();
+if (target_sp)
+{
+Target *target = target_sp.get();
+if (target)
+pc = target->GetOpcodeLoadAddress (pc, eAddressClassCode);
+}
+}
+
+return pc;
 }
 
 bool
Index: source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
===
--- source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
+++ source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
@@ -1394,6 +1394,7 @@
 {
 LineTable* line_table;
 std::unique_ptr sequence_ap;
+ArchSpec arch;
 };
 
 //--
@@ -1422,8 +1423,20 @@
 info->sequence_ap.reset(line_table->CreateLineSequenceContainer());
 assert(info->sequence_ap.get());
 }
+
+/*
+ * MIPS:
+ * The SymbolContext may not have a valid target, thus we may not be able
+ * to call Address::GetOpcodeLoadAddress() which would clear the bit #0
+ * for MIPS. Use ArchSpec to clear the bit #0.
+*/
+lldb::addr_t file_addr = state.address;
+if (info->arch.GetMachine() == llvm::Triple::mips || info->arch.GetMachine() == llvm::Triple::mipsel
+   || info->arch.GetMachine() == llvm::Triple::mips64 || info->arch