Re: [Lldb-commits] [PATCH] test: ignore IOError in Base.deletePexpectChild and clean TestMySyntax test

2015-01-12 Thread Ilia K
Hello Abid,

Cleanup didn't help and I got the error again:
{code}
==
ERROR: test_lldbmi_eval (TestMiEvaluate.MiEvaluateTestCase)
Test that 'lldb-mi --interpreter' works for evaluating.
--
Traceback (most recent call last):
  File /Users/IliaK/p/llvm/tools/lldb/test/lldbtest.py, line 1767, in
tearDown
Base.tearDown(self)
  File /Users/IliaK/p/llvm/tools/lldb/test/lldbtest.py, line 1087, in
tearDown
self.deletePexpectChild()
  File /Users/IliaK/p/llvm/tools/lldb/test/lldbtest.py, line 1072, in
deletePexpectChild
self.child.sendline('settings set interpreter.prompt-on-quit false')
  File /Users/IliaK/p/llvm/tools/lldb/test/pexpect-2.4/pexpect.py, line
966, in sendline
n = self.send(s)
  File /Users/IliaK/p/llvm/tools/lldb/test/pexpect-2.4/pexpect.py, line
958, in send
c = os.write(self.child_fd, s)
OSError: [Errno 5] Input/output error
Config=x86_64-clang
{code}

Could you submit IOError patch?

Thanks,
Ilia


On Tue, Dec 30, 2014 at 9:16 PM, Ilia K ki.s...@gmail.com wrote:

 Nope, it didn't help:

 {code}
 ==
 ERROR: test_lldbmi_pendbreakonsym (TestMiBreakpoint.MiBreakpointTestCase)
Test that 'lldb-mi --interpreter' works for pending symbol breakpoints.
 --
 Traceback (most recent call last):
   File /Users/IliaK/p/llvm/tools/lldb/test/lldbtest.py, line 1765, in
 tearDown
 Base.tearDown(self)
   File /Users/IliaK/p/llvm/tools/lldb/test/lldbtest.py, line 1087, in
 tearDown
 self.deletePexpectChild()
   File /Users/IliaK/p/llvm/tools/lldb/test/lldbtest.py, line 1072, in
 deletePexpectChild
 self.child.sendline('settings set interpreter.prompt-on-quit false')
   File /Users/IliaK/p/llvm/tools/lldb/test/pexpect-2.4/pexpect.py, line
 966, in sendline
 n = self.send(s)
   File /Users/IliaK/p/llvm/tools/lldb/test/pexpect-2.4/pexpect.py, line
 958, in send
 c = os.write(self.child_fd, s)
 OSError: [Errno 5] Input/output error
 Config=x86_64-clang
 {code}

 Thanks,
 Ilia


 On Tue, Dec 30, 2014 at 8:15 PM, Abid, Hafiz hafiz_a...@mentor.com
 wrote:

  I committed the cleanup in 224990. Please have a look and let me know
 if you see a problem.

  Regards,
 Abid
  --
 *From:* Ilia K [ki.s...@gmail.com]
 *Sent:* Tuesday, December 30, 2014 4:50 PM

 *To:* Abid, Hafiz
 *Cc:* lldb-commits@cs.uiuc.edu
 *Subject:* Re: [Lldb-commits] [PATCH] test: ignore IOError in
 Base.deletePexpectChild and clean TestMySyntax test

   Now I have modified breakpoint's test and IOError sometimes happens:
 {code}
  $ *./dotest.py -v --executable $BUILDDIR/bin/lldb -f
 MiBreakpointTestCase.test_lldbmi_pendbreakonsym*
 ['./dotest.py', '-v', '--executable',
 '/Users/IliaK/p/llvm/build_ninja/bin/lldb', '-f',
 'MiBreakpointTestCase.test_lldbmi_pendbreakonsym']
 LLDB library dir: /Users/IliaK/p/llvm/build_ninja/bin
 lldb-330.99.0
 lldb.pre_flight: None
 lldb.post_flight: None

  Session logs for test failures/errors/unexpected successes will go into
 directory '2014-12-30-19_45_12'
 Command invoked: ./dotest.py -v --executable
 /Users/IliaK/p/llvm/build_ninja/bin/lldb -f
 MiBreakpointTestCase.test_lldbmi_pendbreakonsym
 compilers=['clang']

  Configuration: arch=x86_64 compiler=clang
 --
 Collected 1 test

  1: test_lldbmi_pendbreakonsym (TestMiBreakpoint.MiBreakpointTestCase)
Test that 'lldb-mi --interpreter' works for pending symbol
 breakpoints. ... ERROR

  ==
 ERROR: test_lldbmi_pendbreakonsym (TestMiBreakpoint.MiBreakpointTestCase)
