Re: [Lldb-commits] [PATCH] D17847: [SemaExprCXX] Avoid calling isInSystemHeader for invalid source locations

2016-03-04 Thread Pavel Labath via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL262700: [SemaExprCXX] Avoid calling isInSystemHeader for 
invalid source locations (authored by labath).

Changed prior to commit:
  http://reviews.llvm.org/D17847?vs=49725&id=49805#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D17847

Files:
  cfe/trunk/lib/Sema/SemaExprCXX.cpp

Index: cfe/trunk/lib/Sema/SemaExprCXX.cpp
===
--- cfe/trunk/lib/Sema/SemaExprCXX.cpp
+++ cfe/trunk/lib/Sema/SemaExprCXX.cpp
@@ -1551,7 +1551,8 @@
   // new.
   if (PlacementArgs.empty() && OperatorNew &&
   (OperatorNew->isImplicit() ||
-   getSourceManager().isInSystemHeader(OperatorNew->getLocStart( {
+   (OperatorNew->getLocStart().isValid() &&
+getSourceManager().isInSystemHeader(OperatorNew->getLocStart() {
 if (unsigned Align = 
Context.getPreferredTypeAlign(AllocType.getTypePtr())){
   unsigned SuitableAlign = Context.getTargetInfo().getSuitableAlign();
   if (Align > SuitableAlign)


Index: cfe/trunk/lib/Sema/SemaExprCXX.cpp
===
--- cfe/trunk/lib/Sema/SemaExprCXX.cpp
+++ cfe/trunk/lib/Sema/SemaExprCXX.cpp
@@ -1551,7 +1551,8 @@
   // new.
   if (PlacementArgs.empty() && OperatorNew &&
   (OperatorNew->isImplicit() ||
-   getSourceManager().isInSystemHeader(OperatorNew->getLocStart( {
+   (OperatorNew->getLocStart().isValid() &&
+getSourceManager().isInSystemHeader(OperatorNew->getLocStart() {
 if (unsigned Align = Context.getPreferredTypeAlign(AllocType.getTypePtr())){
   unsigned SuitableAlign = Context.getTargetInfo().getSuitableAlign();
   if (Align > SuitableAlign)
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D17848: Add reverse file remapping for breakpoint set

2016-03-04 Thread Tamas Berghammer via lldb-commits
tberghammer added a comment.

It is a good point. I don't think displaying incorrect path for a breakpoint is 
a big issue so I don't plan to address it now but we should do it at some point.


http://reviews.llvm.org/D17848



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


Re: [Lldb-commits] [PATCH] D17848: Add reverse file remapping for breakpoint set

2016-03-04 Thread Tamas Berghammer via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL262711: Add reverse file remapping for breakpoint set 
(authored by tberghammer).

Changed prior to commit:
  http://reviews.llvm.org/D17848?vs=49732&id=49812#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D17848

Files:
  lldb/trunk/include/lldb/Target/PathMappingList.h
  lldb/trunk/packages/Python/lldbsuite/test/source-manager/TestSourceManager.py
  lldb/trunk/source/Target/PathMappingList.cpp
  lldb/trunk/source/Target/Target.cpp

Index: lldb/trunk/source/Target/Target.cpp
===
--- lldb/trunk/source/Target/Target.cpp
+++ lldb/trunk/source/Target/Target.cpp
@@ -348,6 +348,13 @@
   bool hardware,
   LazyBool move_to_nearest_code)
 {
+FileSpec remapped_file;
+ConstString remapped_path;
+if (GetSourcePathMap().ReverseRemapPath(ConstString(file.GetPath().c_str()), remapped_path))
+remapped_file.SetFile(remapped_path.AsCString(), true);
+else
+remapped_file = file;
+
 if (check_inlines == eLazyBoolCalculate)
 {
 const InlineStrategy inline_strategy = GetInlineStrategy();
@@ -358,7 +365,7 @@
 break;
 
 case eInlineBreakpointsHeaders:
-if (file.IsSourceImplementationFile())
+if (remapped_file.IsSourceImplementationFile())
 check_inlines = eLazyBoolNo;
 else
 check_inlines = eLazyBoolYes;
@@ -374,7 +381,7 @@
 {
 // Not checking for inlines, we are looking only for matching compile units
 FileSpecList compile_unit_list;
-compile_unit_list.Append (file);
+compile_unit_list.Append (remapped_file);
 filter_sp = GetSearchFilterForModuleAndCUList (containingModules, &compile_unit_list);
 }
 else
@@ -387,7 +394,7 @@
 move_to_nearest_code = GetMoveToNearestCode() ? eLazyBoolYes : eLazyBoolNo;
 
 BreakpointResolverSP resolver_sp(new BreakpointResolverFileLine(nullptr,
-file,
+remapped_file,
 line_no,
 check_inlines,
 skip_prologue,
Index: lldb/trunk/source/Target/PathMappingList.cpp
===
--- lldb/trunk/source/Target/PathMappingList.cpp
+++ lldb/trunk/source/Target/PathMappingList.cpp
@@ -215,6 +215,27 @@
 }
 
 bool
+PathMappingList::ReverseRemapPath (const ConstString &path, ConstString &new_path) const
+{
+const char *path_cstr = path.GetCString();
+if (!path_cstr)
+return false;
+
+for (const auto& it : m_pairs)
+{
+const size_t prefixLen = it.second.GetLength();
+if (::strncmp (it.second.GetCString(), path_cstr, prefixLen) == 0)
+{
+std::string new_path_str (it.first.GetCString());
+new_path_str.append(path.GetCString() + prefixLen);
+new_path.SetCString(new_path_str.c_str());
+return true;
+}
+}
+return false;
+}
+
+bool
 PathMappingList::FindFile (const FileSpec &orig_spec, FileSpec &new_spec) const
 {
 if (!m_pairs.empty())
Index: lldb/trunk/include/lldb/Target/PathMappingList.h
===
--- lldb/trunk/include/lldb/Target/PathMappingList.h
+++ lldb/trunk/include/lldb/Target/PathMappingList.h
@@ -116,7 +116,9 @@
 bool
 RemapPath (const char *path, std::string &new_path) const;
 
-
+bool
+ReverseRemapPath (const ConstString &path, ConstString &new_path) const;
+
 //--
 /// Finds a source file given a file spec using the path remappings.
 ///
Index: lldb/trunk/packages/Python/lldbsuite/test/source-manager/TestSourceManager.py
===
--- lldb/trunk/packages/Python/lldbsuite/test/source-manager/TestSourceManager.py
+++ lldb/trunk/packages/Python/lldbsuite/test/source-manager/TestSourceManager.py
@@ -170,3 +170,21 @@
 # Display the source code again.  We should see the updated line.
 self.expect("source list -f main.c -l %d" % self.line, SOURCE_DISPLAYED_CORRECTLY,
 substrs = ['Hello lldb'])
+
+def test_set_breakpoint_with_absloute_path(self):
+self.build()
+self.runCmd("settings set target.source-map %s %s" % (os.getcwd(), os.path.join(os.getcwd(), "hidden")))
+
+exe = os.path.join(os.getcwd(), "a.out")
+main = os.path.join(os.getcwd(), "hidden", "main.c")
+self.runCmd("file " + exe, 

[Lldb-commits] [lldb] r262711 - Add reverse file remapping for breakpoint set

2016-03-04 Thread Tamas Berghammer via lldb-commits
Author: tberghammer
Date: Fri Mar  4 05:26:44 2016
New Revision: 262711

URL: http://llvm.org/viewvc/llvm-project?rev=262711&view=rev
Log:
Add reverse file remapping for breakpoint set

LLDB can remap a source file to a new directory based on the
"target.sorce-map" to handle the usecase when the source code moved
between the compliation and the debugging. Previously the remapping
was only used to display the content of the file. This CL fixes the
scenario when a breakpoint is set based on the new an absolute path
with adding an inverse remapping step before looking up the breakpoint
location.

Differential revision: http://reviews.llvm.org/D17848

Modified:
lldb/trunk/include/lldb/Target/PathMappingList.h

lldb/trunk/packages/Python/lldbsuite/test/source-manager/TestSourceManager.py
lldb/trunk/source/Target/PathMappingList.cpp
lldb/trunk/source/Target/Target.cpp

Modified: lldb/trunk/include/lldb/Target/PathMappingList.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/PathMappingList.h?rev=262711&r1=262710&r2=262711&view=diff
==
--- lldb/trunk/include/lldb/Target/PathMappingList.h (original)
+++ lldb/trunk/include/lldb/Target/PathMappingList.h Fri Mar  4 05:26:44 2016
@@ -116,7 +116,9 @@ public:
 bool
 RemapPath (const char *path, std::string &new_path) const;
 
-
+bool
+ReverseRemapPath (const ConstString &path, ConstString &new_path) const;
+
 //--
 /// Finds a source file given a file spec using the path remappings.
 ///

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/source-manager/TestSourceManager.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/source-manager/TestSourceManager.py?rev=262711&r1=262710&r2=262711&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/source-manager/TestSourceManager.py 
(original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/source-manager/TestSourceManager.py 
Fri Mar  4 05:26:44 2016
@@ -170,3 +170,21 @@ class SourceManagerTestCase(TestBase):
 # Display the source code again.  We should see the updated line.
 self.expect("source list -f main.c -l %d" % self.line, 
SOURCE_DISPLAYED_CORRECTLY,
 substrs = ['Hello lldb'])
+
+def test_set_breakpoint_with_absloute_path(self):
+self.build()
+self.runCmd("settings set target.source-map %s %s" % (os.getcwd(), 
os.path.join(os.getcwd(), "hidden")))
+
+exe = os.path.join(os.getcwd(), "a.out")
+main = os.path.join(os.getcwd(), "hidden", "main.c")
+self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
+
+lldbutil.run_break_set_by_file_and_line (self, main, self.line, 
num_expected_locations=1, loc_exact=False)
+
+self.runCmd("run", RUN_SUCCEEDED)
+
+# The stop reason of the thread should be breakpoint.
+self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
+substrs = ['stopped',
+   'main.c:%d' % self.line,
+   'stop reason = breakpoint'])

Modified: lldb/trunk/source/Target/PathMappingList.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/PathMappingList.cpp?rev=262711&r1=262710&r2=262711&view=diff
==
--- lldb/trunk/source/Target/PathMappingList.cpp (original)
+++ lldb/trunk/source/Target/PathMappingList.cpp Fri Mar  4 05:26:44 2016
@@ -215,6 +215,27 @@ PathMappingList::RemapPath (const char *
 }
 
 bool
+PathMappingList::ReverseRemapPath (const ConstString &path, ConstString 
&new_path) const
+{
+const char *path_cstr = path.GetCString();
+if (!path_cstr)
+return false;
+
+for (const auto& it : m_pairs)
+{
+const size_t prefixLen = it.second.GetLength();
+if (::strncmp (it.second.GetCString(), path_cstr, prefixLen) == 0)
+{
+std::string new_path_str (it.first.GetCString());
+new_path_str.append(path.GetCString() + prefixLen);
+new_path.SetCString(new_path_str.c_str());
+return true;
+}
+}
+return false;
+}
+
+bool
 PathMappingList::FindFile (const FileSpec &orig_spec, FileSpec &new_spec) const
 {
 if (!m_pairs.empty())

Modified: lldb/trunk/source/Target/Target.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Target.cpp?rev=262711&r1=262710&r2=262711&view=diff
==
--- lldb/trunk/source/Target/Target.cpp (original)
+++ lldb/trunk/source/Target/Target.cpp Fri Mar  4 05:26:44 2016
@@ -348,6 +348,13 @@ Target::CreateBreakpoint (const FileSpec
   bool hardware,
   LazyBool move_to_nearest_c

[Lldb-commits] [lldb] r262713 - Resumbit "Fetch remote log files from LLGS tests"

2016-03-04 Thread Pavel Labath via lldb-commits
Author: labath
Date: Fri Mar  4 05:27:00 2016
New Revision: 262713

URL: http://llvm.org/viewvc/llvm-project?rev=262713&view=rev
Log:
Resumbit "Fetch remote log files from LLGS tests"

The problem with the original patch (and my first attempt to fix) was that the 
value debug
monitor flags could persist from one test to another. Resetting the value in 
the setUp() function
fixes the problem.

Modified:

lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py?rev=262713&r1=262712&r2=262713&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py
 Fri Mar  4 05:27:00 2016
@@ -73,6 +73,8 @@ class GdbRemoteTestCaseBase(TestBase):
 TestBase.setUp(self)
 
 self.setUpBaseLogging()
+self._remote_server_log_file = None
+self.debug_monitor_extra_args = []
 
 if self.isVerboseLoggingRequested():
 # If requested, full logs go to a log file
@@ -104,10 +106,35 @@ class GdbRemoteTestCaseBase(TestBase):
 self.stub_hostname = "localhost"
 
 def tearDown(self):
+if self._remote_server_log_file is not None:
+
lldb.remote_platform.Get(lldb.SBFileSpec(self._remote_server_log_file),
+lldb.SBFileSpec(self.getLocalServerLogFile()))
+lldb.remote_platform.Run(lldb.SBPlatformShellCommand("rm " + 
self._remote_server_log_file))
+self._remote_server_log_file = None
+
 self.logger.removeHandler(self._verbose_log_handler)
 self._verbose_log_handler = None
 TestBase.tearDown(self)
 
+def getLocalServerLogFile(self):
+return self.log_basename + "-server.log"
+
+def setUpServerLogging(self, is_llgs):
+if len(lldbtest_config.channels) == 0:
+return # No logging requested
+
+if lldb.remote_platform:
+log_file = 
lldbutil.join_remote_paths(lldb.remote_platform.GetWorkingDirectory(), 
"server.log")
+self._remote_server_log_file = log_file
+else:
+log_file = self.getLocalServerLogFile()
+
+if is_llgs:
+self.debug_monitor_extra_args.append("--log-file=" + log_file)
+
self.debug_monitor_extra_args.append("--log-channels={}".format(":".join(lldbtest_config.channels)))
+else:
+self.debug_monitor_extra_args = ["--log-file=" + self.log_file, 
"--log-flags=0x80"]
+
 def get_next_port(self):
 return 12000 + random.randint(0,3999)
 
@@ -214,10 +241,7 @@ class GdbRemoteTestCaseBase(TestBase):
 self.skipTest("lldb-server exe not found")
 
 self.debug_monitor_extra_args = ["gdbserver"]
-
-if len(lldbtest_config.channels) > 0:
-
self.debug_monitor_extra_args.append("--log-file={}-server.log".format(self.log_basename))
-
self.debug_monitor_extra_args.append("--log-channels={}".format(":".join(lldbtest_config.channels)))
+self.setUpServerLogging(is_llgs=True)
 
 if use_named_pipe:
 (self.named_pipe_path, self.named_pipe, self.named_pipe_fd) = 
self.create_named_pipe()
@@ -226,7 +250,7 @@ class GdbRemoteTestCaseBase(TestBase):
 self.debug_monitor_exe = get_debugserver_exe()
 if not self.debug_monitor_exe:
 self.skipTest("debugserver exe not found")
-self.debug_monitor_extra_args = 
["--log-file={}-server.log".format(self.log_basename), "--log-flags=0x80"]
+self.setUpServerLogging(is_llgs=False)
 if use_named_pipe:
 (self.named_pipe_path, self.named_pipe, self.named_pipe_fd) = 
self.create_named_pipe()
 # The debugserver stub has a race on handling the 'k' command, so it 
sends an X09 right away, then sends the real X notification


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


[Lldb-commits] [lldb] r262712 - Fix warning in IRExecutionUnit.cpp

2016-03-04 Thread Pavel Labath via lldb-commits
Author: labath
Date: Fri Mar  4 05:26:56 2016
New Revision: 262712

URL: http://llvm.org/viewvc/llvm-project?rev=262712&view=rev
Log:
Fix warning in IRExecutionUnit.cpp

Modified:
lldb/trunk/source/Expression/IRExecutionUnit.cpp

Modified: lldb/trunk/source/Expression/IRExecutionUnit.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/IRExecutionUnit.cpp?rev=262712&r1=262711&r2=262712&view=diff
==
--- lldb/trunk/source/Expression/IRExecutionUnit.cpp (original)
+++ lldb/trunk/source/Expression/IRExecutionUnit.cpp Fri Mar  4 05:26:56 2016
@@ -802,10 +802,12 @@ IRExecutionUnit::FindInSymbols(const std
 load_address = 
candidate_sc.symbol->ResolveCallableAddress(*target);
 
 if (load_address == LLDB_INVALID_ADDRESS)
+{
 if (target->GetProcessSP())
 load_address = 
candidate_sc.symbol->GetAddress().GetLoadAddress(target);
 else
 load_address = 
candidate_sc.symbol->GetAddress().GetFileAddress();
+}
 
 if (load_address != LLDB_INVALID_ADDRESS)
 {


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


[Lldb-commits] [lldb] r262715 - Add a log statement

2016-03-04 Thread Pavel Labath via lldb-commits
Author: labath
Date: Fri Mar  4 06:43:05 2016
New Revision: 262715

URL: http://llvm.org/viewvc/llvm-project?rev=262715&view=rev
Log:
Add a log statement

Modified:

lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py?rev=262715&r1=262714&r2=262715&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py
 Fri Mar  4 06:43:05 2016
@@ -273,6 +273,7 @@ class GdbRemoteTestCaseBase(TestBase):
 if re.match(".*-.*-.*-android", triple):
 self.forward_adb_port(self.port, self.port, "forward", 
self.stub_device)
 
+logger.info("Connecting to debug monitor on %s:%d", 
self.stub_hostname, self.port)
 connect_info = (self.stub_hostname, self.port)
 sock.connect(connect_info)
 


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


[Lldb-commits] Proposed fix for LLDB GUI segfault when continuing with the thread list expanded (bug 26842)

2016-03-04 Thread Mark Grimes via lldb-commits
Hi,
I also filed bug 26842 , I
wasn't sure if both a bug report and mail here were required?

As described there, there's a segfault if the list of frames in the
"Threads" GUI window is open and a "continue" is made to somewhere where
the frame list is different.  After filing the bug report it occurred to me
that the segfault might only be triggered if the list of threads also
changes.  I'm not sure but I can provide an example program if required but
I still think it's very easy to reproduce.

The reason the crash occurs is described on the bug report, and a patch of
a proposed fix is attached here.  It's literally two lines - I haven't
added any tests because it's the GUI and requires human interaction, and I
have no idea how to automate that.

Thanks,

Mark.
===
--- source/Core/IOHandler.cpp   (revision 262725)
+++ source/Core/IOHandler.cpp   (working copy)
@@ -3309,6 +3309,7 @@
 
 TreeItem t (&item, *m_frame_delegate_sp, false);
 size_t num_frames = thread_sp->GetStackFrameCount();
+item.ClearChildren(); // Clear first so that "t" is 
applied to all elements in the Resize
 item.Resize (num_frames, t);
 for (size_t i=0; iGetThreadList();
 Mutex::Locker locker (threads.GetMutex());
 size_t num_threads = threads.GetSize();
+item.ClearChildren(); // Clear first so that "t" is applied to 
all elements in the Resize
 item.Resize (num_threads, t);
 for (size_t i=0; i___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r262739 - Update after r262737 in clang changed the accessor.

2016-03-04 Thread James Y Knight via lldb-commits
Author: jyknight
Date: Fri Mar  4 13:30:53 2016
New Revision: 262739

URL: http://llvm.org/viewvc/llvm-project?rev=262739&view=rev
Log:
Update after r262737 in clang changed the accessor.

Modified:
lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp

Modified: 
lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp?rev=262739&r1=262738&r2=262739&view=diff
==
--- lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp 
(original)
+++ lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp 
Fri Mar  4 13:30:53 2016
@@ -254,7 +254,7 @@ ClangExpressionParser::ClangExpressionPa
 if (log)
 {
 log->Printf("Using SIMD alignment: %d", 
target_info->getSimdDefaultAlign());
-log->Printf("Target datalayout string: '%s'", 
target_info->getDataLayoutString());
+log->Printf("Target datalayout string: '%s'", 
target_info->getDataLayout().getStringRepresentation().c_str());
 log->Printf("Target ABI: '%s'", target_info->getABI().str().c_str());
 log->Printf("Target vector alignment: %d", 
target_info->getMaxVectorAlign());
 }


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


[Lldb-commits] [PATCH] D17897: Support floating point values in 128-bit SSE vector registers

2016-03-04 Thread Adrian Prantl via lldb-commits
aprantl created this revision.
aprantl added a reviewer: clayborg.
aprantl added a subscriber: lldb-commits.
aprantl set the repository for this revision to rL LLVM.

The System-V x86_64 ABI requires floating point values to be passed in 128-but 
SSE vector registers (xmm0, ...).
When printing such a variable this currently yields an .

This patch makes LLDB's DWARF expression evaluator accept 128-bit registers as 
scalars. It also relaxes the check that the size of the result of the DWARF 
expression be equal to the size of the variable to a greater-than. DWARF defers 
to the ABI how smaller values are being placed in a larger register.

Implementation note: I found the code in Value::SetContext() that changes the 
m_value_type after the fact to be questionable. I added a sanity check that the 
Value's memory buffer has indeed been written to (this is necessary, because we 
may have a scalar value in a vector register), but really I feel like this is 
the wrong place to be setting it.



Repository:
  rL LLVM

http://reviews.llvm.org/D17897

Files:
  include/lldb/Core/Value.h
  
packages/Python/lldbsuite/test/lang/c/register_variables/TestRegisterVariables.py
  packages/Python/lldbsuite/test/lang/c/register_variables/test.c
  source/Core/RegisterValue.cpp
  source/Expression/Materializer.cpp

Index: source/Expression/Materializer.cpp
===
--- source/Expression/Materializer.cpp
+++ source/Expression/Materializer.cpp
@@ -531,15 +531,15 @@
 return;
 }
 
-if (data.GetByteSize() != m_variable_sp->GetType()->GetByteSize())
+if (data.GetByteSize() < m_variable_sp->GetType()->GetByteSize())
 {
 if (data.GetByteSize() == 0 && m_variable_sp->LocationExpression().IsValid() == false)
 {
 err.SetErrorStringWithFormat("the variable '%s' has no location, it may have been optimized out", m_variable_sp->GetName().AsCString());
 }
 else
 {
-err.SetErrorStringWithFormat("size of variable %s (%" PRIu64 ") disagrees with the ValueObject's size (%" PRIu64 ")",
+err.SetErrorStringWithFormat("size of variable %s (%" PRIu64 ") is larger than the ValueObject's size (%" PRIu64 ")",
  m_variable_sp->GetName().AsCString(),
  m_variable_sp->GetType()->GetByteSize(),
  data.GetByteSize());
Index: source/Core/RegisterValue.cpp
===
--- source/Core/RegisterValue.cpp
+++ source/Core/RegisterValue.cpp
@@ -247,6 +247,9 @@
 case 2: scalar = *(const uint16_t *)buffer.bytes; return true;
 case 4: scalar = *(const uint32_t *)buffer.bytes; return true;
 case 8: scalar = *(const uint64_t *)buffer.bytes; return true;
+case 16:
+scalar = llvm::APInt(128, llvm::ArrayRef((const uint64_t *)buffer.bytes, 2));
+return true;
 }
 }
 break;
@@ -374,6 +377,7 @@
 case eTypeLongDouble:   SetFloat (src.GetLongDouble (&src_offset)); break;
 case eTypeBytes:
 {
+m_type = eTypeBytes;
 buffer.length = reg_info->byte_size;
 buffer.byte_order = src.GetByteOrder();
 assert (buffer.length <= kMaxRegisterByteSize);
Index: packages/Python/lldbsuite/test/lang/c/register_variables/test.c
===
--- packages/Python/lldbsuite/test/lang/c/register_variables/test.c
+++ packages/Python/lldbsuite/test/lang/c/register_variables/test.c
@@ -18,10 +18,18 @@
   printf("%d\n", c); // set breakpoint here
 }
 
+float f3() __attribute__ ((noinline));
+float f3() {
+  return 3.14f;
+}
+
 int main()
 {
   struct bar myBar = { 3, 4 };
   f1(2, &myBar);
   f2(&myBar);
+
+  float f = f3();
+  printf("%f\n", f); // set breakpoint here
   return 0;
 }
Index: packages/Python/lldbsuite/test/lang/c/register_variables/TestRegisterVariables.py
===
--- packages/Python/lldbsuite/test/lang/c/register_variables/TestRegisterVariables.py
+++ packages/Python/lldbsuite/test/lang/c/register_variables/TestRegisterVariables.py
@@ -24,7 +24,7 @@
 self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
 # Break inside the main.
-lldbutil.run_break_set_by_source_regexp(self, "break", num_expected_locations=2)
+lldbutil.run_break_set_by_source_regexp(self, "break", num_expected_locations=3)
 
 
 # First breakpoint
@@ -68,4 +68,22 @@
 self.expect("expr c", VARIABLES_DI