Re: [Lldb-commits] [PATCH] D18075: Fix deadlock due to thread list locking in 'bt all' with obj-c

2016-03-19 Thread Stephane Sezer via lldb-commits
sas closed this revision.
sas added a comment.

Committed as r263735.


http://reviews.llvm.org/D18075



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


Re: [Lldb-commits] [PATCH] D18194: Abstract the debug info parser from the ASTContext

2016-03-19 Thread Zachary Turner via lldb-commits
zturner updated this revision to Diff 50840.
zturner added a comment.

Re-opening this after an update.  I had to move `CanCompleteType`, 
`CompleteType`, and `LayoutRecordType` implementations into another class 
(which I've called `ClangTypeImportHelper`, because PDB needed to use the exact 
same implementation.


http://reviews.llvm.org/D18194

Files:
  include/lldb/Symbol/ClangASTContext.h
  include/lldb/Symbol/ClangTypeImportHelper.h
  include/lldb/Symbol/DebugInfoASTParser.h
  include/lldb/Symbol/GoASTContext.h
  include/lldb/Symbol/JavaASTContext.h
  include/lldb/Symbol/SymbolFile.h
  include/lldb/Symbol/TypeSystem.h
  source/Plugins/SymbolFile/DWARF/DWARFASTParser.h
  source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
  source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.h
  source/Plugins/SymbolFile/DWARF/DWARFDIE.cpp
  source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
  source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
  source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp
  source/Plugins/SymbolFile/PDB/SymbolFilePDB.h
  source/Symbol/CMakeLists.txt
  source/Symbol/ClangASTContext.cpp
  source/Symbol/ClangTypeImportHelper.cpp
  source/Symbol/GoASTContext.cpp
  source/Symbol/JavaASTContext.cpp

Index: source/Symbol/JavaASTContext.cpp
===
--- source/Symbol/JavaASTContext.cpp
+++ source/Symbol/JavaASTContext.cpp
@@ -496,8 +496,8 @@
 return m_pointer_byte_size;
 }
 
-DWARFASTParser *
-JavaASTContext::GetDWARFParser()
+DebugInfoASTParser *
+JavaASTContext::GetDebugInfoASTParser()
 {
 if (!m_dwarf_ast_parser_ap)
 m_dwarf_ast_parser_ap.reset(new DWARFASTParserJava(*this));
Index: source/Symbol/GoASTContext.cpp
===
--- source/Symbol/GoASTContext.cpp
+++ source/Symbol/GoASTContext.cpp
@@ -1639,8 +1639,8 @@
 return (kind & GoType::KIND_DIRECT_IFACE) == GoType::KIND_DIRECT_IFACE;
 }
 
-DWARFASTParser *
-GoASTContext::GetDWARFParser()
+DebugInfoASTParser *
+GoASTContext::GetDebugInfoASTParser()
 {
 if (!m_dwarf_ast_parser_ap)
 m_dwarf_ast_parser_ap.reset(new DWARFASTParserGo(*this));
Index: source/Symbol/ClangTypeImportHelper.cpp
===
--- /dev/null
+++ source/Symbol/ClangTypeImportHelper.cpp
@@ -0,0 +1,71 @@
+//===-- ClangTypeImportHelper.cpp ---*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===--===//
+
+#include "lldb/Symbol/ClangTypeImportHelper.h"
+#include "lldb/Symbol/ClangASTContext.h"
+#include "lldb/Symbol/ClangASTImporter.h"
+
+using namespace lldb_private;
+
+bool
+ClangTypeImportHelper::CanCompleteType(const CompilerType &compiler_type, ClangASTImporter &importer)
+{
+return ClangASTContext::CanImport(compiler_type, importer);
+}
+
+bool
+ClangTypeImportHelper::CompleteType(const CompilerType &compiler_type, ClangASTImporter &importer)
+{
+if (!CanCompleteType(compiler_type, importer))
+return false;
+
+if (ClangASTContext::Import(compiler_type, importer))
+{
+ClangASTContext::CompleteTagDeclarationDefinition(compiler_type);
+return true;
+}
+
+ClangASTContext::SetHasExternalStorage(compiler_type.GetOpaqueQualType(), false);
+return false;
+}
+
+bool
+ClangTypeImportHelper::LayoutRecordType(const clang::RecordDecl *record_decl, uint64_t &bit_size, uint64_t &alignment,
+llvm::DenseMap &field_offsets,
+llvm::DenseMap &base_offsets,
+llvm::DenseMap &vbase_offsets)
+{
+RecordDeclToLayoutMap::iterator pos = m_record_decl_to_layout_map.find(record_decl);
+bool success = false;
+base_offsets.clear();
+vbase_offsets.clear();
+if (pos != m_record_decl_to_layout_map.end())
+{
+bit_size = pos->second.bit_size;
+alignment = pos->second.alignment;
+field_offsets.swap(pos->second.field_offsets);
+base_offsets.swap(pos->second.base_offsets);
+vbase_offsets.swap(pos->second.vbase_offsets);
+m_record_decl_to_layout_map.erase(pos);
+success = true;
+}
+else
+{
+bit_size = 0;
+alignment = 0;
+field_offsets.clear();
+}
+return success;
+}
+
+void
+ClangTypeImportHelper::InsertRecordDecl(clang::RecordDecl *decl, const LayoutInfo &layout)
+{
+m_record_decl_to_layout_map.insert(std::make_pair(decl, layout));
+}
\ No newline at end of file
Index: source/Symbol/ClangASTContext.cpp
===
--- source/Symbol/ClangASTContext.cpp
+++ source/Symbol/ClangASTContext.cpp
@@ -9653,16 +9653,17 @@
 }
 }
 

Re: [Lldb-commits] [PATCH] D17970: Implement ObjectFilePECOFF::GetEntryPointAddress.

2016-03-19 Thread Stephane Sezer via lldb-commits
sas added a comment.

FWIW, I didn't cache this value because in the current form it is just 
returning some data that is already cached by `ParseHeader()`. If I split it in 
section/offset address, it might be required.


http://reviews.llvm.org/D17970



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


Re: [Lldb-commits] [lldb] r263520 - Add some test coverage for the changes in alias help

2016-03-19 Thread Zachary Turner via lldb-commits
Huh,  your hypothesis might be correct.  The symlink of the python
extension module pointing to liblldb is out of date, and not getting
updated.  Never seen this happen before, but that sounds like it's probably
the culprit.

On Fri, Mar 18, 2016 at 2:49 PM Enrico Granata  wrote:

> On Mar 18, 2016, at 2:45 PM, Zachary Turner  wrote:
>
> Hi Enrico,
>
> These tests are failing on Windows.  They're new tests so not really a
> regression, but do you have any idea what might be wrong?  Basically, when
> the test runs, the help po is displaying the full output of "help
> expression".  But strangely, if I go into lldb and run "help po" there,
> it's correct and the output would pass the test.
>
> So something is different about running through the public api or running
> help inside of lldb
>
>
> This doesn’t seem to have much to do with “the public API” since it’s a
> lame plain old command-line test
>
> Honestly, no, I am not sure what would be special about this on Windows.
> The only thing I can think of is that maybe - for whatever reason - the
> test suite is running against an older LLDB, but that seems fairly unlikely
> to go unnoticed, now does it?
>
> Your best bet may be to put a sleep() call in the test case to give
> yourself a chance to attach with a debugger - and then step through the
> “help” code as things unfold
>
> On Mon, Mar 14, 2016 at 6:47 PM Enrico Granata via lldb-commits <
> lldb-commits@lists.llvm.org> wrote:
>
>> Author: enrico
>> Date: Mon Mar 14 20:43:00 2016
>> New Revision: 263520
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=263520&view=rev
>> Log:
>> Add some test coverage for the changes in alias help
>>
>>
>> Modified:
>> lldb/trunk/packages/Python/lldbsuite/test/help/TestHelp.py
>>
>> Modified: lldb/trunk/packages/Python/lldbsuite/test/help/TestHelp.py
>> URL:
>> http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/help/TestHelp.py?rev=263520&r1=263519&r2=263520&view=diff
>>
>> ==
>> --- lldb/trunk/packages/Python/lldbsuite/test/help/TestHelp.py (original)
>> +++ lldb/trunk/packages/Python/lldbsuite/test/help/TestHelp.py Mon Mar 14
>> 20:43:00 2016
>> @@ -167,6 +167,24 @@ class HelpCommandTestCase(TestBase):
>>  'variable +--'])
>>
>>  @no_debug_info_test
>> +def test_help_po_hides_options(self):
>> +"""Test that 'help po' does not show all the options for
>> expression"""
>> +self.expect("help po",
>> +substrs = ['--show-all-children', '--object-description'],
>> matching=False)
>> +
>> +@no_debug_info_test
>> +def test_help_run_hides_options(self):
>> +"""Test that 'help run' does not show all the options for
>> process launch"""
>> +self.expect("help run",
>> +substrs = ['--arch', '--environment'], matching=False)
>> +
>> +@no_debug_info_test
>> +def test_help_next_shows_options(self):
>> +"""Test that 'help next' shows all the options for thread
>> step-over"""
>> +self.expect("help next",
>> +substrs = ['--python-class','--run-mode'], matching=True)
>> +
>> +@no_debug_info_test
>>  def test_help_provides_alternatives(self):
>>  """Test that help on commands that don't exist provides
>> information on additional help avenues"""
>>  self.expect("help thisisnotadebuggercommand",
>>
>>
>> ___
>> lldb-commits mailing list
>> lldb-commits@lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
>>
>
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D17107: [lldb] Unicode support on Win32

2016-03-19 Thread Cameron via lldb-commits
cameron314 added a comment.

Ah. Sorry. I have the same source layout as you locally, but I changed the 
paths in the patch to match the layout of Diffusion 
(http://reviews.llvm.org/diffusion/L/). I'll redo the patch with relative paths 
from lldb...


http://reviews.llvm.org/D17107



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


Re: [Lldb-commits] [PATCH] D17970: Implement ObjectFilePECOFF::GetEntryPointAddress.

2016-03-19 Thread Stephane Sezer via lldb-commits
sas added a comment.

Yep, @jingham is right, I need this for expression evaluation. I'll do the 
change @clayborg requested.


http://reviews.llvm.org/D17970



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


Re: [Lldb-commits] [PATCH] D17107: [lldb] Unicode support on Win32

2016-03-19 Thread Zachary Turner via lldb-commits
Oh yea I think the reason I didn't look at it again is because I was
waiting for the update where you removed the codepage stuff from the driver.

On Thu, Mar 17, 2016 at 11:39 AM Zachary Turner  wrote:

> I can look at it today.  Sorry again for the delay, rebase 1 more time and
> I'll check it out today
>
> On Thu, Mar 17, 2016 at 11:34 AM Cameron  wrote:
>
>> cameron314 added a comment.
>>
>> @zturner: Let me know when you're ready for this patch and I'll rebase it
>> again, since there's been quite a few more commits.
>>
>>
>> http://reviews.llvm.org/D17107
>>
>>
>>
>>
___
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

2016-03-19 Thread Galina Kistanova via lldb-commits
Hello everyone,

LLVM buildmaster will be updated and restarted after 7 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] D18044: Fix a couple of cornercases in FileSpec + tests

2016-03-19 Thread Pavel Labath via lldb-commits
labath added inline comments.


Comment at: lldb/trunk/unittests/Host/FileSpecTest.cpp:25
@@ +24,3 @@
+EXPECT_STREQ("F:\\bar", fs_windows.GetCString());
+EXPECT_STREQ("F:", fs_windows.GetDirectory().GetCString());
+EXPECT_STREQ("bar", fs_windows.GetFilename().GetCString());

So this returns `F:` on linux and `F:\` on Windows. This happens because 
`llvm::sys::path::parent_path` does not recognize `F:` as a "root directory" on 
linux, and therefore treats it differently. I don't know which behavior is more 
"correct" (probably the windows one), but I think that this should be 
consistent, regardless of the platform the test is run on (my original 
motivation for writing this was the fact that i was getting wonky paths while 
attempting to write other unit tests). Unfortunately, I think that means 
getting rid of llvm's path processing library...

What do you make of that?

(I am going on holiday, so I cannot to anything about this now. if you want to 
have a clean test run in the mean time, I am fine commenting these checks out 
or something...)


Repository:
  rL LLVM

http://reviews.llvm.org/D18044



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


Re: [Lldb-commits] [PATCH] D17970: Implement ObjectFilePECOFF::GetEntryPointAddress.

2016-03-19 Thread Stephane Sezer via lldb-commits
sas updated this revision to Diff 50978.
sas added a comment.

Change implementation according to @clayborg's comments.


http://reviews.llvm.org/D17970

Files:
  source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
  source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h

Index: source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h
===
--- source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h
+++ source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h
@@ -144,8 +144,8 @@
 uint32_t
 GetDependentModules(lldb_private::FileSpecList& files) override;
 
-//virtual lldb_private::Address
-//GetEntryPointAddress ();
+virtual lldb_private::Address
+GetEntryPointAddress () override;
 
 ObjectFile::Type
 CalculateType() override;
@@ -301,6 +301,7 @@
coff_opt_header_t   m_coff_header_opt;
SectionHeaderColl   m_sect_headers;
 lldb::addr_t   m_image_base;
+lldb_private::Address  m_entry_point_address;
 };
 
 #endif // liblldb_ObjectFilePECOFF_h_
Index: source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
===
--- source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
+++ source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
@@ -192,7 +192,8 @@
 m_dos_header (),
 m_coff_header (),
 m_coff_header_opt (),
-m_sect_headers ()
+m_sect_headers (),
+m_entry_point_address ()
 {
 ::memset (&m_dos_header, 0, sizeof(m_dos_header));
 ::memset (&m_coff_header, 0, sizeof(m_coff_header));
@@ -814,6 +815,25 @@
 return 0;
 }
 
+lldb_private::Address
+ObjectFilePECOFF::GetEntryPointAddress ()
+{
+if (m_entry_point_address.IsValid())
+return m_entry_point_address;
+
+if (!ParseHeader() || !IsExecutable())
+return m_entry_point_address;
+
+SectionList *section_list = GetSectionList();
+addr_t offset = m_coff_header_opt.entry;
+
+if (!section_list)
+m_entry_point_address.SetOffset(offset);
+else
+m_entry_point_address.ResolveAddressUsingFileSections(offset, 
section_list);
+return m_entry_point_address;
+}
+
 
 //--
 // Dump


Index: source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h
===
--- source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h
+++ source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h
@@ -144,8 +144,8 @@
 uint32_t
 GetDependentModules(lldb_private::FileSpecList& files) override;
 
-//virtual lldb_private::Address
-//GetEntryPointAddress ();
+virtual lldb_private::Address
+GetEntryPointAddress () override;
 
 ObjectFile::Type
 CalculateType() override;
@@ -301,6 +301,7 @@
 	coff_opt_header_t	m_coff_header_opt;
 	SectionHeaderColl	m_sect_headers;
 lldb::addr_t		m_image_base;
+lldb_private::Address	m_entry_point_address;
 };
 
 #endif // liblldb_ObjectFilePECOFF_h_
Index: source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
===
--- source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
+++ source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
@@ -192,7 +192,8 @@
 m_dos_header (),
 m_coff_header (),
 m_coff_header_opt (),
-m_sect_headers ()
+m_sect_headers (),
+m_entry_point_address ()
 {
 ::memset (&m_dos_header, 0, sizeof(m_dos_header));
 ::memset (&m_coff_header, 0, sizeof(m_coff_header));
@@ -814,6 +815,25 @@
 return 0;
 }
 
+lldb_private::Address
+ObjectFilePECOFF::GetEntryPointAddress ()
+{
+if (m_entry_point_address.IsValid())
+return m_entry_point_address;
+
+if (!ParseHeader() || !IsExecutable())
+return m_entry_point_address;
+
+SectionList *section_list = GetSectionList();
+addr_t offset = m_coff_header_opt.entry;
+
+if (!section_list)
+m_entry_point_address.SetOffset(offset);
+else
+m_entry_point_address.ResolveAddressUsingFileSections(offset, section_list);
+return m_entry_point_address;
+}
+
 
 //--
 // Dump
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r263844 - Fix a build issue where the python module could become stale.

2016-03-19 Thread Zachary Turner via lldb-commits
Author: zturner
Date: Fri Mar 18 17:33:59 2016
New Revision: 263844

URL: http://llvm.org/viewvc/llvm-project?rev=263844&view=rev
Log:
Fix a build issue where the python module could become stale.

We are using hardlinks instead of symlinks, and we attempted to
have some logic where we don't re-create the link if the target
file already exists.  This logic is faulty, however, when you
manually delete the source file (e.g. liblldb.dll) and then rebuild
lldb so that a brand new liblldb.dll gets written.  Now the two files
have different inodes, but the target exists, so we would not remake
the link and the target would become stale.

We fix this by only doing the optimization if they are really the
exact same file (by comparing inode numbers), and if they are not
the same file but the target exists, we delete it and re-create
the link.

Modified:
lldb/trunk/scripts/Python/finishSwigPythonLLDB.py

Modified: lldb/trunk/scripts/Python/finishSwigPythonLLDB.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Python/finishSwigPythonLLDB.py?rev=263844&r1=263843&r2=263844&view=diff
==
--- lldb/trunk/scripts/Python/finishSwigPythonLLDB.py (original)
+++ lldb/trunk/scripts/Python/finishSwigPythonLLDB.py Fri Mar 18 17:33:59 2016
@@ -229,6 +229,23 @@ def make_symlink_windows(vstrSrcPath, vs
 dbg = utilsDebug.CDebugFnVerbose("Python script make_symlink_windows()")
 bOk = True
 strErrMsg = ""
+# If the src file doesn't exist, this is an error and we should throw.
+src_stat = os.stat(vstrSrcPath)
+
+try:
+target_stat = os.stat(vstrTargetPath)
+# If the target file exists but refers to a different file, delete it 
so that we can
+# re-create the link.  This can happen if you run this script once 
(creating a link)
+# and then delete the source file (so that a brand new file gets 
created the next time
+# you compile and link), and then re-run this script, so that both the 
target hardlink
+# and the source file exist, but the target refers to an old copy of 
the source.
+if (target_stat.st_ino == src_stat.st_ino) and (target_stat.st_dev == 
src_stat.st_dev):
+return (bOk, strErrMsg)
+
+os.remove(vstrTargetPath)
+except:
+# If the target file don't exist, ignore this exception, we will link 
it shortly.
+pass
 
 try:
 csl = ctypes.windll.kernel32.CreateHardLinkW
@@ -280,10 +297,6 @@ def make_symlink_native(vDictArgs, strSr
 bOk = False
 strErrMsg = strErrMsgOsTypeUnknown
 elif eOSType == utilsOsType.EnumOsType.Windows:
-if os.path.isfile(strTarget):
-if bDbg:
-print((strMsgSymlinkExists % target_filename))
-return (bOk, strErrMsg)
 if bDbg:
 print((strMsgSymlinkMk % (target_filename, strSrc, strTarget)))
 bOk, strErrMsg = make_symlink_windows(strSrc,


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


Re: [Lldb-commits] [PATCH] D17107: [lldb] Unicode support on Win32

2016-03-19 Thread Zachary Turner via lldb-commits
zturner added a comment.

Oh yea I think the reason I didn't look at it again is because I was
waiting for the update where you removed the codepage stuff from the driver.


http://reviews.llvm.org/D17107



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


Re: [Lldb-commits] [PATCH] D18228: Make File option flags consistent for Python API

2016-03-19 Thread Francis Ricci via lldb-commits
fjricci added a comment.

So this was definitely a decision that I was debating. But I assume that the 
Append flag must imply the Write flag, since you can't open a file for Append 
without also opening it for write ("a" and "a+" both include write privileges). 
So I figured that having both "Append" and "Write" was redundant. And since "a" 
was previously using "Append" while "a+" was previously using "Write", I think 
that one of them needed to be changed to be consistent with the other. I can do 
it the other way around though if that's preferable.


http://reviews.llvm.org/D18228



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


Re: [Lldb-commits] [PATCH] D17107: [lldb] Unicode support on Win32

2016-03-19 Thread Zachary Turner via lldb-commits
zturner added a comment.

I'm not sure what your source tree layout looks like, but this isn't applying 
for me.  All your paths have "trunk" in front of them, which is a little 
unusual in the directory structure is supposed to be something like this:

  llvm
tools
  lldb
source

And I would apply the patch inside of the `lldb` directory.  But yours appears 
to look like this:

  lldb
trunk
  source

So it doesn't apply.


http://reviews.llvm.org/D17107



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


Re: [Lldb-commits] [PATCH] D17107: [lldb] Unicode support on Win32

2016-03-19 Thread Cameron via lldb-commits
cameron314 added a comment.

Hmm, that doesn't seem good. Locally it links for me (I get compile time 
warnings about the signal stuff, though).
It looks like the WinSDK signal.h is being pulled in despite `_INC_SIGNAL` 
being defined (note that there's no include guard in that header -- it uses 
`#pragma once` instead). And the signal handler callback has a different return 
type. I don't see anything related to Unicode.

Here's the tail of my build output for lldb-mi.exe. I'm using VS2015 on Windows 
7 x64, compiling in release with ninja:

  [77/78] 13.653s Building CXX object 
tools\lldb\tools\lldb-mi\CMakeFiles\lldb-mi.dir\Platform.cpp.obj
  d:\dev\llvm\tools\lldb\tools\lldb-mi\Platform.h(84): warning C4005: 
'SIG_DFL': macro redefinition
  C:\Program Files (x86)\Windows 
Kits\10\include\10.0.10240.0\ucrt\signal.h(35): note: see previous definition 
of 'SIG_DFL'
  d:\dev\llvm\tools\lldb\tools\lldb-mi\Platform.h(85): warning C4005: 
'SIG_IGN': macro redefinition
  C:\Program Files (x86)\Windows 
Kits\10\include\10.0.10240.0\ucrt\signal.h(36): note: see previous definition 
of 'SIG_IGN'
  d:\dev\llvm\tools\lldb\tools\lldb-mi\Platform.h(87): warning C4273: 'signal': 
inconsistent dll linkage
  C:\Program Files (x86)\Windows 
Kits\10\include\10.0.10240.0\ucrt\signal.h(57): note: see previous definition 
of 'signal'
  
  [78/78] 14.332s Linking CXX executable bin\lldb-mi.exe
 Creating library lib\lldb-mi.lib and object lib\lldb-mi.exp


http://reviews.llvm.org/D17107



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


Re: [Lldb-commits] [PATCH] D17107: [lldb] Unicode support on Win32

2016-03-19 Thread Zachary Turner via lldb-commits
I'm using the amd64_x86 toolchain. They're supposed to be identical so
that's unlikely to be the problem, but it's the only difference i can see.
Let me know what happens on your clean rebuild
On Fri, Mar 18, 2016 at 7:56 AM Cameron  wrote:

> cameron314 added a comment.
>
> Since it works without my patch, you're probably right about it being
> related to the UNICODE define. All the other changes are completely removed
> from that part of the code. But I still don't see how it could affect that.
>
> Here's the script I use to run cmake:
>
>   setlocal
>   set
> PATH=%ProgramFiles%\Ninja;%ProgramFiles(x86)%\CMake\bin;%SYSTEMROOT%\system32;%SYSTEMROOT%;%SWIGDIR%
>   call "%VS140COMNTOOLS%\vsvars32.bat"
>   mkdir VS2015Debug
>   cd VS2015Debug
>   cmake -G "Ninja" -DLLVM_BUILD_EXAMPLES:BOOL=false
> -DPYTHON_HOME="C:\Python35" -DLLDB_DISABLE_PYTHON:BOOL=false
> -DLLDB_TEST_COMPILER=%cd%\bin\clang.exe -DCMAKE_BUILD_TYPE=Debug ..
>   cd ..
>   mkdir VS2015Release
>   cd VS2015Release
>   cmake -G "Ninja" -DLLVM_BUILD_EXAMPLES:BOOL=false
> -DPYTHON_HOME="C:\Python35" -DLLDB_DISABLE_PYTHON:BOOL=false
> -DLLDB_TEST_COMPILER=%cd%\bin\clang.exe -DCMAKE_BUILD_TYPE=Release ..
>   cd ..
>   endlocal
>
> This is with VS2015 update 1. And it's already the x86 version, the patch
> has diverged significantly from what we have locally (which is based on a
> snapshot from several weeks ago) so I've been using the tip as-is :-)
>
> I'm trying a fresh Debug build from scratch (deleting and re-creating the
> cmake build folder). I'll report back when it's done.
>
>
> http://reviews.llvm.org/D17107
>
>
>
>
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D18044: Fix a couple of cornercases in FileSpec + tests