Test that 'lldb-mi --interpreter' works for pending symbol breakpoints.
 --
 Traceback (most recent call last):
   File /Users/IliaK/p/llvm/tools/lldb/test/lldbtest.py, line 1765, in
 tearDown
 Base.tearDown(self)
   File /Users/IliaK/p/llvm/tools/lldb/test/lldbtest.py, line 1087, in
 tearDown
 self.deletePexpectChild()
   File /Users/IliaK/p/llvm/tools/lldb/test/lldbtest.py, line 1072, in
 deletePexpectChild
 self.child.sendline('settings set interpreter.prompt-on-quit false')
   File /Users/IliaK/p/llvm/tools/lldb/test/pexpect-2.4/pexpect.py, line
 966, in sendline
 n = self.send(s)
   File /Users/IliaK/p/llvm/tools/lldb/test/pexpect-2.4/pexpect.py, line
 958, in send
 c = os.write(self.child_fd, s)
 OSError: [Errno 5] Input/output error
 Config=x86_64-clang
 --
 {code}

  Here are my changes:
 {code}
  Index: test/tools/lldb-mi/TestMiBreakpoint.py
 ===
 --- test/tools/lldb-mi/TestMiBreakpoint.py  (revision 

Re: [Lldb-commits] [PATCH] test: ignore IOError in Base.deletePexpectChild and clean TestMySyntax test

2015-01-12 Thread Ilia K
Hello,

One more test failed:
{code}
==
ERROR: test_lldbmi_sourceoption
(TestMiStartupOptions.MiStartupOptionsTestCase)
Test that 'lldb-mi --interpreter' can execute a prepared file which
passed via --source option.
--
Traceback (most recent call last):
  File /Users/IliaK/p/llvm/tools/lldb/test/lldbtest.py, line 1767, in
tearDown
Base.tearDown(self)
  File /Users/IliaK/p/llvm/tools/lldb/test/lldbtest.py, line 1087, in
tearDown
self.deletePexpectChild()
  File /Users/IliaK/p/llvm/tools/lldb/test/lldbtest.py, line 1072, in
deletePexpectChild
self.child.sendline('settings set interpreter.prompt-on-quit false')
  File /Users/IliaK/p/llvm/tools/lldb/test/pexpect-2.4/pexpect.py, line
966, in sendline
n = self.send(s)
  File /Users/IliaK/p/llvm/tools/lldb/test/pexpect-2.4/pexpect.py, line
958, in send
c = os.write(self.child_fd, s)
OSError: [Errno 5] Input/output error
Config=x86_64-clang
{code}

Thanks,
Ilia


On Mon, Jan 12, 2015 at 4:24 PM, Ilia K ki.s...@gmail.com wrote:

 Hello Abid,

 Cleanup didn't help and I got the error again:
 {code}
 ==
 ERROR: test_lldbmi_eval (TestMiEvaluate.MiEvaluateTestCase)
 Test that 'lldb-mi --interpreter' works for evaluating.
 --
 Traceback (most recent call last):
   File /Users/IliaK/p/llvm/tools/lldb/test/lldbtest.py, line 1767, in
 tearDown
 Base.tearDown(self)
   File /Users/IliaK/p/llvm/tools/lldb/test/lldbtest.py, line 1087, in
 tearDown
 self.deletePexpectChild()
   File /Users/IliaK/p/llvm/tools/lldb/test/lldbtest.py, line 1072, in
 deletePexpectChild
 self.child.sendline('settings set interpreter.prompt-on-quit false')
   File /Users/IliaK/p/llvm/tools/lldb/test/pexpect-2.4/pexpect.py, line
 966, in sendline
 n = self.send(s)
   File /Users/IliaK/p/llvm/tools/lldb/test/pexpect-2.4/pexpect.py, line
 958, in send
 c = os.write(self.child_fd, s)
 OSError: [Errno 5] Input/output error
 Config=x86_64-clang
 {code}

 Could you submit IOError patch?

 Thanks,
 Ilia


 On Tue, Dec 30, 2014 at 9:16 PM, Ilia K ki.s...@gmail.com wrote:

 Nope, it didn't help:

 {code}
 ==
 ERROR: test_lldbmi_pendbreakonsym (TestMiBreakpoint.MiBreakpointTestCase)
Test that 'lldb-mi --interpreter' works for pending symbol breakpoints.
 --
 Traceback (most recent call last):
   File /Users/IliaK/p/llvm/tools/lldb/test/lldbtest.py, line 1765, in
 tearDown
 Base.tearDown(self)
   File /Users/IliaK/p/llvm/tools/lldb/test/lldbtest.py, line 1087, in
 tearDown
 self.deletePexpectChild()
   File /Users/IliaK/p/llvm/tools/lldb/test/lldbtest.py, line 1072, in
 deletePexpectChild
 self.child.sendline('settings set interpreter.prompt-on-quit false')
   File /Users/IliaK/p/llvm/tools/lldb/test/pexpect-2.4/pexpect.py, line
 966, in sendline
 n = self.send(s)
   File /Users/IliaK/p/llvm/tools/lldb/test/pexpect-2.4/pexpect.py, line
 958, in send
 c = os.write(self.child_fd, s)
 OSError: [Errno 5] Input/output error
 Config=x86_64-clang
 {code}

 Thanks,
 Ilia


 On Tue, Dec 30, 2014 at 8:15 PM, Abid, Hafiz hafiz_a...@mentor.com
 wrote:

  I committed the cleanup in 224990. Please have a look and let me know
 if you see a problem.

  Regards,
 Abid
  --
 *From:* Ilia K [ki.s...@gmail.com]
 *Sent:* Tuesday, December 30, 2014 4:50 PM

 *To:* Abid, Hafiz
 *Cc:* lldb-commits@cs.uiuc.edu
 *Subject:* Re: [Lldb-commits] [PATCH] test: ignore IOError in
 Base.deletePexpectChild and clean TestMySyntax test

   Now I have modified breakpoint's test and IOError sometimes happens:
 {code}
  $ *./dotest.py -v --executable $BUILDDIR/bin/lldb -f
 MiBreakpointTestCase.test_lldbmi_pendbreakonsym*
 ['./dotest.py', '-v', '--executable',
 '/Users/IliaK/p/llvm/build_ninja/bin/lldb', '-f',
 'MiBreakpointTestCase.test_lldbmi_pendbreakonsym']
 LLDB library dir: /Users/IliaK/p/llvm/build_ninja/bin
 lldb-330.99.0
 lldb.pre_flight: None
 lldb.post_flight: None

  Session logs for test failures/errors/unexpected successes will go
 into directory '2014-12-30-19_45_12'
 Command invoked: ./dotest.py -v --executable
 /Users/IliaK/p/llvm/build_ninja/bin/lldb -f
 MiBreakpointTestCase.test_lldbmi_pendbreakonsym
 compilers=['clang']

  Configuration: arch=x86_64 compiler=clang
 --
 Collected 1 test

  1: test_lldbmi_pendbreakonsym (TestMiBreakpoint.MiBreakpointTestCase)
Test that 'lldb-mi --interpreter' works for pending symbol
 breakpoints. ... ERROR

  ==
 ERROR: test_lldbmi_pendbreakonsym 

Re: [Lldb-commits] [PATCH] UriParser - fixed potential buffer overrun

2015-01-12 Thread Oleksiy Vyalov
REPOSITORY
  rL LLVM


Comment at: /Users/vharron/ll/svn/lldb/source/Utility/UriParser.cpp:42
@@ -42,1 +41,3 @@
+char* end = nullptr;
 int port_tmp = strtoul(port_buf, end, 10);
+if (*end != 0 || port_tmp  65535)

You may define port_tmp as auto instead of integer - otherwise if result of 
strtoul is greater than MAX_INT but less than max of unsigned long int it might 
be just a negative number.


Comment at: /Users/vharron/ll/svn/lldb/source/Utility/UriParser.cpp:43
@@ -42,3 +42,3 @@
 int port_tmp = strtoul(port_buf, end, 10);
-if (*end != 0)
+if (*end != 0 || port_tmp  65535)
 {

Check for portr_tmp = 0?

http://reviews.llvm.org/D6918

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/



___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] Add support for character option types

2015-01-12 Thread Zachary Turner
ping.  Also +clayborg just in case he's also interested in this.


http://reviews.llvm.org/D6887

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/



___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] minor refactoring to remove unneeded/unspecific header files

2015-01-12 Thread Oleksiy Vyalov
REPOSITORY
  rL LLVM

http://reviews.llvm.org/D6919

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/



___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] UriParser - fixed potential buffer overrun

2015-01-12 Thread Greg Clayton
I would prefer this to use Args::StringToUInt32() instead of a manual call to 
strtoul() from #include lldb/Interpreter/Args.h (even though the correct 
usage of strtoul() is used here). This helps abstract us from the host we are 
running on in case there is no strtoul() and also leads me to the fact that the 
Args::StringTo* calls could actually be moved into the host layer.

