diff options
| -rw-r--r-- | cmake/modules/LLDBConfig.cmake | 42 | ||||
| -rw-r--r-- | packages/Python/lldbsuite/test/lang/cpp/namespace_conflicts/Makefile | 3 | ||||
| -rw-r--r-- | packages/Python/lldbsuite/test/lang/cpp/namespace_conflicts/TestNamespaceConflicts.py | 7 | ||||
| -rw-r--r-- | packages/Python/lldbsuite/test/lang/cpp/namespace_conflicts/main.cpp | 29 | ||||
| -rw-r--r-- | tools/lldb-mi/MICmdCmdVar.cpp | 28 | ||||
| -rwxr-xr-x | www/projects.html | 19 | 
6 files changed, 91 insertions, 37 deletions
diff --git a/cmake/modules/LLDBConfig.cmake b/cmake/modules/LLDBConfig.cmake index 609851f46e49..79512941fd8d 100644 --- a/cmake/modules/LLDBConfig.cmake +++ b/cmake/modules/LLDBConfig.cmake @@ -334,28 +334,26 @@ if (HAVE_LIBDL)    list(APPEND system_libs ${CMAKE_DL_LIBS})  endif() -if (CMAKE_SYSTEM_NAME MATCHES "Linux") -    # Check for syscall used by lldb-server on linux. -    # If these are not found, it will fall back to ptrace (slow) for memory reads. -    check_cxx_source_compiles(" -        #include <sys/uio.h> -        int main() { process_vm_readv(0, nullptr, 0, nullptr, 0, 0); return 0; }" -        HAVE_PROCESS_VM_READV) - -    if (HAVE_PROCESS_VM_READV) -        add_definitions(-DHAVE_PROCESS_VM_READV) -    else() -        # If we don't have the syscall wrapper function, but we know the syscall number, we can -        # still issue the syscall manually -        check_cxx_source_compiles(" -            #include <sys/syscall.h> -            int main() { return __NR_process_vm_readv; }" -            HAVE_NR_PROCESS_VM_READV) - -        if (HAVE_NR_PROCESS_VM_READV) -            add_definitions(-DHAVE_NR_PROCESS_VM_READV) -        endif() -    endif() +# Check for syscall used by lldb-server on linux. +# If these are not found, it will fall back to ptrace (slow) for memory reads. +check_cxx_source_compiles(" +  #include <sys/uio.h> +  int main() { process_vm_readv(0, nullptr, 0, nullptr, 0, 0); return 0; }" +  HAVE_PROCESS_VM_READV) + +if (HAVE_PROCESS_VM_READV) +  add_definitions(-DHAVE_PROCESS_VM_READV) +else() +  # If we don't have the syscall wrapper function, but we know the syscall number, we can +  # still issue the syscall manually +  check_cxx_source_compiles(" +      #include <sys/syscall.h> +      int main() { return __NR_process_vm_readv; }" +      HAVE_NR_PROCESS_VM_READV) + +  if (HAVE_NR_PROCESS_VM_READV) +      add_definitions(-DHAVE_NR_PROCESS_VM_READV) +  endif()  endif()  # Figure out if lldb could use lldb-server.  If so, then we'll diff --git a/packages/Python/lldbsuite/test/lang/cpp/namespace_conflicts/Makefile b/packages/Python/lldbsuite/test/lang/cpp/namespace_conflicts/Makefile new file mode 100644 index 000000000000..99bfa7e03b47 --- /dev/null +++ b/packages/Python/lldbsuite/test/lang/cpp/namespace_conflicts/Makefile @@ -0,0 +1,3 @@ +LEVEL = ../../../make +CXX_SOURCES := main.cpp +include $(LEVEL)/Makefile.rules diff --git a/packages/Python/lldbsuite/test/lang/cpp/namespace_conflicts/TestNamespaceConflicts.py b/packages/Python/lldbsuite/test/lang/cpp/namespace_conflicts/TestNamespaceConflicts.py new file mode 100644 index 000000000000..af362f5be5d7 --- /dev/null +++ b/packages/Python/lldbsuite/test/lang/cpp/namespace_conflicts/TestNamespaceConflicts.py @@ -0,0 +1,7 @@ +from lldbsuite.test import lldbinline +from lldbsuite.test import decorators + +lldbinline.MakeInlineTest( +    __file__, globals(), [ +        decorators.expectedFailureAll( +            oslist=["windows"], bugnumber="llvm.org/pr24764")]) diff --git a/packages/Python/lldbsuite/test/lang/cpp/namespace_conflicts/main.cpp b/packages/Python/lldbsuite/test/lang/cpp/namespace_conflicts/main.cpp new file mode 100644 index 000000000000..5dfca5b7f996 --- /dev/null +++ b/packages/Python/lldbsuite/test/lang/cpp/namespace_conflicts/main.cpp @@ -0,0 +1,29 @@ +//===-- main.cpp ------------------------------------------------*- C++ -*-===// +// +//                     The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +namespace n { +    struct D { +        int i; +        static int anInt() { return 2; } +        int dump() { return i; } +    }; +} + +using namespace n; + +int foo(D* D) { +    return D->dump(); //% self.expect("expression -- D->dump()", DATA_TYPES_DISPLAYED_CORRECTLY, substrs = ["int", "2"]) +} + +int main (int argc, char const *argv[]) +{ +    D myD { D::anInt() }; +    foo(&myD); +    return 0;  +} diff --git a/tools/lldb-mi/MICmdCmdVar.cpp b/tools/lldb-mi/MICmdCmdVar.cpp index 3396b7231c5c..66b392be6bed 100644 --- a/tools/lldb-mi/MICmdCmdVar.cpp +++ b/tools/lldb-mi/MICmdCmdVar.cpp @@ -510,22 +510,20 @@ bool CMICmdCmdVarUpdate::ExamineSBValueForChange(lldb::SBValue &vrwValue,    }    lldb::SBType valueType = vrwValue.GetType(); -  if (!valueType.IsPointerType() && !valueType.IsReferenceType()) { -    const MIuint nChildren = vrwValue.GetNumChildren(); -    for (MIuint i = 0; i < nChildren; ++i) { -      lldb::SBValue member = vrwValue.GetChildAtIndex(i); -      if (!member.IsValid()) -        continue; - -      if (member.GetValueDidChange()) { -        vrwbChanged = true; -        return MIstatus::success; -      } else if (ExamineSBValueForChange(member, vrwbChanged) && vrwbChanged) -        // Handle composite types (i.e. struct or arrays) -        return MIstatus::success; -    } -  } +  const MIuint nChildren = vrwValue.GetNumChildren(); +  for (MIuint i = 0; i < nChildren; ++i) { +    lldb::SBValue member = vrwValue.GetChildAtIndex(i); +    if (!member.IsValid()) +      continue; + +    if (member.GetValueDidChange()) { +      vrwbChanged = true; +      return MIstatus::success; +    } else if (ExamineSBValueForChange(member, vrwbChanged) && vrwbChanged) +      // Handle composite types (i.e. struct or arrays) +      return MIstatus::success; +  }    vrwbChanged = false;    return MIstatus::success;  } diff --git a/www/projects.html b/www/projects.html index b1aeb1021eca..e375eb9cc3d2 100755 --- a/www/projects.html +++ b/www/projects.html @@ -244,6 +244,25 @@                                              </li>                                              <li> +                                              Reimplement the command interpreter commands using the SB API +                                              <p> +                                                Currently, all the CommandObject::DoExecute methods are implemented  +                                                using the lldb_private API's.  That generally means that there's code +                                                that gets duplicated between the CommandObject and the SB API that does +                                                roughly the same thing.  We would reduce this code duplication, present a +                                                single coherent face to the users of lldb, and keep +                                                ourselves more honest about what we need in the SB API's if we implemented +                                                the CommandObjects::DoExecute methods using the SB API's. +                                              </p> +                                              <p> +                                                BTW, it is only the way it was much easier to develop lldb if it had a functioning +                                                command-line early on.  So we did that first, and developed the SB API's when lldb +                                                was more mature.  There's no good technical reason to have the commands use the +                                                lldb_private API's. +                                              </p> +                                            </li> + +                                            <li>                                                Documentation and better examples                                                <p>  | 