2016-03-19 Thread Zachary Turner via lldb-commits
Yea, because of the fact that we must support both syntaxes on both
platforms, LLVM library is out.

The whole motivation for introducing the path syntax is so that windows
paths behave as if on Windows even if on linux
On Wed, Mar 16, 2016 at 6:19 AM Pavel Labath  wrote:

> labath added inline comments.
>
> 
> Comment at: lldb/trunk/unittests/Host/FileSpecTest.cpp:25
> @@ +24,3 @@
> +EXPECT_STREQ("F:\\bar", fs_windows.GetCString());
> +EXPECT_STREQ("F:", fs_windows.GetDirectory().GetCString());
> +EXPECT_STREQ("bar", fs_windows.GetFilename().GetCString());
> 
> So this returns `F:` on linux and `F:\` on Windows. This happens because
> `llvm::sys::path::parent_path` does not recognize `F:` as a "root
> directory" on linux, and therefore treats it differently. I don't know
> which behavior is more "correct" (probably the windows one), but I think
> that this should be consistent, regardless of the platform the test is run
> on (my original motivation for writing this was the fact that i was getting
> wonky paths while attempting to write other unit tests). Unfortunately, I
> think that means getting rid of llvm's path processing library...
>
> What do you make of that?
>
> (I am going on holiday, so I cannot to anything about this now. if you
> want to have a clean test run in the mean time, I am fine commenting these
> checks out or something...)
>
>
> Repository:
>   rL LLVM
>
> http://reviews.llvm.org/D18044
>
>
>
>
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D18228: Make File option flags consistent for Python API

2016-03-19 Thread Greg Clayton via lldb-commits
clayborg added a comment.

Just to be clear in the code we should set the write flag and not make any 
assumptions. So then the first diff isn't needed and only PythonDataObjects.cpp 
needs to change.


http://reviews.llvm.org/D18228



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


Re: [Lldb-commits] [PATCH] D18059: Add IR fixups for RenderScript ABI mismatch between ARMV7 frontend and x86 backend

2016-03-19 Thread Greg Clayton via lldb-commits
clayborg resigned from this revision.
clayborg edited reviewers, added: spyffe; removed: clayborg.
clayborg added a comment.

Sean Callanan would have more expertise in this area.

1. List Item


http://reviews.llvm.org/D18059



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


Re: [Lldb-commits] [PATCH] D17107: [lldb] Unicode support on Win32

2016-03-19 Thread Zachary Turner via lldb-commits
I can look at it today.  Sorry again for the delay, rebase 1 more time and
I'll check it out today

On Thu, Mar 17, 2016 at 11:34 AM Cameron  wrote:

> cameron314 added a comment.
>
> @zturner: Let me know when you're ready for this patch and I'll rebase it
> again, since there's been quite a few more commits.
>
>
> http://reviews.llvm.org/D17107
>
>
>
>
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r263826 - Fixed an case fall through that wasn't meant to happen. Caught by clang's unannotated case fall through warning.

2016-03-19 Thread Greg Clayton via lldb-commits
Author: gclayton
Date: Fri Mar 18 15:36:30 2016
New Revision: 263826

URL: http://llvm.org/viewvc/llvm-project?rev=263826&view=rev
Log:
Fixed an case fall through that wasn't meant to happen. Caught by clang's 
unannotated case fall through warning.

Modified:
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserJava.cpp

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserJava.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserJava.cpp?rev=263826&r1=263825&r2=263826&view=diff
==
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserJava.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserJava.cpp Fri Mar 
18 15:36:30 2016
@@ -435,15 +435,16 @@ DWARFASTParserJava::CompleteTypeFromDWAR
 switch (die.Tag())
 {
 case DW_TAG_class_type:
-{
-if (die.GetAttributeValueAsUnsigned(DW_AT_declaration, 0) == 0)
 {
-if (die.HasChildren())
-ParseChildMembers(die, java_type);
-m_ast.CompleteObjectType(java_type);
-return java_type.IsValid();
+if (die.GetAttributeValueAsUnsigned(DW_AT_declaration, 0) == 0)
+{
+if (die.HasChildren())
+ParseChildMembers(die, java_type);
+m_ast.CompleteObjectType(java_type);
+return java_type.IsValid();
+}
 }
-}
+break;
 default:
 assert(false && "Not a forward java type declaration!");
 break;


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


[Lldb-commits] [lldb] r263637 - Fix null pointer "dereference" in DomainSocket

2016-03-19 Thread Pavel Labath via lldb-commits
Author: labath
Date: Wed Mar 16 09:03:20 2016
New Revision: 263637

URL: http://llvm.org/viewvc/llvm-project?rev=263637&view=rev
Log:
Fix null pointer "dereference" in DomainSocket

offsetof is the official way to get the offset of a field in a structure.

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

Modified: lldb/trunk/source/Host/posix/DomainSocket.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/posix/DomainSocket.cpp?rev=263637&r1=263636&r2=263637&view=diff
==
--- lldb/trunk/source/Host/posix/DomainSocket.cpp (original)
+++ lldb/trunk/source/Host/posix/DomainSocket.cpp Wed Mar 16 09:03:20 2016
@@ -21,7 +21,7 @@ using namespace lldb_private;
 #ifdef __ANDROID__
 // Android does not have SUN_LEN
 #ifndef SUN_LEN
-#define SUN_LEN(ptr) ((size_t) (((struct sockaddr_un *) 0)->sun_path) + 
strlen((ptr)->sun_path))
+#define SUN_LEN(ptr) (offsetof(struct sockaddr_un, sun_path) + 
strlen((ptr)->sun_path))
 #endif
 #endif // #ifdef __ANDROID__
 


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


[Lldb-commits] [lldb] r263735 - Fix deadlock due to thread list locking in 'bt all' with obj-c

2016-03-19 Thread Stephane Sezer via lldb-commits
Author: sas
Date: Thu Mar 17 13:52:41 2016
New Revision: 263735

URL: http://llvm.org/viewvc/llvm-project?rev=263735&view=rev
Log:
Fix deadlock due to thread list locking in 'bt all' with obj-c

Summary:
The gdb-remote async thread cannot modify thread state while the main thread
holds a lock on the state. Don't use locking thread iteration for bt all.

Specifically, the deadlock manifests when lldb attempts to JIT code to
symbolicate objective c while backtracing. As part of this code path,
SetPrivateState() is called on an async thread. This async thread will
block waiting for the thread_list lock held by the main thread in
CommandObjectIterateOverThreads. The main thread will also block on the
async thread during DoResume (although with a timeout), leading to a
deadlock. Due to the timeout, the deadlock is not immediately apparent,
but the inferior will be left in an invalid state after the bt all completes,
and objective-c symbols will not be successfully resolved in the backtrace.

Reviewers: andrew.w.kaylor, jingham, clayborg

Subscribers: sas, lldb-commits

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

Change by Francis Ricci 

Modified:
lldb/trunk/source/Commands/CommandObjectThread.cpp

Modified: lldb/trunk/source/Commands/CommandObjectThread.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectThread.cpp?rev=263735&r1=263734&r2=263735&view=diff
==
--- lldb/trunk/source/Commands/CommandObjectThread.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectThread.cpp Thu Mar 17 13:52:41 2016
@@ -66,34 +66,33 @@ public:
 if (command.GetArgumentCount() == 0)
 {
 Thread *thread = m_exe_ctx.GetThreadPtr();
-if (!HandleOneThread (*thread, result))
+if (!HandleOneThread (thread->GetID(), result))
 return false;
+return result.Succeeded();
 }
-else if (command.GetArgumentCount() == 1 && ::strcmp 
(command.GetArgumentAtIndex(0), "all") == 0)
+
+// Use tids instead of ThreadSPs to prevent deadlocking problems which 
result from JIT-ing
+// code while iterating over the (locked) ThreadSP list.
+std::vector tids;
+
+if (command.GetArgumentCount() == 1 && ::strcmp 
(command.GetArgumentAtIndex(0), "all") == 0)
 {
 Process *process = m_exe_ctx.GetProcessPtr();
-uint32_t idx = 0;
-for (ThreadSP thread_sp : process->Threads())
-{
-if (idx != 0 && m_add_return)
-result.AppendMessage("");
 
-if (!HandleOneThread(*(thread_sp.get()), result))
-return false;
-++idx;
-}
+for (ThreadSP thread_sp : process->Threads())
+tids.push_back(thread_sp->GetID());
 }
 else
 {
 const size_t num_args = command.GetArgumentCount();
 Process *process = m_exe_ctx.GetProcessPtr();
+
 Mutex::Locker locker (process->GetThreadList().GetMutex());
-std::vector thread_sps;
 
 for (size_t i = 0; i < num_args; i++)
 {
 bool success;
-
+
 uint32_t thread_idx = 
StringConvert::ToUInt32(command.GetArgumentAtIndex(i), 0, 0, &success);
 if (!success)
 {
@@ -101,26 +100,31 @@ public:
 result.SetStatus (eReturnStatusFailed);
 return false;
 }
-
-
thread_sps.push_back(process->GetThreadList().FindThreadByIndexID(thread_idx));
-
-if (!thread_sps[i])
+
+ThreadSP thread = 
process->GetThreadList().FindThreadByIndexID(thread_idx);
+
+if (!thread)
 {
 result.AppendErrorWithFormat ("no thread with index: 
\"%s\"\n", command.GetArgumentAtIndex(i));
 result.SetStatus (eReturnStatusFailed);
 return false;
 }
-}
-
-for (uint32_t i = 0; i < num_args; i++)
-{
-if (!HandleOneThread (*(thread_sps[i].get()), result))
-return false;
 
-if (i < num_args - 1 && m_add_return)
-result.AppendMessage("");
+tids.push_back(thread->GetID());
 }
 }
+
+uint32_t idx = 0;
+for (const lldb::tid_t &tid : tids)
+{
+if (idx != 0 && m_add_return)
+result.AppendMessage("");
+
+if (!HandleOneThread (tid, result))
+return false;
+
+++idx;
+}
 return result.Succeeded();
 }
 
@@ -133,7 +137,7 @@ protected:
 // If m_add_return is true, a blank line will be inserted between each of 
the li

Re: [Lldb-commits] [PATCH] D18228: Make File option flags consistent for Python API

2016-03-19 Thread Francis Ricci via lldb-commits
fjricci added a comment.

I want to add this testing to 
functionalities/command_script_immediate_output/TestCommandScriptImmediateOutput.py,
 since that test is already very basic coverage of the same functionality.

However, it appears that TestCommandScriptImmediateOutput is an expected fail 
on FreeBSD, Linux, and Windows. And when I run it on the master branch on OSX, 
fails as ERROR. So it might be that the test doesn't actually pass on any 
platform.

When I run locally on Linux, the test succeeds, so I extended the test and made 
sure it passes Linux locally. But I'm not sure how useful that is, since the 
test is currently disabled on Linux.

I'll upload the test I wrote and we can go from there.


http://reviews.llvm.org/D18228



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


Re: [Lldb-commits] [PATCH] D18228: Make File option flags consistent for Python API

2016-03-19 Thread Francis Ricci via lldb-commits
fjricci updated this revision to Diff 51113.
fjricci added a comment.

Added unit test for python file api


http://reviews.llvm.org/D18228

Files:
  
packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/TestCommandScriptImmediateOutput.py
  
packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/custom_command.py
  source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp

Index: source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
===
--- source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
+++ source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
@@ -1252,10 +1252,10 @@
 return llvm::StringSwitch(mode.str().c_str())
 .Case("r",   File::eOpenOptionRead)
 .Case("w",   File::eOpenOptionWrite)
-.Case("a",   File::eOpenOptionAppend|File::eOpenOptionCanCreate)
+.Case("a",   
File::eOpenOptionWrite|File::eOpenOptionAppend|File::eOpenOptionCanCreate)
 .Case("r+",  File::eOpenOptionRead|File::eOpenOptionWrite)
 .Case("w+",  
File::eOpenOptionRead|File::eOpenOptionWrite|File::eOpenOptionCanCreate|File::eOpenOptionTruncate)
-.Case("a+",  
File::eOpenOptionRead|File::eOpenOptionWrite|File::eOpenOptionCanCreate)
+.Case("a+",  
File::eOpenOptionRead|File::eOpenOptionWrite|File::eOpenOptionAppend|File::eOpenOptionCanCreate)
 .Default(0);
 }
 
Index: 
packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/custom_command.py
===
--- 
packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/custom_command.py
+++ 
packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/custom_command.py
@@ -6,3 +6,12 @@
 result.SetImmediateOutputFile(sys.__stdout__)
 print('this is a test string, just a test string', file=result)
 
+def write_file(debugger, command, exe_ctx, result, internal_dict):
+args = command.split(' ')
+path = args[0]
+mode = args[1]
+
+with open(path, mode) as f:
+result.SetImmediateOutputFile(f)
+if not mode in ['r']:
+print('writing to file with mode: ' + mode, file=result)
Index: 
packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/TestCommandScriptImmediateOutput.py
===
--- 
packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/TestCommandScriptImmediateOutput.py
+++ 
packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/TestCommandScriptImmediateOutput.py
@@ -26,13 +26,47 @@
 @expectedFailureAll(oslist=["freebsd","linux"], 
bugnumber="llvm.org/pr26139")
 def test_command_script_immediate_output (self):
 """Test that LLDB correctly allows scripted commands to set an 
immediate output file."""
-self.launch(timeout=5)
+self.launch(timeout=60)
 
 script = os.path.join(os.getcwd(), 'custom_command.py')
 prompt = "(lldb)"
 
 self.sendline('command script import %s' % script, patterns=[prompt])
 self.sendline('command script add -f custom_command.command_function 
mycommand', patterns=[prompt])
 self.sendline('mycommand', patterns='this is a test string, just a 
test string')
 self.sendline('command script delete mycommand', patterns=[prompt])
+
+test_files = {os.path.join(os.getcwd(), 'read.txt'):'r',
+  os.path.join(os.getcwd(), 'write.txt')   :'w',
+  os.path.join(os.getcwd(), 'append.txt')  :'a',
+  os.path.join(os.getcwd(), 'write_plus.txt')  :'w+',
+  os.path.join(os.getcwd(), 'read_plus.txt')   :'r+',
+  os.path.join(os.getcwd(), 'append_plus.txt') :'a+'}
+
+starter_string = 'Starter Garbage\n'
+write_string   = 'writing to file with mode: '
+
+for path, mode in test_files.iteritems():
+with open(path, 'w+') as init:
+init.write(starter_string)
+
+self.sendline('command script add -f custom_command.write_file 
mywrite', patterns=[prompt])
+for path, mode in test_files.iteritems():
+command = 'mywrite ' + path + ' ' + mode
+
+self.sendline(command, patterns=[prompt])
+
+self.sendline('command script delete mywrite', patterns=[prompt])
+
 self.quit(gracefully=False)
+
+for path, mode in test_files.iteritems():
+with open(path, 'r') as result:
+if mode in ['r', 'a', 'a+']:
+self.assertEquals(result.readline(), starter_string)
+if mode in ['w', 'w+', 'r+', 'a', 'a+']:
+self.assertEquals(result.readline(), write_string + mode + 
'\n')
+
+self.assertTrue(os.path.isf

Re: [Lldb-commits] [PATCH] D17107: [lldb] Unicode support on Win32

2016-03-19 Thread Zachary Turner via lldb-commits
zturner added a comment.

I'm using the amd64_x86 toolchain. They're supposed to be identical so
that's unlikely to be the problem, but it's the only difference i can see.
Let me know what happens on your clean rebuild


http://reviews.llvm.org/D17107



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


Re: [Lldb-commits] [PATCH] D17107: [lldb] Unicode support on Win32

2016-03-19 Thread Cameron via lldb-commits
cameron314 added a comment.

Since it works without my patch, you're probably right about it being related 
to the UNICODE define. All the other changes are completely removed from that 
part of the code. But I still don't see how it could affect that.

Here's the script I use to run cmake:

  setlocal 
  set 
PATH=%ProgramFiles%\Ninja;%ProgramFiles(x86)%\CMake\bin;%SYSTEMROOT%\system32;%SYSTEMROOT%;%SWIGDIR%
 
  call "%VS140COMNTOOLS%\vsvars32.bat" 
  mkdir VS2015Debug 
  cd VS2015Debug 
  cmake -G "Ninja" -DLLVM_BUILD_EXAMPLES:BOOL=false -DPYTHON_HOME="C:\Python35" 
-DLLDB_DISABLE_PYTHON:BOOL=false -DLLDB_TEST_COMPILER=%cd%\bin\clang.exe 
-DCMAKE_BUILD_TYPE=Debug .. 
  cd .. 
  mkdir VS2015Release 
  cd VS2015Release 
  cmake -G "Ninja" -DLLVM_BUILD_EXAMPLES:BOOL=false -DPYTHON_HOME="C:\Python35" 
-DLLDB_DISABLE_PYTHON:BOOL=false -DLLDB_TEST_COMPILER=%cd%\bin\clang.exe 
-DCMAKE_BUILD_TYPE=Release .. 
  cd .. 
  endlocal

This is with VS2015 update 1. And it's already the x86 version, the patch has 
diverged significantly from what we have locally (which is based on a snapshot 
from several weeks ago) so I've been using the tip as-is :-)

I'm trying a fresh Debug build from scratch (deleting and re-creating the cmake 
build folder). I'll report back when it's done.


http://reviews.llvm.org/D17107



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


Re: [Lldb-commits] [PATCH] D17635: Continue after process exit

2016-03-19 Thread Petr Hons via lldb-commits
Honsik added a comment.

Yes please, with that comment change jingham has mentioned.

Do you want me to create new diff?


http://reviews.llvm.org/D17635



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


Re: [Lldb-commits] [PATCH] D18228: Make File option flags consistent for Python API

2016-03-19 Thread Francis Ricci via lldb-commits
fjricci updated this revision to Diff 51005.
fjricci added a comment.

Always use write flag, even in append mode


http://reviews.llvm.org/D18228

Files:
  source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp

Index: source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
===
--- source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
+++ source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
@@ -1252,10 +1252,10 @@
 return llvm::StringSwitch(mode.str().c_str())
 .Case("r",   File::eOpenOptionRead)
 .Case("w",   File::eOpenOptionWrite)
-.Case("a",   File::eOpenOptionAppend|File::eOpenOptionCanCreate)
+.Case("a",   
File::eOpenOptionWrite|File::eOpenOptionAppend|File::eOpenOptionCanCreate)
 .Case("r+",  File::eOpenOptionRead|File::eOpenOptionWrite)
 .Case("w+",  
File::eOpenOptionRead|File::eOpenOptionWrite|File::eOpenOptionCanCreate|File::eOpenOptionTruncate)
-.Case("a+",  
File::eOpenOptionRead|File::eOpenOptionWrite|File::eOpenOptionCanCreate)
+.Case("a+",  
File::eOpenOptionRead|File::eOpenOptionWrite|File::eOpenOptionAppend|File::eOpenOptionCanCreate)
 .Default(0);
 }
 


Index: source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
===
--- source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
+++ source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
@@ -1252,10 +1252,10 @@
 return llvm::StringSwitch(mode.str().c_str())
 .Case("r",   File::eOpenOptionRead)
 .Case("w",   File::eOpenOptionWrite)
-.Case("a",   File::eOpenOptionAppend|File::eOpenOptionCanCreate)
+.Case("a",   File::eOpenOptionWrite|File::eOpenOptionAppend|File::eOpenOptionCanCreate)
 .Case("r+",  File::eOpenOptionRead|File::eOpenOptionWrite)
 .Case("w+",  File::eOpenOptionRead|File::eOpenOptionWrite|File::eOpenOptionCanCreate|File::eOpenOptionTruncate)
-.Case("a+",  File::eOpenOptionRead|File::eOpenOptionWrite|File::eOpenOptionCanCreate)
+.Case("a+",  File::eOpenOptionRead|File::eOpenOptionWrite|File::eOpenOptionAppend|File::eOpenOptionCanCreate)
 .Default(0);
 }
 
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D18287: Don't try to redefine the signal() function on Windows

2016-03-19 Thread Cameron via lldb-commits
cameron314 added inline comments.


Comment at: tools/driver/Driver.cpp:1314
@@ -1313,1 +1313,3 @@
+signal(SIGINT, sigint_handler);
+#ifndef _MSC_VER
 signal (SIGPIPE, SIG_IGN);

zturner wrote:
> I think `_MSC_VER` is the right check, because the builtin `signal` 
> implementation is something that is part of Visual Studio.  If you were using 
> Cygwin I imagine some of those constants might be present (although tbh, I 
> don't ever use Cygwin and I don't know if anyone else does either, so someone 
> would need to confirm).
> 
> `_MSC_VER` is also defined for clang-cl, so this check would catch MSVC and 
> clang-cl
I was thinking more of mingw-w64, which tries very hard to have a compatible 
set of headers as those defined in the Windows SDK (and does not define 
`_MSC_VER`). But many, many other places in LLDB already check `_MSC_VER` 
anyway.


Comment at: tools/driver/Platform.cpp:93-97
@@ -92,7 @@
-{
-case ( SIGINT ):
-{
-_ctrlHandler = sigFunc;
-SetConsoleCtrlHandler( CtrlHandler, TRUE );
-}
-break;

zturner wrote:
> Yes, because now `MIDriverMain.cpp` should end up calling the builtin version 
> of `signal()`, which also calls `SetConsoleCtrlHandler`.  As far as I can 
> tell there's no actual difference (technically, the builtin version is a 
> strict superset of this version, so if anything it should be better)
Great!


Comment at: tools/driver/Platform.h:40
@@ -39,14 +39,3 @@
 
-
-// signal handler function pointer type
-typedef void(*sighandler_t)(int);
-
-// signal.h
-#define SIGINT 2
-// default handler
-#define SIG_DFL ( (sighandler_t) -1 )
-// ignored
-#define SIG_IGN ( (sighandler_t) -2 )
-
 // signal.h
 #define SIGPIPE  13

amccarth wrote:
> Now that we are including , won't the following defines create 
> duplicate definition warnings for the non-Windows platforms?
It's only included on Windows, though -- unless some other TU includes both 
this header and `signal.h`?


http://reviews.llvm.org/D18287



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


Re: [Lldb-commits] [PATCH] D17107: [lldb] Unicode support on Win32

2016-03-19 Thread Zachary Turner via lldb-commits
zturner added a comment.

I'm getting this when linking:

  [826/826] Linking CXX executable bin\lldb.exe
  FAILED: cmd.exe /C "cd . && "C:\Program Files (x86)\CMake\bin\cmake.exe" -E 
vs_link_exe --intdir=tools\lldb\tools\driver\CMakeFiles\lldb.dir --manifests  
-- C:\PROGRA~2\MICROS~3.0\VC\bin\AMD64_~2\link.exe /nologo @CMakeFiles/lldb.rsp 
 /out:bin\lldb.exe /implib:lib\lldb.lib /pdb:bin\lldb.pdb /version:3.9  
/machine:X86 /STACK:1000 /debug /INCREMENTAL /subsystem:console  && cd ."
  ucrtd.lib(ucrtbased.dll) : error LNK2005: _signal already defined in 
Platform.cpp.obj
 Creating library lib\lldb.lib and object lib\lldb.exp
  bin\lldb.exe : fatal error LNK1169: one or more multiply defined symbols found
  LINK Pass 1 failed. with 1169
  [826/826] Linking CXX executable bin\lldb-mi.exe
  FAILED: cmd.exe /C "cd . && "C:\Program Files (x86)\CMake\bin\cmake.exe" -E 
vs_link_exe --intdir=tools\lldb\tools\lldb-mi\CMakeFiles\lldb-mi.dir 
--manifests  -- C:\PROGRA~2\MICROS~3.0\VC\bin\AMD64_~2\link.exe /nologo 
@CMakeFiles/lldb-mi.rsp  /out:bin\lldb-mi.exe /implib:lib\lldb-mi.lib 
/pdb:bin\lldb-mi.pdb /version:3.9  /machine:X86 /STACK:1000 /debug 
/INCREMENTAL /subsystem:console  && cd ."
  ucrtd.lib(ucrtbased.dll) : error LNK2005: _signal already defined in 
Platform.cpp.obj
 Creating library lib\lldb-mi.lib and object lib\lldb-mi.exp
  bin\lldb-mi.exe : fatal error LNK1169: one or more multiply defined symbols 
found
  LINK Pass 1 failed. with 1169
  ninja: build stopped: subcommand failed.

I assume it must be related to the fact that we're now defining `UNICODE` and 
`_UNICODE`, but I need to run and don't have enough time to figure out why.

I've always disliked the fact that we redefine the `signal` function which is 
already builtin in Windows anyway.  I actually feel like we need to introduce 
the function `sighandler_t Host::Signal(int sig, sighandler_t sigFunc)`, and on 
non-windows have this function call `signal`, and on Windows use our own custom 
implementation.

Let me know if you have any better ideas.


http://reviews.llvm.org/D17107



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


Re: [Lldb-commits] [PATCH] D17107: [lldb] Unicode support on Win32

2016-03-19 Thread Cameron via lldb-commits
cameron314 updated this revision to Diff 50979.

http://reviews.llvm.org/D17107

Files:
  cmake/modules/LLDBConfig.cmake
  include/lldb/Host/FileSystem.h
  include/lldb/Host/posix/HostInfoPosix.h
  include/lldb/Host/windows/HostInfoWindows.h
  packages/Python/lldbsuite/test/dotest.py
  source/Commands/CommandCompletions.cpp
  source/Core/ConnectionSharedMemory.cpp
  source/Core/Disassembler.cpp
  source/Host/common/File.cpp
  source/Host/common/FileSpec.cpp
  source/Host/posix/FileSystem.cpp
  source/Host/posix/HostInfoPosix.cpp
  source/Host/windows/ConnectionGenericFileWindows.cpp
  source/Host/windows/FileSystem.cpp
  source/Host/windows/Host.cpp
  source/Host/windows/HostInfoWindows.cpp
  source/Host/windows/HostProcessWindows.cpp
  source/Host/windows/PipeWindows.cpp
  source/Host/windows/ProcessLauncherWindows.cpp
  source/Host/windows/Windows.cpp
  source/Plugins/Process/Windows/Live/DebuggerThread.cpp
  source/Plugins/Process/Windows/Live/ProcessWindowsLive.cpp
  source/Plugins/Process/Windows/MiniDump/ProcessWinMiniDump.cpp
  source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
  source/Target/ProcessLaunchInfo.cpp
  tools/driver/Driver.cpp
  tools/driver/Platform.h
  tools/lldb-mi/MICmnLLDBDebugSessionInfo.cpp
  tools/lldb-mi/MIUtilFileStd.cpp
  tools/lldb-mi/Platform.h

Index: tools/lldb-mi/Platform.h
===
--- tools/lldb-mi/Platform.h
+++ tools/lldb-mi/Platform.h
@@ -60,7 +60,7 @@
 typedef long pid_t;
 
 #define STDIN_FILENO 0
-#define PATH_MAX MAX_PATH
+#define PATH_MAX 32768
 #define snprintf _snprintf
 
 extern int ioctl(int d, int request, ...);
Index: tools/lldb-mi/MIUtilFileStd.cpp
===
--- tools/lldb-mi/MIUtilFileStd.cpp
+++ tools/lldb-mi/MIUtilFileStd.cpp
@@ -17,6 +17,8 @@
 #include "MIUtilFileStd.h"
 #include "MICmnResources.h"
 
+#include "llvm/Support/ConvertUTF.h"
+
 //++ 
 // Details: CMIUtilFileStd constructor.
 // Type:Method.
@@ -82,7 +84,14 @@
 m_pFileHandle = ::fopen(vFileNamePath.c_str(), "wb");
 #else
 // Open a file with exclusive write and shared read permissions
-m_pFileHandle = ::_fsopen(vFileNamePath.c_str(), "wb", _SH_DENYWR);
+std::wstring path;
+if (llvm::ConvertUTF8toWide(vFileNamePath.c_str(), path))
+m_pFileHandle = ::_wfsopen(path.c_str(), L"wb", _SH_DENYWR);
+else
+{
+errno = EINVAL;
+m_pFileHandle = nullptr;
+}
 #endif // !defined( _MSC_VER )
 
 if (m_pFileHandle == nullptr)
@@ -222,7 +231,14 @@
 return false;
 
 FILE *pTmp = nullptr;
+#ifdef _WIN32
+std::wstring path;
+if (!llvm::ConvertUTF8toWide(vFileNamePath.c_str(), path))
+return false;
+pTmp = ::_wfopen(path.c_str(), L"wb");
+#else
 pTmp = ::fopen(vFileNamePath.c_str(), "wb");
+#endif
 if (pTmp != nullptr)
 {
 ::fclose(pTmp);
Index: tools/lldb-mi/MICmnLLDBDebugSessionInfo.cpp
===
--- tools/lldb-mi/MICmnLLDBDebugSessionInfo.cpp
+++ tools/lldb-mi/MICmnLLDBDebugSessionInfo.cpp
@@ -27,6 +27,7 @@
 #include "MICmnMIValueTuple.h"
 #include "MICmdData.h"
 #include "MICmnLLDBUtilSBValue.h"
+#include "Platform.h"
 
 //++ 
 // Details: CMICmnLLDBDebugSessionInfo constructor.
@@ -614,7 +615,7 @@
 {
 lldb::SBFrame &rFrame = const_cast(vrFrame);
 
-static char pBuffer[MAX_PATH];
+static char pBuffer[PATH_MAX];
 const MIuint nBytes = rFrame.GetLineEntry().GetFileSpec().GetPath(&pBuffer[0], sizeof(pBuffer));
 MIunused(nBytes);
 CMIUtilString strResolvedPath(&pBuffer[0]);
Index: tools/driver/Platform.h
===
--- tools/driver/Platform.h
+++ tools/driver/Platform.h
@@ -81,7 +81,7 @@
 typedef long pid_t;
 #define snprintf _snprintf
 extern sighandler_t signal( int sig, sighandler_t );
-#define PATH_MAX MAX_PATH
+#define PATH_MAX 32768
 #endif
 
 #define STDIN_FILENO 0
Index: tools/driver/Driver.cpp
===
--- tools/driver/Driver.cpp
+++ tools/driver/Driver.cpp
@@ -42,6 +42,7 @@
 #include "lldb/API/SBTarget.h"
 #include "lldb/API/SBThread.h"
 #include "lldb/API/SBProcess.h"
+#include "llvm/Support/ConvertUTF.h"
 
 #if !defined(__APPLE__)
 #include "llvm/Support/DataTypes.h"
@@ -1298,14 +1299,30 @@
 }
 
 int
-main (int argc, char const *argv[], const char *envp[])
+#ifdef WIN32
+wmain(int argc, wchar_t const *wargv[])
+#else
+main (int argc, char const *argv[])
+#endif
 {
 #ifdef _MSC_VER
 	// disable buffering on windows
 	setvbuf(stdout, NULL, _IONBF, 0);
 	setvbuf(stdin , NULL, _IONBF, 0);
 #endif
 
+#ifdef _WIN32
+// Convert wide arguments to UTF-8
+std::vector argvStrings(

[Lldb-commits] [PATCH] D18228: Make File option flags consistent for Python API

2016-03-19 Thread Francis Ricci via lldb-commits
fjricci created this revision.
fjricci added reviewers: clayborg, granata.enrico, Eugene.Zelenko, jingham.
fjricci added subscribers: sas, lldb-commits.

Fixes SBCommandReturnObject::SetImmediateOutputFile() and
SBCommandReturnObject::SetImmediateOutputFile() for files opened
with "a" or "a+" by resolving inconsistencies between File and
our Python parsing of file objects.

http://reviews.llvm.org/D18228

Files:
  source/Host/common/File.cpp
  source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp

Index: source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
===
--- source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
+++ source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
@@ -1255,7 +1255,7 @@
 .Case("a",   File::eOpenOptionAppend|File::eOpenOptionCanCreate)
 .Case("r+",  File::eOpenOptionRead|File::eOpenOptionWrite)
 .Case("w+",  
File::eOpenOptionRead|File::eOpenOptionWrite|File::eOpenOptionCanCreate|File::eOpenOptionTruncate)
-.Case("a+",  
File::eOpenOptionRead|File::eOpenOptionWrite|File::eOpenOptionCanCreate)
+.Case("a+",  
File::eOpenOptionAppend|File::eOpenOptionRead|File::eOpenOptionCanCreate)
 .Default(0);
 }
 
Index: source/Host/common/File.cpp
===
--- source/Host/common/File.cpp
+++ source/Host/common/File.cpp
@@ -45,7 +45,7 @@
 else
 return "a+";
 }
-else if (options & File::eOpenOptionWrite)
+else
 {
 if (options & File::eOpenOptionCanCreateNewOnly)
 return "ax";


Index: source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
===
--- source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
+++ source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
@@ -1255,7 +1255,7 @@
 .Case("a",   File::eOpenOptionAppend|File::eOpenOptionCanCreate)
 .Case("r+",  File::eOpenOptionRead|File::eOpenOptionWrite)
 .Case("w+",  File::eOpenOptionRead|File::eOpenOptionWrite|File::eOpenOptionCanCreate|File::eOpenOptionTruncate)
-.Case("a+",  File::eOpenOptionRead|File::eOpenOptionWrite|File::eOpenOptionCanCreate)
+.Case("a+",  File::eOpenOptionAppend|File::eOpenOptionRead|File::eOpenOptionCanCreate)
 .Default(0);
 }
 
Index: source/Host/common/File.cpp
===
--- source/Host/common/File.cpp
+++ source/Host/common/File.cpp
@@ -45,7 +45,7 @@
 else
 return "a+";
 }
-else if (options & File::eOpenOptionWrite)
+else
 {
 if (options & File::eOpenOptionCanCreateNewOnly)
 return "ax";
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] Improving the documentation

2016-03-19 Thread John Lindal via lldb-commits
I added a reference in the class documentation.  Should I submit it via a
ticket?

Thanks!
John

On Tue, Mar 15, 2016 at 5:51 PM, Jim Ingham  wrote:

> The only other suggestion I have is that the first time we refer to a
> module in this file
> we should say "(see SBModule)" or something like that to make it clear
> what we mean by a module.
>
> Other than that this looks good to me.
>
> Jim
>
> > On Mar 15, 2016, at 5:05 PM, John Lindal 
> wrote:
> >
> > Great!  Attached is the update.
> >
> > On Thu, Mar 10, 2016 at 6:57 PM, Jim Ingham  wrote:
> > Few more comments...
> >
> > +/// If an address comes from an existing module, then it will be
> resolved
> > +/// into an offset from its containing section in that module.  That
> way it
> > +/// can refer to the same logical location as the module that holds it
> even
> >
> > Probably my error, but "location as the module" -> "location in the
> module"
> >
> > You use the terms "file virtual address" and "load virtual address".  I
> don't know what virtual means in that context.
> >
> >
> > +//--
> > +/// Tries to resolve the address within the target.  If this fails,
> >
> > "target" -> "target's modules"?  That makes it clearer what's going on.
> >
> > +/// assumes the address is absolute, e.g., on the stack or heap.
> The
> > +/// object becomes valid.
> > +///
> > +/// @param[in] load_addr
> > +/// A new offset value for this object.
> >
> > This isn't right, it isn't the new offset value, for instance if this is
> a load address from a loaded module,
> > the SBAddress will be the containing section + offset, and load_addr !=
> SBAddress.GetOffset().  This is just the
> > load address that will be resolved.
> >
> > +///
> > +/// @param[in] target
> > +/// The target within which the offset is valid.
> >
> > "The target within which the load address will be resolved" is better.
> This will always return a valid SBAddress, it
> > just might or might not be a section-relative one.
> >
> > +//--
> >  void
> >  SetLoadAddress (lldb::addr_t load_addr,
> >  lldb::SBTarget &target);
> >
> > And "The target within which the offset is valid." -> "The target within
> which the load address will be resolved"?
> >
> >
> > +//--
> > +/// Set the offset for this address, relative to the current
> section,
> > +/// if any.
> > +///
> > +/// @param[in] offset
> > +/// A new offset value for this object.
> > +//--
> > +// FIXME:  Should this be SetOffsetAddress?
> >  bool
> >  OffsetAddress (addr_t offset);
> >
> > This call actually slides the SBAddress, so new_offset = old_offset +
> offset
> >
> >
> > > On Mar 10, 2016, at 10:46 AM, John Lindal <
> git...@newplanetsoftware.com> wrote:
> > >
> > > Thanks for your patience and feedback!  Attached is the updated file.
> > >
> > > John
> > >
> > > On Wed, Mar 9, 2016 at 3:10 PM, Jim Ingham  wrote:
> > > The relation between section offsets and files is stronger than you
> are stating here.  You say:
> > >
> > > +/// Represents an address.  An address may refer to code or data from
> an
> > > +/// existing module, or it may refer to something on the stack or
> heap.
> > > +///
> > >
> > > That part is good, but you should use that in the next paragraph, so
> instead of:
> > >
> > > +/// If an address comes from a file on disk that has section relative
> > > +/// addresses, then it has a virtual address that is relative to a
> unique
> > > +/// section in the object file. Sections get resolved at runtime by
> > > +/// DynamicLoader plug-ins as images (executables and shared
> libraries) get
> > > +/// loaded/unloaded. If a section is loaded, then the load address
> can be
> > > +/// resolved.
> > >
> > > Something like:
> > >
> > > If an address comes from an existing module, then it will be resolved
> into an offset
> > > from its containing section in that module.  That way it can refer to
> the same logical
> > > location as the module that holds it is unloaded and loaded at
> different addresses.
> > > Module based SBAddresses are not bound to a particular target or
> process, but you
> > > can ask the SBAddress where/if it has been loaded in a particular
> target.
> > >
> > > I don't think you need to mention the Dynamic loader plugin here, it
> isn't essential to know who tracks the
> > > loads to understand what these do.  Also, you use "resolve" in the
> rest of the docs to mean "resolve to
> > > section/offset in a Module.  So using it for loading libraries here is
> confusing.  Better to define it
> > > here as you are going to use it.
> > >
> > > This bit doesn't seem right to me:
> > >
> > > -// The following queries can lookup symbol 

Re: [Lldb-commits] [PATCH] D17970: Implement ObjectFilePECOFF::GetEntryPointAddress.

2016-03-19 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/D17970



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


Re: [Lldb-commits] [lldb] r263520 - Add some test coverage for the changes in alias help

2016-03-19 Thread Zachary Turner via lldb-commits
Hi Enrico,

These tests are failing on Windows.  They're new tests so not really a
regression, but do you have any idea what might be wrong?  Basically, when
the test runs, the help po is displaying the full output of "help
expression".  But strangely, if I go into lldb and run "help po" there,
it's correct and the output would pass the test.

So something is different about running through the public api or running
help inside of lldb

On Mon, Mar 14, 2016 at 6:47 PM Enrico Granata via lldb-commits <
lldb-commits@lists.llvm.org> wrote:

> Author: enrico
> Date: Mon Mar 14 20:43:00 2016
> New Revision: 263520
>
> URL: http://llvm.org/viewvc/llvm-project?rev=263520&view=rev
> Log:
> Add some test coverage for the changes in alias help
>
>
> Modified:
> lldb/trunk/packages/Python/lldbsuite/test/help/TestHelp.py
>
> Modified: lldb/trunk/packages/Python/lldbsuite/test/help/TestHelp.py
> URL:
> http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/help/TestHelp.py?rev=263520&r1=263519&r2=263520&view=diff
>
> ==
> --- lldb/trunk/packages/Python/lldbsuite/test/help/TestHelp.py (original)
> +++ lldb/trunk/packages/Python/lldbsuite/test/help/TestHelp.py Mon Mar 14
> 20:43:00 2016
> @@ -167,6 +167,24 @@ class HelpCommandTestCase(TestBase):
>  'variable +--'])
>
>  @no_debug_info_test
> +def test_help_po_hides_options(self):
> +"""Test that 'help po' does not show all the options for
> expression"""
> +self.expect("help po",
> +substrs = ['--show-all-children', '--object-description'],
> matching=False)
> +
> +@no_debug_info_test
> +def test_help_run_hides_options(self):
> +"""Test that 'help run' does not show all the options for process
> launch"""
> +self.expect("help run",
> +substrs = ['--arch', '--environment'], matching=False)
> +
> +@no_debug_info_test
> +def test_help_next_shows_options(self):
> +"""Test that 'help next' shows all the options for thread
> step-over"""
> +self.expect("help next",
> +substrs = ['--python-class','--run-mode'], matching=True)
> +
> +@no_debug_info_test
>  def test_help_provides_alternatives(self):
>  """Test that help on commands that don't exist provides
> information on additional help avenues"""
>  self.expect("help thisisnotadebuggercommand",
>
>
> ___
> lldb-commits mailing list
> lldb-commits@lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
>
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D17107: [lldb] Unicode support on Win32

2016-03-19 Thread Zachary Turner via lldb-commits
zturner added a comment.

I can look at it today.  Sorry again for the delay, rebase 1 more time and
I'll check it out today


http://reviews.llvm.org/D17107



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


Re: [Lldb-commits] [PATCH] D17107: [lldb] Unicode support on Win32

2016-03-19 Thread Cameron via lldb-commits
cameron314 added a comment.

I think we're in different time zones -- I'm heading home for the day, but I'll 
look back in the morning to see if there's anything else that needs addressing.


http://reviews.llvm.org/D17107



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


[Lldb-commits] [lldb] r263858 - Delete the custom implementation of signal() on Windows.

2016-03-19 Thread Zachary Turner via lldb-commits
Author: zturner
Date: Fri Mar 18 18:47:48 2016
New Revision: 263858

URL: http://llvm.org/viewvc/llvm-project?rev=263858&view=rev
Log:
Delete the custom implementation of signal() on Windows.

The Windows SDK provides a version of signal() that is much more
limited compared to other platforms.  It only supports about 5-6
signal values.  LLDB uses signals for a number of things, most
notably to handle Ctrl+C so we can gracefully shut down.  The
portability solution to this on Windows has been to provide a
hand-rolled implementation of `signal` using the name `signal`
so that you could write code that simply calls signal directly
and it would work.

But this introduces a multiply defined symbol with the builtin
version and depending on how you included header files, you could
get yourself into a situation where you had linker errors.  To
make matters worse, it led to a ton of compiler warnings.  Worst
of all though is that this custom implementation of signal was,
in fact, identical for the purposes of handling Ctrl+C as the
builtin implementation of signal.  So it seems to have literally
not been serving any useful purpose.

This patch deletes all the custom signal() functions for Windows,
and includes the signal.h system header, so that any calls to
signal now go to the actual version provided by the Windows SDK.

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

Removed:
lldb/trunk/tools/lldb-mi/Platform.cpp
Modified:
lldb/trunk/tools/driver/Driver.cpp
lldb/trunk/tools/driver/Platform.cpp
lldb/trunk/tools/driver/Platform.h
lldb/trunk/tools/lldb-mi/CMakeLists.txt
lldb/trunk/tools/lldb-mi/Platform.h

Modified: lldb/trunk/tools/driver/Driver.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/driver/Driver.cpp?rev=263858&r1=263857&r2=263858&view=diff
==
--- lldb/trunk/tools/driver/Driver.cpp (original)
+++ lldb/trunk/tools/driver/Driver.cpp Fri Mar 18 18:47:48 2016
@@ -1310,11 +1310,13 @@ main (int argc, char const *argv[], cons
 
 SBHostOS::ThreadCreated ("");
 
+signal(SIGINT, sigint_handler);
+#ifndef _MSC_VER
 signal (SIGPIPE, SIG_IGN);
 signal (SIGWINCH, sigwinch_handler);
-signal (SIGINT, sigint_handler);
 signal (SIGTSTP, sigtstp_handler);
 signal (SIGCONT, sigcont_handler);
+#endif
 
 // Create a scope for driver so that the driver object will destroy itself
 // before SBDebugger::Terminate() is called.

Modified: lldb/trunk/tools/driver/Platform.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/driver/Platform.cpp?rev=263858&r1=263857&r2=263858&view=diff
==
--- lldb/trunk/tools/driver/Platform.cpp (original)
+++ lldb/trunk/tools/driver/Platform.cpp Fri Mar 18 18:47:48 2016
@@ -16,21 +16,6 @@
 
 #include "Platform.h"
 
-// the control handler or SIGINT handler
-static sighandler_t _ctrlHandler = NULL;
-
-// the default console control handler
-BOOL
-WINAPI CtrlHandler (DWORD ctrlType)
-{
-if ( _ctrlHandler != NULL )
-{
-_ctrlHandler( 0 );
-return TRUE;
-}
-return FALSE;
-}
-
 int
 ioctl (int d, int request, ...)
 {
@@ -84,29 +69,4 @@ tcgetattr (int fildes, struct termios *t
 return -1;
 }
 
-#ifdef _MSC_VER
-sighandler_t
-signal (int sig, sighandler_t sigFunc)
-{
-switch ( sig )
-{
-case ( SIGINT ):
-{
-_ctrlHandler = sigFunc;
-SetConsoleCtrlHandler( CtrlHandler, TRUE );
-}
-break;
-case ( SIGPIPE  ):
-case ( SIGWINCH ):
-case ( SIGTSTP  ):
-case ( SIGCONT  ):
-// ignore these for now
-break;
-default:
-assert( !"Not implemented!" );
-}
-return 0;
-}
-#endif
-
 #endif

Modified: lldb/trunk/tools/driver/Platform.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/driver/Platform.h?rev=263858&r1=263857&r2=263858&view=diff
==
--- lldb/trunk/tools/driver/Platform.h (original)
+++ lldb/trunk/tools/driver/Platform.h Fri Mar 18 18:47:48 2016
@@ -12,12 +12,11 @@
 
 #if defined( _WIN32 )
 
-// this will stop signal.h being included
-#define _INC_SIGNAL
 #include "lldb/Host/HostGetOpt.h"
 #include 
 #if defined( _MSC_VER )
 #include 
+#include 
 #endif
 #include 
 #include "lldb/Host/windows/windows.h"
@@ -37,17 +36,6 @@
 // ioctls.h
 #define TIOCGWINSZ 0x5413
 
-
-// signal handler function pointer type
-typedef void(*sighandler_t)(int);
-
-// signal.h
-#define SIGINT 2
-// default handler
-#define SIG_DFL ( (sighandler_t) -1 )
-// ignored
-#define SIG_IGN ( (sighandler_t) -2 )
-
 // signal.h
 #define SIGPIPE  13
 #define SIGCONT  18
@@ -80,7 +68,6 @@
 };
 typedef long pid_t;
 #define snprintf _snprintf
-extern sighandler_t signal( int sig, s

Re: [Lldb-commits] [PATCH] D17635: Continue after process exit

2016-03-19 Thread Zachary Turner via lldb-commits
zturner added a comment.

Petr, is this one ok to go in?


http://reviews.llvm.org/D17635



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


Re: [Lldb-commits] [PATCH] D18287: Don't try to redefine the signal() function on Windows

2016-03-19 Thread Zachary Turner via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL263858: Delete the custom implementation of signal() on 
Windows. (authored by zturner).

Changed prior to commit:
  http://reviews.llvm.org/D18287?vs=51090&id=51093#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D18287

Files:
  lldb/trunk/tools/driver/Driver.cpp
  lldb/trunk/tools/driver/Platform.cpp
  lldb/trunk/tools/driver/Platform.h
  lldb/trunk/tools/lldb-mi/CMakeLists.txt
  lldb/trunk/tools/lldb-mi/Platform.cpp
  lldb/trunk/tools/lldb-mi/Platform.h

Index: lldb/trunk/tools/driver/Platform.cpp
===
--- lldb/trunk/tools/driver/Platform.cpp
+++ lldb/trunk/tools/driver/Platform.cpp
@@ -16,21 +16,6 @@
 
 #include "Platform.h"
 
-// the control handler or SIGINT handler
-static sighandler_t _ctrlHandler = NULL;
-
-// the default console control handler
-BOOL
-WINAPI CtrlHandler (DWORD ctrlType)
-{
-if ( _ctrlHandler != NULL )
-{
-_ctrlHandler( 0 );
-return TRUE;
-}
-return FALSE;
-}
-
 int
 ioctl (int d, int request, ...)
 {
@@ -84,29 +69,4 @@
 return -1;
 }
 
-#ifdef _MSC_VER
-sighandler_t
-signal (int sig, sighandler_t sigFunc)
-{
-switch ( sig )
-{
-case ( SIGINT ):
-{
-_ctrlHandler = sigFunc;
-SetConsoleCtrlHandler( CtrlHandler, TRUE );
-}
-break;
-case ( SIGPIPE  ):
-case ( SIGWINCH ):
-case ( SIGTSTP  ):
-case ( SIGCONT  ):
-// ignore these for now
-break;
-default:
-assert( !"Not implemented!" );
-}
-return 0;
-}
-#endif
-
 #endif
Index: lldb/trunk/tools/driver/Driver.cpp
===
--- lldb/trunk/tools/driver/Driver.cpp
+++ lldb/trunk/tools/driver/Driver.cpp
@@ -1310,11 +1310,13 @@
 
 SBHostOS::ThreadCreated ("");
 
+signal(SIGINT, sigint_handler);
+#ifndef _MSC_VER
 signal (SIGPIPE, SIG_IGN);
 signal (SIGWINCH, sigwinch_handler);
-signal (SIGINT, sigint_handler);
 signal (SIGTSTP, sigtstp_handler);
 signal (SIGCONT, sigcont_handler);
+#endif
 
 // Create a scope for driver so that the driver object will destroy itself
 // before SBDebugger::Terminate() is called.
Index: lldb/trunk/tools/driver/Platform.h
===
--- lldb/trunk/tools/driver/Platform.h
+++ lldb/trunk/tools/driver/Platform.h
@@ -12,12 +12,11 @@
 
 #if defined( _WIN32 )
 
-// this will stop signal.h being included
-#define _INC_SIGNAL
 #include "lldb/Host/HostGetOpt.h"
 #include 
 #if defined( _MSC_VER )
 #include 
+#include 
 #endif
 #include 
 #include "lldb/Host/windows/windows.h"
@@ -37,17 +36,6 @@
 // ioctls.h
 #define TIOCGWINSZ 0x5413
 
-
-// signal handler function pointer type
-typedef void(*sighandler_t)(int);
-
-// signal.h
-#define SIGINT 2
-// default handler
-#define SIG_DFL ( (sighandler_t) -1 )
-// ignored
-#define SIG_IGN ( (sighandler_t) -2 )
-
 // signal.h
 #define SIGPIPE  13
 #define SIGCONT  18
@@ -80,7 +68,6 @@
 };
 typedef long pid_t;
 #define snprintf _snprintf
-extern sighandler_t signal( int sig, sighandler_t );
 #define PATH_MAX MAX_PATH
 #endif
 
Index: lldb/trunk/tools/lldb-mi/CMakeLists.txt
===
--- lldb/trunk/tools/lldb-mi/CMakeLists.txt
+++ lldb/trunk/tools/lldb-mi/CMakeLists.txt
@@ -73,7 +73,6 @@
   MIUtilString.cpp
   MIUtilThreadBaseStd.cpp
   MIUtilVariant.cpp
-  Platform.cpp
   )
 
 if ( CMAKE_SYSTEM_NAME MATCHES "Windows" OR CMAKE_SYSTEM_NAME MATCHES "NetBSD" )
Index: lldb/trunk/tools/lldb-mi/Platform.h
===
--- lldb/trunk/tools/lldb-mi/Platform.h
+++ lldb/trunk/tools/lldb-mi/Platform.h
@@ -10,12 +10,10 @@
 
 #if defined(_MSC_VER)
 
-// this will stop signal.h being included
-#define _INC_SIGNAL
-
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -73,18 +71,13 @@
 
 // CODETAG_IOR_SIGNALS
 // signal.h
-#define SIGINT 2   // Terminal interrupt signal
 #define SIGQUIT 3  // Terminal quit signal
 #define SIGKILL 9  // Kill (cannot be caught or ignored)
 #define SIGPIPE 13 // Write on a pipe with no one to read it
 #define SIGCONT 18 // Continue executing, if stopped.
 #define SIGTSTP 20 // Terminal stop signal
 #define SIGSTOP 23 // Stop executing (cannot be caught or ignored)
 #define SIGWINCH 28// (== SIGVTALRM)
-#define SIG_DFL ((sighandler_t)-1) // Default handler
-#define SIG_IGN ((sighandler_t)-2) // Ignored
-
-extern sighandler_t signal(int sig, sighandler_t);
 
 #else
 
Index: lldb/trunk/tools/lldb-mi/Platform.cpp
===

Re: [Lldb-commits] [lldb] r263333 - Let's not convert from UINT32_MAX to the std::numeric_limits version.

2016-03-19 Thread Joerg Sonnenberger via lldb-commits
On Tue, Mar 15, 2016 at 09:20:17PM +, Zachary Turner via lldb-commits wrote:
> Is the stdint version better somehow?  I thought C++ numeric_limits were
> actually preferred over the C macros.

It's quite a bit shorter and more readable? That sounds like a good
reason to me.

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


Re: [Lldb-commits] [PATCH] D17635: Continue after process exit

2016-03-19 Thread Zachary Turner via lldb-commits
zturner added a comment.

I can remove that comment for you, no worries.


http://reviews.llvm.org/D17635



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