You might also be better off using the RegularExpression class to parse these 
instead of sscanf, but this isn't a required change.


REPOSITORY
  rL LLVM

http://reviews.llvm.org/D6918

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/



___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r225651 - More [-Werror, -Winconsistent-missing-override] fixes.

2015-01-12 Thread Eric Christopher
Author: echristo
Date: Mon Jan 12 13:09:48 2015
New Revision: 225651

URL: http://llvm.org/viewvc/llvm-project?rev=225651view=rev
Log:
More [-Werror,-Winconsistent-missing-override] fixes.

Modified:
lldb/trunk/include/lldb/Interpreter/CommandObjectRegexCommand.h

Modified: lldb/trunk/include/lldb/Interpreter/CommandObjectRegexCommand.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Interpreter/CommandObjectRegexCommand.h?rev=225651r1=225650r2=225651view=diff
==
--- lldb/trunk/include/lldb/Interpreter/CommandObjectRegexCommand.h (original)
+++ lldb/trunk/include/lldb/Interpreter/CommandObjectRegexCommand.h Mon Jan 12 
13:09:48 2015
@@ -52,18 +52,18 @@ public:
 return !m_entries.empty();
 }
 
-virtual int
+int
 HandleCompletion (Args input,
   int cursor_index,
   int cursor_char_position,
   int match_start_point,
   int max_return_elements,
   bool word_complete,
-  StringList matches);
+  StringList matches) override;
 
 protected:
-virtual bool
-DoExecute (const char *command, CommandReturnObject result);
+bool
+DoExecute (const char *command, CommandReturnObject result) override;
 
 struct Entry
 {


___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] Add Socket::Get[Remote/Local]IpAddress and unit tests

2015-01-12 Thread Greg Clayton
The other option is to move all static Args::StringTo* calls into the Host 
layer at an appropriate place.

Changes should be:

- please use Args::StringTo calls instead of manual strtoul() calls so we have 
a common codebase and so people don't start using strtoul() on their own in 
other places f the code
- optionally move the static Args::StringTo* calls into the Host layer


REPOSITORY
  rL LLVM

http://reviews.llvm.org/D6917

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/



___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] Add support for character option types

2015-01-12 Thread Jim Ingham
This seems fine to me.


http://reviews.llvm.org/D6887

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/



___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] Add support for character option types

2015-01-12 Thread Zachary Turner
REPOSITORY
  rL LLVM

http://reviews.llvm.org/D6887

Files:
  lldb/trunk/include/lldb/Interpreter/Args.h
  lldb/trunk/include/lldb/Interpreter/OptionValue.h
  lldb/trunk/include/lldb/Interpreter/OptionValueChar.h
  lldb/trunk/include/lldb/Interpreter/OptionValues.h
  lldb/trunk/include/lldb/lldb-forward.h
  lldb/trunk/source/Interpreter/Args.cpp
  lldb/trunk/source/Interpreter/CMakeLists.txt
  lldb/trunk/source/Interpreter/OptionValue.cpp
  lldb/trunk/source/Interpreter/OptionValueArray.cpp
  lldb/trunk/source/Interpreter/OptionValueChar.cpp
  lldb/trunk/source/Interpreter/OptionValueDictionary.cpp
  lldb/trunk/source/Interpreter/Property.cpp

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
Index: lldb/trunk/include/lldb/Interpreter/OptionValueChar.h
===
--- lldb/trunk/include/lldb/Interpreter/OptionValueChar.h
+++ lldb/trunk/include/lldb/Interpreter/OptionValueChar.h
@@ -0,0 +1,113 @@
+//===-- OptionValueBoolean.h *- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===--===//
+
+#ifndef liblldb_OptionValueChar_h_
+#define liblldb_OptionValueChar_h_
+
+// C Includes
+// C++ Includes
+// Other libraries and framework includes
+// Project includes
+#include lldb/Interpreter/OptionValue.h
+
+namespace lldb_private {
+
+class OptionValueChar : public OptionValue
+{
+public:
+OptionValueChar (char value) :
+OptionValue(),
+m_current_value (value),
+m_default_value (value)
+{
+}
+OptionValueChar (char current_value,
+ char default_value) :
+OptionValue(),
+m_current_value (current_value),
+m_default_value (default_value)
+{
+}
+
+virtual 
+~OptionValueChar()
+{
+}
+
+//-
+// Virtual subclass pure virtual overrides
+//-
+
+virtual OptionValue::Type
+GetType () const
+{
+return eTypeChar;
+}
+
+virtual void
+DumpValue (const ExecutionContext *exe_ctx, Stream strm, uint32_t dump_mask);
+
+virtual Error
+SetValueFromCString (const char *value,
+ VarSetOperationType op = eVarSetOperationAssign);
+
+virtual bool
+Clear ()
+{
+m_current_value = m_default_value;
+m_value_was_set = false;
+return true;
+}
+
+//-
+// Subclass specific functions
+//-
+
+const char 
+operator = (char c)
+{
+m_current_value = c;
+return m_current_value;
+}
+
+char
+GetCurrentValue() const
+{
+return m_current_value;
+}
+
+char
+GetDefaultValue() const
+{
+return m_default_value;
+}
+
+void
+SetCurrentValue (char value)
+{
+m_current_value = value;
+}
+
+void
+SetDefaultValue (char value)
+{
+m_default_value = value;
+}
+
+virtual lldb::OptionValueSP
+DeepCopy () const;
+
+protected:
+char m_current_value;
+char m_default_value;
+};
+
+} // namespace lldb_private
+
+#endif  // liblldb_OptionValueChar_h_
Index: lldb/trunk/include/lldb/Interpreter/OptionValue.h
===
--- lldb/trunk/include/lldb/Interpreter/OptionValue.h
+++ lldb/trunk/include/lldb/Interpreter/OptionValue.h
@@ -26,12 +26,14 @@
 class OptionValue
 {
 public:
-typedef enum {
+typedef enum
+{
 eTypeInvalid = 0,
 eTypeArch,
 eTypeArgs,
 eTypeArray,
 eTypeBoolean,
+eTypeChar,
 eTypeDictionary,
 eTypeEnum,
 eTypeFileSpec,
@@ -41,11 +43,11 @@
 eTypeProperties,
 eTypeRegex,
 eTypeSInt64,
-eTypeString, 
+eTypeString,
 eTypeUInt64,
 eTypeUUID
 } Type;
-
+
 enum {
 eDumpOptionName = (1u  0),
 eDumpOptionType = (1u  1),
@@ -173,6 +175,7 @@
 case 1u  eTypeArgs:   return eTypeArgs;
 case 1u  eTypeArray:  return eTypeArray;
 case 1u  eTypeBoolean:return eTypeBoolean;
+case 1u  eTypeChar:   return eTypeChar;
 case 1u  eTypeDictionary: return eTypeDictionary;
 case 1u  eTypeEnum:   

[Lldb-commits] [PATCH] Fix XCode build on OSX - add OptionValueChar.cpp

2015-01-12 Thread Oleksiy Vyalov
Hi zturner, jingham,

OptionValueChar.cpp  doesn't exist in LLDB XCode project file that is causing 
OSX build to fail.

http://reviews.llvm.org/D6941

Files:
  lldb.xcodeproj/project.pbxproj

Index: lldb.xcodeproj/project.pbxproj
===
--- lldb.xcodeproj/project.pbxproj
+++ lldb.xcodeproj/project.pbxproj
@@ -76,6 +76,7 @@
23EFE389193D1ABC00E54E54 /* SBTypeEnumMember.h in Headers */ = 
{isa = PBXBuildFile; fileRef = 23EFE388193D1ABC00E54E54 /* SBTypeEnumMember.h 
*/; settings = {ATTRIBUTES = (Public, ); }; };
23EFE38B193D1AEC00E54E54 /* SBTypeEnumMember.cpp in Sources */ 
= {isa = PBXBuildFile; fileRef = 23EFE38A193D1AEC00E54E54 /* 
SBTypeEnumMember.cpp */; };
23F4034D1926E0F60046DC9B /* 
NativeRegisterContextRegisterInfo.cpp in Sources */ = {isa = PBXBuildFile; 
fileRef = 23F403481926CC250046DC9B /* NativeRegisterContextRegisterInfo.cpp */; 
};
+   25420ECD1A6490B8009ADBCB /* OptionValueChar.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = 25420ECC1A6490B8009ADBCB /* OptionValueChar.cpp 
*/; };
260157C61885F51C00F875CF /* libpanel.dylib in Frameworks */ = 
{isa = PBXBuildFile; fileRef = 260157C41885F4FF00F875CF /* libpanel.dylib */; };
260157C71885F52500F875CF /* libpanel.dylib in Frameworks */ = 
{isa = PBXBuildFile; fileRef = 260157C41885F4FF00F875CF /* libpanel.dylib */; };
260157C81885F53100F875CF /* libpanel.dylib in Frameworks */ = 
{isa = PBXBuildFile; fileRef = 260157C41885F4FF00F875CF /* libpanel.dylib */; };
@@ -1028,6 +1029,8 @@
23EFE38A193D1AEC00E54E54 /* SBTypeEnumMember.cpp */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = 
SBTypeEnumMember.cpp; path = source/API/SBTypeEnumMember.cpp; sourceTree = 
group; };
23F403471926C8D50046DC9B /* NativeRegisterContextRegisterInfo.h 
*/ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = 
sourcecode.c.h; name = NativeRegisterContextRegisterInfo.h; path = 
include/lldb/Target/NativeRegisterContextRegisterInfo.h; sourceTree = 
group; };
23F403481926CC250046DC9B /* 
NativeRegisterContextRegisterInfo.cpp */ = {isa = PBXFileReference; 
fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = 
NativeRegisterContextRegisterInfo.cpp; path = 
source/Target/NativeRegisterContextRegisterInfo.cpp; sourceTree = group; };
+   25420ECC1A6490B8009ADBCB /* OptionValueChar.cpp */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
name = OptionValueChar.cpp; path = source/Interpreter/OptionValueChar.cpp; 
sourceTree = group; };
+   25420ECE1A64911B009ADBCB /* OptionValueChar.h */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.c.h; name = OptionValueChar.h; 
path = include/lldb/Interpreter/OptionValueChar.h; sourceTree = group; };
260157C41885F4FF00F875CF /* libpanel.dylib */ = {isa = 
PBXFileReference; lastKnownFileType = compiled.mach-o.dylib; name = 
libpanel.dylib; path = /usr/lib/libpanel.dylib; sourceTree = absolute; };
260223E7115F06D500A601A2 /* SBCommunication.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = 
SBCommunication.h; path = include/lldb/API/SBCommunication.h; sourceTree = 
group; };
260223E8115F06E500A601A2 /* SBCommunication.cpp */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
name = SBCommunication.cpp; path = source/API/SBCommunication.cpp; sourceTree = 
group; };
@@ -3733,6 +3736,8 @@
26BC7DDF10F1B7E200F91463 /* Interpreter */ = {
isa = PBXGroup;
children = (
+   25420ECE1A64911B009ADBCB /* OptionValueChar.h 
*/,
+   25420ECC1A6490B8009ADBCB /* OptionValueChar.cpp 
*/,
26BC7D5310F1B77400F91463 /* Args.h */,
26BC7E6C10F1B85900F91463 /* Args.cpp */,
26A4EEB511682AAC007A372A /* LLDBWrapPython.cpp 
*/,
@@ -5114,6 +5119,7 @@
2689FFFB13353DB600698AC0 /* 
BreakpointLocationList.cpp in Sources */,
2689FFFD13353DB600698AC0 /* 
BreakpointOptions.cpp in Sources */,
268913353DB600698AC0 /* 
BreakpointResolver.cpp in Sources */,
+   25420ECD1A6490B8009ADBCB /* OptionValueChar.cpp 
in Sources */,
2689000113353DB600698AC0 /* 
BreakpointResolverAddress.cpp in Sources */,
2689000313353DB600698AC0 /* 
BreakpointResolverFileLine.cpp in Sources */,
26474CA818D0CB070073DEBA /* 
RegisterContextFreeBSD_i386.cpp in Sources */,

EMAIL PREFERENCES
  

[Lldb-commits] [lldb] r225748 - Don't run functionalities/tty under sudo / as root.

2015-01-12 Thread Jason Molenda
Author: jmolenda
Date: Mon Jan 12 18:54:59 2015
New Revision: 225748

URL: http://llvm.org/viewvc/llvm-project?rev=225748view=rev
Log:
Don't run functionalities/tty under sudo / as root.
The terminal window will be opened under the ownership
of the real userid and it won't be able to open the
socket talking back to lldb -- the testsuite will hang
here.

The same thing probably should be done for lldb when run
on a remote system over ssh.  I added a line for that 
but commented it out for now because I haven't
tested it.

Modified:
lldb/trunk/test/functionalities/tty/TestTerminal.py

Modified: lldb/trunk/test/functionalities/tty/TestTerminal.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/tty/TestTerminal.py?rev=225748r1=225747r2=225748view=diff
==
--- lldb/trunk/test/functionalities/tty/TestTerminal.py (original)
+++ lldb/trunk/test/functionalities/tty/TestTerminal.py Mon Jan 12 18:54:59 2015
@@ -16,6 +16,16 @@ class LaunchInTerminalTestCase(TestBase)
 # a program in a separate terminal window. It would be great if other 
platforms
 # added support for this.
 @unittest2.skipUnless(sys.platform.startswith(darwin), requires Darwin)
+
+
+# If the test is being run under sudo, the spawned terminal won't retain 
that elevated
+# privilege so it can't open the socket to talk back to the test case
+@unittest2.skipUnless(os.geteuid() != 0, test cannot be run as root)
+
+# Do we need to disable this test if the testsuite is being run on a 
rmeote system?
+# This env var is only defined when the shell is running in a local mac 
terminal window
+# @unittest2.skipUnless(os.environ.has_key('TERM_PROGRAM'), test must be 
run on local system)
+
 def test_launch_in_terminal (self):
 exe = /bin/ls
 target = self.dbg.CreateTarget(exe)


___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] Add a global setting for the interpreter's escape-character

2015-01-12 Thread Zachary Turner
Hi clayborg, jingham,

This enables Windows to specify paths with backslashes unquoted and fixes many 
tests as a result.  We don't always have control over what type of slashes a 
path built in python has.  For example if os.join() is used it will use 
backslashes.  or if os.path.separator is used.  So it's important to be able to 
have unquoted paths on Windows.

http://reviews.llvm.org/D6943

Files:
  include/lldb/Core/UserSettingsController.h
  include/lldb/Interpreter/CommandInterpreter.h
  include/lldb/Interpreter/OptionValueProperties.h
  source/Core/Debugger.cpp
  source/Core/UserSettingsController.cpp
  source/Interpreter/Args.cpp
  source/Interpreter/CommandInterpreter.cpp
  source/Interpreter/OptionValueProperties.cpp
  source/Interpreter/Property.cpp

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
Index: include/lldb/Core/UserSettingsController.h
===
--- include/lldb/Core/UserSettingsController.h
+++ include/lldb/Core/UserSettingsController.h
@@ -46,6 +46,9 @@
 ~Properties()
 {
 }
+
+virtual void
+Initialize(const PropertyDefinition *definitions);
 
 virtual lldb::OptionValuePropertiesSP
 GetValueProperties () const
Index: include/lldb/Interpreter/CommandInterpreter.h
===
--- include/lldb/Interpreter/CommandInterpreter.h
+++ include/lldb/Interpreter/CommandInterpreter.h
@@ -195,7 +195,6 @@
 
 class CommandInterpreter :
 public Broadcaster,
-public Properties,
 public IOHandlerDelegate
 {
 public:
@@ -449,6 +448,18 @@
 const char *help_text,
 uint32_t max_word_len);
 
+Properties 
+GetProperties ()
+{
+return m_properties;
+}
+
+static Properties 
+GetGlobalProperties()
+{
+return m_global_properties;
+}
+
 Debugger 
 GetDebugger ()
 {
@@ -619,6 +630,9 @@
 bool
 GetStopCmdSourceOnError () const;
 
+static char
+GetEscapeCharacter();
+
 uint32_t
 GetNumErrors() const
 {
@@ -676,6 +690,8 @@
 Error
 PreprocessCommand (std::string command);
 
+Properties m_properties;// The non-global CommandInterpreter properties.
+static Properties m_global_properties;  // The global CommandInterpreter properties.
 Debugger m_debugger;   // The debugger session that this interpreter is associated with
 ExecutionContextRef m_exe_ctx_ref;  // The current execution context to use when handling commands
 bool m_synchronous_execution;
Index: include/lldb/Interpreter/OptionValueProperties.h
===
--- include/lldb/Interpreter/OptionValueProperties.h
+++ include/lldb/Interpreter/OptionValueProperties.h
@@ -181,7 +181,13 @@
 
 bool
 SetPropertyAtIndexAsBoolean (const ExecutionContext *exe_ctx, uint32_t idx, bool new_value);
-
+
+char
+GetPropertyAtIndexAsChar (const ExecutionContext *exe_ctx, uint32_t idx, char fail_value) const;
+
+bool
+SetPropertyAtIndexAsChar (const ExecutionContext *exe_ctx, uint32_t idx, char new_value);
+
 OptionValueDictionary *
 GetPropertyAtIndexAsOptionValueDictionary (const ExecutionContext *exe_ctx, uint32_t idx) const;
 
Index: source/Core/Debugger.cpp
===
--- source/Core/Debugger.cpp
+++ source/Core/Debugger.cpp
@@ -167,7 +167,7 @@
 ePropertyUseExternalEditor,
 ePropertyUseColor,
 ePropertyAutoOneLineSummaries,
-ePropertyEscapeNonPrintables
+ePropertyEscapeNonPrintables,
 };
 
 Debugger::LoadPluginCallbackType Debugger::g_load_plugin_callback = NULL;
@@ -382,6 +382,7 @@
 return m_collection_sp-GetPropertyAtIndexAsBoolean (NULL, idx, true);
 }
 
+
 #pragma mark Debugger
 
 //const DebuggerPropertiesSP 
@@ -679,16 +680,21 @@
 
 m_collection_sp-Initialize (g_properties);
 m_collection_sp-AppendProperty (ConstString(target),
- ConstString(Settings specify to debugging targets.),
+ ConstString(Settings specific to debugging targets.),
  true,
  Target::GetGlobalProperties()-GetValueProperties());
 if (m_command_interpreter_ap.get())
 {
 m_collection_sp-AppendProperty (ConstString(interpreter),
- ConstString(Settings specify to the debugger's command interpreter.),
+ ConstString(Settings specific to the debugger's command interpreter.),
  true,
- m_command_interpreter_ap-GetValueProperties());
+ 

[Lldb-commits] [lldb] r225770 - Change the x86 assembly instruction unwind parser to

2015-01-12 Thread Jason Molenda
Author: jmolenda
Date: Tue Jan 13 00:04:04 2015
New Revision: 225770

URL: http://llvm.org/viewvc/llvm-project?rev=225770view=rev
Log:
Change the x86 assembly instruction unwind parser to
step through the complete function looking for any epilogue
instructions.  If we find an epilogue sequence, re-instate
the correct unwind instructions if there is more code past
that epilogue -- this will correctly handle an x86 function
with multiple epilogues in it.

NB there is still a bug with the eh_frame augmented 
UnwindPlans and mid-function epilogues.  Looking at that next.

rdar://problem/18863406 

Modified:
lldb/trunk/include/lldb/Symbol/FuncUnwinders.h
lldb/trunk/include/lldb/Symbol/UnwindPlan.h
lldb/trunk/source/Commands/CommandObjectTarget.cpp
lldb/trunk/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp
lldb/trunk/source/Symbol/UnwindPlan.cpp

Modified: lldb/trunk/include/lldb/Symbol/FuncUnwinders.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/FuncUnwinders.h?rev=225770r1=225769r2=225770view=diff
==
--- lldb/trunk/include/lldb/Symbol/FuncUnwinders.h (original)
+++ lldb/trunk/include/lldb/Symbol/FuncUnwinders.h Tue Jan 13 00:04:04 2015
@@ -84,10 +84,11 @@ public:
 Address
 GetPersonalityRoutinePtrAddress (Target target);
 
-private:
 
-lldb::UnwindAssemblySP
-GetUnwindAssemblyProfiler ();
+
+// The following methods to retrieve specific unwind plans should rarely 
be used.
+// Instead, clients should ask for the *behavior* they are looking for, 
using one
+// of the above UnwindPlan retrieval methods.
 
 lldb::UnwindPlanSP
 GetAssemblyUnwindPlan (Target target, Thread thread, int current_offset);
@@ -102,13 +103,15 @@ private:
 GetCompactUnwindUnwindPlan (Target target, int current_offset);
 
 lldb::UnwindPlanSP
-GetFastUnwindPlan (Target target, int current_offset);
+GetArchDefaultUnwindPlan (Thread thread);
 
 lldb::UnwindPlanSP
-GetArchDefaultUnwindPlan (Target target, int current_offset);
+GetArchDefaultAtFuncEntryUnwindPlan (Thread thread);
 
-lldb::UnwindPlanSP
-GetArchDefaultAtFuncEntryUnwindPlan (Target target, int current_offset);
+private:
+
+lldb::UnwindAssemblySP
+GetUnwindAssemblyProfiler ();
 
 UnwindTable m_unwind_table;
 AddressRange m_range;

Modified: lldb/trunk/include/lldb/Symbol/UnwindPlan.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/UnwindPlan.h?rev=225770r1=225769r2=225770view=diff
==
--- lldb/trunk/include/lldb/Symbol/UnwindPlan.h (original)
+++ lldb/trunk/include/lldb/Symbol/UnwindPlan.h Tue Jan 13 00:04:04 2015
@@ -257,7 +257,10 @@ public:
 
 void
 SetRegisterInfo (uint32_t reg_num, const RegisterLocation 
register_location);
-
+
+void
+RemoveRegisterInfo (uint32_t reg_num);
+
 lldb::addr_t
 GetOffset() const
 {

Modified: lldb/trunk/source/Commands/CommandObjectTarget.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectTarget.cpp?rev=225770r1=225769r2=225770view=diff
==
--- lldb/trunk/source/Commands/CommandObjectTarget.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectTarget.cpp Tue Jan 13 00:04:04 2015
@@ -3744,45 +3744,85 @@ protected:
 if (func_unwinders_sp.get() == NULL)
 continue;
 
-Address first_non_prologue_insn 
(func_unwinders_sp-GetFirstNonPrologueInsn(*target));
-if (first_non_prologue_insn.IsValid())
-{
-result.GetOutputStream().Printf(First non-prologue 
instruction is at address 0x% PRIx64  or offset % PRId64  into the 
function.\n, first_non_prologue_insn.GetLoadAddress(target), 
first_non_prologue_insn.GetLoadAddress(target) - start_addr);
-result.GetOutputStream().Printf (\n);
-}
+result.GetOutputStream().Printf(UNWIND PLANS for %s`%s (start 
addr 0x% PRIx64 )\n\n, 
sc.module_sp-GetPlatformFileSpec().GetFilename().AsCString(), 
funcname.AsCString(), start_addr);
 
 UnwindPlanSP non_callsite_unwind_plan = 
func_unwinders_sp-GetUnwindPlanAtNonCallSite(*target, *thread.get(), -1);
 if (non_callsite_unwind_plan.get())
 {
-result.GetOutputStream().Printf(Asynchronous (not restricted 
to call-sites) UnwindPlan for %s`%s (start addr 0x% PRIx64 ):\n, 
sc.module_sp-GetPlatformFileSpec().GetFilename().AsCString(), 
funcname.AsCString(), start_addr);
-non_callsite_unwind_plan-Dump(result.GetOutputStream(), 
thread.get(), LLDB_INVALID_ADDRESS);
-result.GetOutputStream().Printf (\n);
+result.GetOutputStream().Printf(Asynchronous (not restricted 
to call-sites) 

[Lldb-commits] [lldb] r225771 - Add an additional check to UnwindAssembly_x86::AugmentUnwindPlanFromCallSite

2015-01-12 Thread Jason Molenda
Author: jmolenda
Date: Tue Jan 13 00:07:07 2015
New Revision: 225771

URL: http://llvm.org/viewvc/llvm-project?rev=225771view=rev
Log:
Add an additional check to UnwindAssembly_x86::AugmentUnwindPlanFromCallSite 
which will verify if the eh_frame instructions include details about
the prologue or not.  Both clang and gcc include prologue instructions
but there's no requirement for them to do so -- and I'm sure we'll
have to interoperate with a compiler that doesn't generate prologue
info at some point.

I don't have any compilers that omit the prologue instructions so the
testing was of the makre sure augmented unwind info is still created.
With an eh_frame without prologue, this code should reject the 
augmentation scheme altogether and we should fall back to using assembly
instruction profiling.


Modified:
lldb/trunk/include/lldb/Utility/RegisterNumber.h
lldb/trunk/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp
lldb/trunk/source/Utility/RegisterNumber.cpp

Modified: lldb/trunk/include/lldb/Utility/RegisterNumber.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Utility/RegisterNumber.h?rev=225771r1=225770r2=225771view=diff
==
--- lldb/trunk/include/lldb/Utility/RegisterNumber.h (original)
+++ lldb/trunk/include/lldb/Utility/RegisterNumber.h Tue Jan 13 00:07:07 2015
@@ -39,6 +39,9 @@ public:
 operator == (RegisterNumber rhs);
 
 bool
+operator != (RegisterNumber rhs);
+
+bool
 IsValid () const;
 
 uint32_t

Modified: lldb/trunk/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp?rev=225771r1=225770r2=225771view=diff
==
--- lldb/trunk/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp 
(original)
+++ lldb/trunk/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp Tue Jan 
13 00:07:07 2015
@@ -1229,16 +1229,42 @@ UnwindAssembly_x86::AugmentUnwindPlanFro
 UnwindPlan::RowSP first_row = unwind_plan.GetRowForFunctionOffset (0);
 UnwindPlan::RowSP last_row = unwind_plan.GetRowForFunctionOffset (-1);
 
-// If the UnwindPlan correctly describes the prologue and the epilogue, 
then
-// we shouldn't do any augmentation (and risk messing up correct unwind 
instructions)
+int wordsize = 8;
+ProcessSP process_sp (thread.GetProcess());
+if (process_sp)
+{
+wordsize = 
process_sp-GetTarget().GetArchitecture().GetAddressByteSize();
+}
 
-// See if the first row (which should be the register state on function 
entry)
-// and the last row (which should be the register state on function exit) 
match.
+RegisterNumber sp_regnum (thread, eRegisterKindGeneric, 
LLDB_REGNUM_GENERIC_SP);
+RegisterNumber pc_regnum (thread, eRegisterKindGeneric, 
LLDB_REGNUM_GENERIC_PC);
 
-if (first_row != last_row  first_row-GetOffset() != 
last_row-GetOffset())
+// Does this UnwindPlan describe the prologue?  I want to see that the CFA 
is set
+// in terms of the stack pointer plus an offset, and I want to see that 
rip is 
+// retrieved at the CFA-wordsize.
+// If there is no description of the prologue, don't try to augment this 
eh_frame
+// unwinder code, fall back to assembly parsing instead.
+
+if (first_row-GetCFAType() != 
UnwindPlan::Row::CFAType::CFAIsRegisterPlusOffset
+|| RegisterNumber (thread, unwind_plan.GetRegisterKind(), 
first_row-GetCFARegister()) != sp_regnum
+|| first_row-GetCFAOffset() != wordsize)
 {
-RegisterNumber sp_regnum (thread, eRegisterKindGeneric, 
LLDB_REGNUM_GENERIC_SP);
+return false;
+}
+UnwindPlan::Row::RegisterLocation first_row_pc_loc;
+if (first_row-GetRegisterInfo (pc_regnum.GetAsKind 
(unwind_plan.GetRegisterKind()), first_row_pc_loc) == false
+|| first_row_pc_loc.IsAtCFAPlusOffset() == false
+|| first_row_pc_loc.GetOffset() != -wordsize)
+{
+return false;
+}
+
 
+// It looks like the prologue is described.  Now check to see if the 
epilogue has the same
+// unwind state.
+
+if (first_row != last_row  first_row-GetOffset() != 
last_row-GetOffset())
+{
 // The first  last row have the same CFA register
 // and the same CFA offset value
 // and the CFA register is esp/rsp (the stack pointer).
@@ -1246,23 +1272,16 @@ UnwindAssembly_x86::AugmentUnwindPlanFro
 // We're checking that both of them have an unwind rule like 
CFA=esp+4 or CFA+rsp+8.
 
 if (first_row-GetCFAType() == last_row-GetCFAType()
- first_row-GetCFAType() == 
UnwindPlan::Row::CFAType::CFAIsRegisterPlusOffset
  first_row-GetCFARegister() == last_row-GetCFARegister()
- first_row-GetCFAOffset() == last_row-GetCFAOffset()
- 

[Lldb-commits] [lldb] r225773 - Enhance the eh_frame unwind instruction augmenter so that

2015-01-12 Thread Jason Molenda
Author: jmolenda
Date: Tue Jan 13 01:39:03 2015
New Revision: 225773

URL: http://llvm.org/viewvc/llvm-project?rev=225773view=rev
Log:
Enhance the eh_frame unwind instruction augmenter so that
it will do the right thing on x86 routines with a mid-function
epilogue sequence (where the unwind rules need to be reinstalled
after the epilogue has completed).
rdar://problem/19417410 

Modified:
lldb/trunk/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp

Modified: lldb/trunk/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp?rev=225773r1=225772r2=225773view=diff
==
--- lldb/trunk/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp 
(original)
+++ lldb/trunk/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp Tue Jan 
13 01:39:03 2015
@@ -818,10 +818,19 @@ AssemblyParse_x86::get_non_call_site_unw
 row_updated = true;
 }
 
-// FIXME recognize the i386 picbase setup instruction sequence,
-// 0x1f16:  call   0x1f1b   ; main + 11 at 
/private/tmp/a.c:3
-// 0x1f1b:  popl   %eax
-// and record the temporary stack movements if the CFA is not 
expressed in terms of ebp.
+// call next instruction
+// call 0
+//  = pop  %ebx
+// This is used in i386 programs to get the PIC base address for 
finding global data
+else if (call_next_insn_pattern_p ())
+{
+current_sp_bytes_offset_from_cfa += m_wordsize;
+if (row-GetCFARegister() == m_lldb_sp_regnum)
+{
+row-SetCFAOffset (current_sp_bytes_offset_from_cfa);
+row_updated = true;
+}
+}
 
 if (row_updated)
 {
@@ -884,12 +893,20 @@ AssemblyParse_x86::augment_unwind_plan_f
 if (cfa_reg != m_lldb_sp_regnum || first_row-GetCFAOffset() != m_wordsize)
 return false;
 
+UnwindPlan::RowSP original_last_row = unwind_plan.GetRowForFunctionOffset 
(-1);
+
 Target *target = m_exe_ctx.GetTargetPtr();
 m_cur_insn = func.GetBaseAddress();
 uint64_t offset = 0;
 int row_id = 1;
 bool unwind_plan_updated = false;
 UnwindPlan::RowSP row(new UnwindPlan::Row(*first_row));
+
+// After a mid-function epilogue we will need to re-insert the original 
unwind rules
+// so unwinds work for the remainder of the function.  These aren't common 
with clang/gcc
+// on x86 but it is possible.
+bool reinstate_unwind_state = false;
+
 while (func.ContainsFileAddress (m_cur_insn))
 {
 int insn_len;
@@ -912,6 +929,23 @@ AssemblyParse_x86::augment_unwind_plan_f
 offset += insn_len;
 m_cur_insn.SetOffset(m_cur_insn.GetOffset() + insn_len);
 
+if (reinstate_unwind_state)
+{
+// that was the last instruction of this function
+if (func.ContainsFileAddress (m_cur_insn) == false)
+continue;
+
+UnwindPlan::RowSP new_row(new UnwindPlan::Row());
+*new_row = *original_last_row;
+new_row-SetOffset (offset);
+unwind_plan.AppendRow (new_row);
+row.reset (new UnwindPlan::Row());
+*row = *new_row;
+reinstate_unwind_state = false;
+unwind_plan_updated = true;
+continue;
+}
+
 // If we already have one row for this instruction, we can continue.
 while (row_id  unwind_plan.GetRowCount()
 unwind_plan.GetRowAtIndex (row_id)-GetOffset() = offset)
@@ -1016,6 +1050,11 @@ AssemblyParse_x86::augment_unwind_plan_f
 unwind_plan_updated = true;
 continue;
 }
+if (ret_pattern_p ())
+{
+reinstate_unwind_state = true;
+continue;
+}
 }
 else if (cfa_reg == m_lldb_fp_regnum)
 {
@@ -1037,6 +1076,7 @@ AssemblyParse_x86::augment_unwind_plan_f
 UnwindPlan::RowSP new_row(new UnwindPlan::Row(*row));
 unwind_plan.InsertRow (new_row);
 unwind_plan_updated = true;
+reinstate_unwind_state = true;
 continue;
 }
 }
@@ -1260,8 +1300,8 @@ UnwindAssembly_x86::AugmentUnwindPlanFro
 }
 
 
-// It looks like the prologue is described.  Now check to see if the 
epilogue has the same
-// unwind state.
+// It looks like the prologue is described.  
+// Is the epilogue described?  If it is, no need to do any augmentation.
 
 if (first_row != last_row  first_row-GetOffset() != 
last_row-GetOffset())
 {


___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] test: ignore IOError in Base.deletePexpectChild and clean TestMySyntax test

2015-01-12 Thread Abid, Hafiz
It seems that your 2nd patch is needed. I will look at it tomorrow.

Thanks,
Abid

From: Ilia K [mailto:ki.s...@gmail.com]
Sent: 12 January 2015 13:27
To: Abid, Hafiz
Cc: lldb-commits@cs.uiuc.edu
Subject: Re: [Lldb-commits] [PATCH] test: ignore IOError in 
Base.deletePexpectChild and clean TestMySyntax test

Hello,

One more test failed:
{code}
==
ERROR: test_lldbmi_sourceoption (TestMiStartupOptions.MiStartupOptionsTestCase)
Test that 'lldb-mi --interpreter' can execute a prepared file which passed 
via --source option.
--
Traceback (most recent call last):
  File /Users/IliaK/p/llvm/tools/lldb/test/lldbtest.py, line 1767, in tearDown
Base.tearDown(self)
  File /Users/IliaK/p/llvm/tools/lldb/test/lldbtest.py, line 1087, in tearDown
self.deletePexpectChild()
  File /Users/IliaK/p/llvm/tools/lldb/test/lldbtest.py, line 1072, in 
deletePexpectChild
self.child.sendline('settings set interpreter.prompt-on-quit false')
  File /Users/IliaK/p/llvm/tools/lldb/test/pexpect-2.4/pexpect.py, line 966, 
in sendline
n = self.send(s)
  File /Users/IliaK/p/llvm/tools/lldb/test/pexpect-2.4/pexpect.py, line 958, 
in send
c = os.write(self.child_fd, s)
OSError: [Errno 5] Input/output error
Config=x86_64-clang
{code}

Thanks,
Ilia


On Mon, Jan 12, 2015 at 4:24 PM, Ilia K 
ki.s...@gmail.commailto:ki.s...@gmail.com wrote:
Hello Abid,

Cleanup didn't help and I got the error again:
{code}
==
ERROR: test_lldbmi_eval (TestMiEvaluate.MiEvaluateTestCase)
Test that 'lldb-mi --interpreter' works for evaluating.
--
Traceback (most recent call last):
  File /Users/IliaK/p/llvm/tools/lldb/test/lldbtest.py, line 1767, in tearDown
Base.tearDown(self)
  File /Users/IliaK/p/llvm/tools/lldb/test/lldbtest.py, line 1087, in tearDown
self.deletePexpectChild()
  File /Users/IliaK/p/llvm/tools/lldb/test/lldbtest.py, line 1072, in 
deletePexpectChild
self.child.sendline('settings set interpreter.prompt-on-quit false')
  File /Users/IliaK/p/llvm/tools/lldb/test/pexpect-2.4/pexpect.py, line 966, 
in sendline
n = self.send(s)
  File /Users/IliaK/p/llvm/tools/lldb/test/pexpect-2.4/pexpect.py, line 958, 
in send
c = os.write(self.child_fd, s)
OSError: [Errno 5] Input/output error
Config=x86_64-clang
{code}

Could you submit IOError patch?

Thanks,
Ilia


On Tue, Dec 30, 2014 at 9:16 PM, Ilia K 
ki.s...@gmail.commailto:ki.s...@gmail.com wrote:
Nope, it didn't help:

{code}
==
ERROR: test_lldbmi_pendbreakonsym (TestMiBreakpoint.MiBreakpointTestCase)
   Test that 'lldb-mi --interpreter' works for pending symbol breakpoints.
--
Traceback (most recent call last):
  File /Users/IliaK/p/llvm/tools/lldb/test/lldbtest.py, line 1765, in tearDown
Base.tearDown(self)
  File /Users/IliaK/p/llvm/tools/lldb/test/lldbtest.py, line 1087, in tearDown
self.deletePexpectChild()
  File /Users/IliaK/p/llvm/tools/lldb/test/lldbtest.py, line 1072, in 
deletePexpectChild
self.child.sendline('settings set interpreter.prompt-on-quit false')
  File /Users/IliaK/p/llvm/tools/lldb/test/pexpect-2.4/pexpect.py, line 966, 
in sendline
n = self.send(s)
  File /Users/IliaK/p/llvm/tools/lldb/test/pexpect-2.4/pexpect.py, line 958, 
in send
c = os.write(self.child_fd, s)
OSError: [Errno 5] Input/output error
Config=x86_64-clang
{code}

Thanks,
Ilia


On Tue, Dec 30, 2014 at 8:15 PM, Abid, Hafiz 
hafiz_a...@mentor.commailto:hafiz_a...@mentor.com wrote:
I committed the cleanup in 224990. Please have a look and let me know if you 
see a problem.

Regards,
Abid

From: Ilia K [ki.s...@gmail.commailto:ki.s...@gmail.com]
Sent: Tuesday, December 30, 2014 4:50 PM

To: Abid, Hafiz
Cc: lldb-commits@cs.uiuc.edumailto:lldb-commits@cs.uiuc.edu
Subject: Re: [Lldb-commits] [PATCH] test: ignore IOError in 
Base.deletePexpectChild and clean TestMySyntax test

Now I have modified breakpoint's test and IOError sometimes happens:
{code}
$ ./dotest.py -v --executable $BUILDDIR/bin/lldb -f 
MiBreakpointTestCase.test_lldbmi_pendbreakonsym
['./dotest.py', '-v', '--executable', 
'/Users/IliaK/p/llvm/build_ninja/bin/lldb', '-f', 
'MiBreakpointTestCase.test_lldbmi_pendbreakonsym']
LLDB library dir: /Users/IliaK/p/llvm/build_ninja/bin
lldb-330.99.0
lldb.pre_flight: None
lldb.post_flight: None

Session logs for test failures/errors/unexpected successes will go into 
directory '2014-12-30-19_45_12'
Command invoked: ./dotest.py -v --executable 
/Users/IliaK/p/llvm/build_ninja/bin/lldb -f 
MiBreakpointTestCase.test_lldbmi_pendbreakonsym
compilers=['clang']

Configuration: arch=x86_64 compiler=clang