[Lldb-commits] [lldb] 03df971 - [lldb] Add support for debugging via the dynamic linker.

2021-09-10 Thread Rumeet Dhindsa via lldb-commits

Author: Rumeet Dhindsa
Date: 2021-09-10T10:59:31-07:00
New Revision: 03df97101287e8cb647c6c0982c4efdb82585c21

URL: 
https://github.com/llvm/llvm-project/commit/03df97101287e8cb647c6c0982c4efdb82585c21
DIFF: 
https://github.com/llvm/llvm-project/commit/03df97101287e8cb647c6c0982c4efdb82585c21.diff

LOG: [lldb] Add support for debugging via the dynamic linker.

This patch adds support for shared library load when the executable is
called through ld.so.

Differential Revision:https://reviews.llvm.org/D108061

Added: 
lldb/test/API/functionalities/dyld-launch-linux/Makefile
lldb/test/API/functionalities/dyld-launch-linux/TestDyldLaunchLinux.py
lldb/test/API/functionalities/dyld-launch-linux/main.cpp
lldb/test/API/functionalities/dyld-launch-linux/signal_file.cpp
lldb/test/API/functionalities/dyld-launch-linux/signal_file.h

Modified: 
lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp
lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.h
lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp

Removed: 




diff  --git a/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp 
b/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp
index 866acbddbdc8a..7e80dc28e56b2 100644
--- a/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp
+++ b/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp
@@ -24,28 +24,35 @@
 using namespace lldb;
 using namespace lldb_private;
 
-/// Locates the address of the rendezvous structure.  Returns the address on
-/// success and LLDB_INVALID_ADDRESS on failure.
-static addr_t ResolveRendezvousAddress(Process *process) {
+DYLDRendezvous::DYLDRendezvous(Process *process)
+: m_process(process), m_rendezvous_addr(LLDB_INVALID_ADDRESS),
+  m_executable_interpreter(false), m_current(), m_previous(),
+  m_loaded_modules(), m_soentries(), m_added_soentries(),
+  m_removed_soentries() {
+  m_thread_info.valid = false;
+  UpdateExecutablePath();
+}
+
+addr_t DYLDRendezvous::ResolveRendezvousAddress() {
   Log *log(GetLogIfAnyCategoriesSet(LIBLLDB_LOG_DYNAMIC_LOADER));
   addr_t info_location;
   addr_t info_addr;
   Status error;
 
-  if (!process) {
+  if (!m_process) {
 LLDB_LOGF(log, "%s null process provided", __FUNCTION__);
 return LLDB_INVALID_ADDRESS;
   }
 
   // Try to get it from our process.  This might be a remote process and might
   // grab it via some remote-specific mechanism.
-  info_location = process->GetImageInfoAddress();
+  info_location = m_process->GetImageInfoAddress();
   LLDB_LOGF(log, "%s info_location = 0x%" PRIx64, __FUNCTION__, info_location);
 
   // If the process fails to return an address, fall back to seeing if the
   // local object file can help us find it.
   if (info_location == LLDB_INVALID_ADDRESS) {
-Target *target = &process->GetTarget();
+Target *target = &m_process->GetTarget();
 if (target) {
   ObjectFile *obj_file = target->GetExecutableModule()->GetObjectFile();
   Address addr = obj_file->GetImageInfoAddress(target);
@@ -56,6 +63,20 @@ static addr_t ResolveRendezvousAddress(Process *process) {
   "%s resolved via direct object file approach to 0x%" PRIx64,
   __FUNCTION__, info_location);
   } else {
+const Symbol *_r_debug =
+target->GetExecutableModule()->FindFirstSymbolWithNameAndType(
+ConstString("_r_debug"));
+if (_r_debug) {
+  info_addr = _r_debug->GetAddress().GetLoadAddress(target);
+  if (info_addr != LLDB_INVALID_ADDRESS) {
+LLDB_LOGF(log,
+  "%s resolved by finding symbol '_r_debug' whose value is 
"
+  "0x%" PRIx64,
+  __FUNCTION__, info_addr);
+m_executable_interpreter = true;
+return info_addr;
+  }
+}
 LLDB_LOGF(log,
   "%s FAILED - direct object file approach did not yield a "
   "valid address",
@@ -70,9 +91,9 @@ static addr_t ResolveRendezvousAddress(Process *process) {
   }
 
   LLDB_LOGF(log, "%s reading pointer (%" PRIu32 " bytes) from 0x%" PRIx64,
-__FUNCTION__, process->GetAddressByteSize(), info_location);
+__FUNCTION__, m_process->GetAddressByteSize(), info_location);
 
-  info_addr = process->ReadPointerFromMemory(info_location, error);
+  info_addr = m_process->ReadPointerFromMemory(info_location, error);
   if (error.Fail()) {
 LLDB_LOGF(log, "%s FAILED - could not read from the info location: %s",
   __FUNCTION__, error.AsCString());
@@ -90,14 +111,6 @@ static addr_t ResolveRendezvousAddress(Process *process) {
   return info_addr;
 }
 
-DYLDRendezvous::DYLDRendezvous(Process *process)
-: m_process(process), m_rendezvous_addr(LLDB_INVALID_ADDRESS), m_current(),
-  m_previous(), m_loaded_

[Lldb-commits] [lldb] d9c5613 - Update logic to close inherited file descriptors.

2021-08-19 Thread Rumeet Dhindsa via lldb-commits

Author: Rumeet Dhindsa
Date: 2021-08-19T14:40:43-07:00
New Revision: d9c5613e856cf2addfbf892fc4c1ce9ef9feceaa

URL: 
https://github.com/llvm/llvm-project/commit/d9c5613e856cf2addfbf892fc4c1ce9ef9feceaa
DIFF: 
https://github.com/llvm/llvm-project/commit/d9c5613e856cf2addfbf892fc4c1ce9ef9feceaa.diff

LOG: Update logic to close inherited file descriptors.

This patch adds the support to close all inherited fds into the child
process by iterating over /proc/self/fd entries.

Differential Revision: https://reviews.llvm.org/D105732

Added: 


Modified: 
lldb/source/Host/posix/ProcessLauncherPosixFork.cpp

Removed: 




diff  --git a/lldb/source/Host/posix/ProcessLauncherPosixFork.cpp 
b/lldb/source/Host/posix/ProcessLauncherPosixFork.cpp
index b49b541927afe..63178e6c8a7a7 100644
--- a/lldb/source/Host/posix/ProcessLauncherPosixFork.cpp
+++ b/lldb/source/Host/posix/ProcessLauncherPosixFork.cpp
@@ -14,6 +14,7 @@
 #include "lldb/Utility/FileSpec.h"
 #include "lldb/Utility/Log.h"
 #include "llvm/Support/Errno.h"
+#include "llvm/Support/FileSystem.h"
 
 #include 
 #include 
@@ -143,9 +144,32 @@ static void DupDescriptor(int error_fd, const FileSpec 
&file_spec, int fd,
 // Close everything besides stdin, stdout, and stderr that has no file
 // action to avoid leaking. Only do this when debugging, as elsewhere we
 // actually rely on passing open descriptors to child processes.
-for (int fd = 3; fd < sysconf(_SC_OPEN_MAX); ++fd)
-  if (!info.GetFileActionForFD(fd) && fd != error_fd)
-close(fd);
+
+const llvm::StringRef proc_fd_path = "/proc/self/fd";
+std::error_code ec;
+bool result;
+ec = llvm::sys::fs::is_directory(proc_fd_path, result);
+if (result) {
+  std::vector files_to_close;
+  // Directory iterator doesn't ensure any sequence.
+  for (llvm::sys::fs::directory_iterator iter(proc_fd_path, ec), file_end;
+   iter != file_end && !ec; iter.increment(ec)) {
+int fd = std::stoi(iter->path().substr(proc_fd_path.size() + 1));
+
+// Don't close first three entries since they are stdin, stdout and
+// stderr.
+if (fd > 2 && !info.GetFileActionForFD(fd) && fd != error_fd)
+  files_to_close.push_back(fd);
+  }
+  for (int file_to_close : files_to_close)
+close(file_to_close);
+} else {
+  // Since /proc/self/fd didn't work, trying the slow way instead.
+  int max_fd = sysconf(_SC_OPEN_MAX);
+  for (int fd = 3; fd < max_fd; ++fd)
+if (!info.GetFileActionForFD(fd) && fd != error_fd)
+  close(fd);
+}
 
 // Start tracing this child that is about to exec.
 if (ptrace(PT_TRACE_ME, 0, nullptr, 0) == -1)



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


[Lldb-commits] [lldb] 1cbdc07 - [lldb] Add support for debugging via the dynamic linker.

2021-08-24 Thread Rumeet Dhindsa via lldb-commits

Author: Rumeet Dhindsa
Date: 2021-08-24T13:41:22-07:00
New Revision: 1cbdc07ec015d83038c08dc562d55eccfd808591

URL: 
https://github.com/llvm/llvm-project/commit/1cbdc07ec015d83038c08dc562d55eccfd808591
DIFF: 
https://github.com/llvm/llvm-project/commit/1cbdc07ec015d83038c08dc562d55eccfd808591.diff

LOG: [lldb] Add support for debugging via the dynamic linker.

This patch adds support for shared library load when the executable is
called through ld.so.

Differential Revision:https://reviews.llvm.org/D108061

Added: 
lldb/test/API/functionalities/dyld-launch-linux/Makefile
lldb/test/API/functionalities/dyld-launch-linux/TestDyldLaunchLinux.py
lldb/test/API/functionalities/dyld-launch-linux/main.cpp
lldb/test/API/functionalities/dyld-launch-linux/signal_file.cpp
lldb/test/API/functionalities/dyld-launch-linux/signal_file.h

Modified: 
lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp
lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp

Removed: 




diff  --git a/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp 
b/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp
index 866acbddbdc8..e385b583cef9 100644
--- a/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp
+++ b/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp
@@ -56,6 +56,19 @@ static addr_t ResolveRendezvousAddress(Process *process) {
   "%s resolved via direct object file approach to 0x%" PRIx64,
   __FUNCTION__, info_location);
   } else {
+const Symbol *_r_debug =
+target->GetExecutableModule()->FindFirstSymbolWithNameAndType(
+ConstString("_r_debug"));
+if (_r_debug) {
+  info_addr = _r_debug->GetAddress().GetLoadAddress(target);
+  if (info_addr != LLDB_INVALID_ADDRESS) {
+LLDB_LOGF(log,
+  "%s resolved by finding symbol '_r_debug' whose value is 
"
+  "0x%" PRIx64,
+  __FUNCTION__, info_addr);
+return info_addr;
+  }
+}
 LLDB_LOGF(log,
   "%s FAILED - direct object file approach did not yield a "
   "valid address",
@@ -276,6 +289,14 @@ bool DYLDRendezvous::FillSOEntryFromModuleInfo(
   entry.base_addr = base_addr;
   entry.dyn_addr = dyn_addr;
 
+  // ld.so saves empty file name for the executable file in the link map.
+  // When executable is run using ld.so, we need to be update executable path.
+  if (name.empty()) {
+MemoryRegionInfo region;
+Status region_status =
+m_process->GetMemoryRegionInfo(entry.dyn_addr, region);
+name = region.GetName().AsCString();
+  }
   entry.file_spec.SetFile(name, FileSpec::Style::native);
 
   UpdateBaseAddrIfNecessary(entry, name);
@@ -547,6 +568,15 @@ bool DYLDRendezvous::ReadSOEntryFromMemory(lldb::addr_t 
addr, SOEntry &entry) {
 return false;
 
   std::string file_path = ReadStringFromMemory(entry.path_addr);
+
+  // ld.so saves empty file name for the executable file in the link map.
+  // When executable is run using ld.so, we need to be update executable path.
+  if (file_path.empty()) {
+MemoryRegionInfo region;
+Status region_status =
+m_process->GetMemoryRegionInfo(entry.dyn_addr, region);
+file_path = region.GetName().AsCString();
+  }
   entry.file_spec.SetFile(file_path, FileSpec::Style::native);
 
   UpdateBaseAddrIfNecessary(entry, file_path);

diff  --git 
a/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp 
b/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp
index 160faa74af23..09d0523f676c 100644
--- a/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp
+++ b/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp
@@ -333,28 +333,48 @@ bool DynamicLoaderPOSIXDYLD::SetRendezvousBreakpoint() {
 LLDB_LOG(log, "Rendezvous structure is not set up yet. "
   "Trying to locate rendezvous breakpoint in the interpreter "
   "by symbol name.");
-ModuleSP interpreter = LoadInterpreterModule();
-if (!interpreter) {
-  LLDB_LOG(log, "Can't find interpreter, rendezvous breakpoint isn't 
set.");
-  return false;
-}
-
-// Function names from 
diff erent dynamic loaders that are known to be used
-// as rendezvous between the loader and debuggers.
+// Function names from 
diff erent dynamic loaders that are known to be
+// used as rendezvous between the loader and debuggers.
 static std::vector DebugStateCandidates{
 "_dl_debug_state", "rtld_db_dlactivity", "__dl_rtld_db_dlactivity",
 "r_debug_state",   "_r_debug_state", "_rtld_debug_state",
 };
 
-FileSpecList containingModules;
-containingModules.Append(interpreter->GetFileSpec());
-dyld_break = t

[Lldb-commits] [lldb] 120d97b - Revert "[lldb] Add support for debugging via the dynamic linker."

2021-08-24 Thread Rumeet Dhindsa via lldb-commits

Author: Rumeet Dhindsa
Date: 2021-08-24T15:20:52-07:00
New Revision: 120d97b1a7a81561bb02fc7cd5dc304ef5cbe1cf

URL: 
https://github.com/llvm/llvm-project/commit/120d97b1a7a81561bb02fc7cd5dc304ef5cbe1cf
DIFF: 
https://github.com/llvm/llvm-project/commit/120d97b1a7a81561bb02fc7cd5dc304ef5cbe1cf.diff

LOG: Revert "[lldb] Add support for debugging via the dynamic linker."

This reverts commit 1cbdc07ec015d83038c08dc562d55eccfd808591.

Buildbot failure started after this patch with failure in
api/multithreaded/TestMultithreaded.py:
https://lab.llvm.org/buildbot/#/builders/68/builds/17556

Added: 


Modified: 
lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp
lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp

Removed: 
lldb/test/API/functionalities/dyld-launch-linux/Makefile
lldb/test/API/functionalities/dyld-launch-linux/TestDyldLaunchLinux.py
lldb/test/API/functionalities/dyld-launch-linux/main.cpp
lldb/test/API/functionalities/dyld-launch-linux/signal_file.cpp
lldb/test/API/functionalities/dyld-launch-linux/signal_file.h



diff  --git a/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp 
b/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp
index e385b583cef9a..866acbddbdc8a 100644
--- a/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp
+++ b/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp
@@ -56,19 +56,6 @@ static addr_t ResolveRendezvousAddress(Process *process) {
   "%s resolved via direct object file approach to 0x%" PRIx64,
   __FUNCTION__, info_location);
   } else {
-const Symbol *_r_debug =
-target->GetExecutableModule()->FindFirstSymbolWithNameAndType(
-ConstString("_r_debug"));
-if (_r_debug) {
-  info_addr = _r_debug->GetAddress().GetLoadAddress(target);
-  if (info_addr != LLDB_INVALID_ADDRESS) {
-LLDB_LOGF(log,
-  "%s resolved by finding symbol '_r_debug' whose value is 
"
-  "0x%" PRIx64,
-  __FUNCTION__, info_addr);
-return info_addr;
-  }
-}
 LLDB_LOGF(log,
   "%s FAILED - direct object file approach did not yield a "
   "valid address",
@@ -289,14 +276,6 @@ bool DYLDRendezvous::FillSOEntryFromModuleInfo(
   entry.base_addr = base_addr;
   entry.dyn_addr = dyn_addr;
 
-  // ld.so saves empty file name for the executable file in the link map.
-  // When executable is run using ld.so, we need to be update executable path.
-  if (name.empty()) {
-MemoryRegionInfo region;
-Status region_status =
-m_process->GetMemoryRegionInfo(entry.dyn_addr, region);
-name = region.GetName().AsCString();
-  }
   entry.file_spec.SetFile(name, FileSpec::Style::native);
 
   UpdateBaseAddrIfNecessary(entry, name);
@@ -568,15 +547,6 @@ bool DYLDRendezvous::ReadSOEntryFromMemory(lldb::addr_t 
addr, SOEntry &entry) {
 return false;
 
   std::string file_path = ReadStringFromMemory(entry.path_addr);
-
-  // ld.so saves empty file name for the executable file in the link map.
-  // When executable is run using ld.so, we need to be update executable path.
-  if (file_path.empty()) {
-MemoryRegionInfo region;
-Status region_status =
-m_process->GetMemoryRegionInfo(entry.dyn_addr, region);
-file_path = region.GetName().AsCString();
-  }
   entry.file_spec.SetFile(file_path, FileSpec::Style::native);
 
   UpdateBaseAddrIfNecessary(entry, file_path);

diff  --git 
a/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp 
b/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp
index 09d0523f676cf..160faa74af239 100644
--- a/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp
+++ b/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp
@@ -333,48 +333,28 @@ bool DynamicLoaderPOSIXDYLD::SetRendezvousBreakpoint() {
 LLDB_LOG(log, "Rendezvous structure is not set up yet. "
   "Trying to locate rendezvous breakpoint in the interpreter "
   "by symbol name.");
-// Function names from 
diff erent dynamic loaders that are known to be
-// used as rendezvous between the loader and debuggers.
+ModuleSP interpreter = LoadInterpreterModule();
+if (!interpreter) {
+  LLDB_LOG(log, "Can't find interpreter, rendezvous breakpoint isn't 
set.");
+  return false;
+}
+
+// Function names from 
diff erent dynamic loaders that are known to be used
+// as rendezvous between the loader and debuggers.
 static std::vector DebugStateCandidates{
 "_dl_debug_state", "rtld_db_dlactivity", "__dl_rtld_db_dlactivity",
 "r_debug_state",   "_r_debug_state", "_rtld_debug_state",
 };
 
-ModuleSP interpreter = LoadI

Re: [Lldb-commits] [lldb] r372891 - [Dwarf] Make dw_tag_t a typedef for llvm::dwarf::Tag instead of uint16_t.

2019-09-25 Thread Rumeet Dhindsa via lldb-commits
Hi Jonas,

Since dw_tag_t is an enum now, in the switch statement at following
mentioned location, default case needs to be added as well. It generates a
warning that some enumeration values are not handled in switch.
https://github.com/llvm-mirror/lldb/blob/master/source/Plugins/SymbolFile/DWARF/UniqueDWARFASTType.cpp#L35

On Wed, Sep 25, 2019 at 9:02 AM Jonas Devlieghere via lldb-commits <
lldb-commits@lists.llvm.org> wrote:

> Author: jdevlieghere
> Date: Wed Sep 25 09:04:38 2019
> New Revision: 372891
>
> URL: http://llvm.org/viewvc/llvm-project?rev=372891&view=rev
> Log:
> [Dwarf] Make dw_tag_t a typedef for llvm::dwarf::Tag instead of uint16_t.
>
> Currently dw_tag_t is a typedef for uint16_t. This patch changes makes
> dw_tag_t a typedef for llvm::dwarf::Tag. This enables us to use the full
> power of the DWARF utilities in LLVM without having to do the cast every
> time. With this approach, we only have to do the cast when reading the
> ULEB value.
>
> Differential revision: https://reviews.llvm.org/D68005
>
> Modified:
> lldb/trunk/include/lldb/Core/dwarf.h
>
> lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFAbbreviationDeclaration.cpp
> lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFBaseDIE.cpp
> lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp
> lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.h
> lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDeclContext.h
> lldb/trunk/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.h
>
> Modified: lldb/trunk/include/lldb/Core/dwarf.h
> URL:
> http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/dwarf.h?rev=372891&r1=372890&r2=372891&view=diff
>
> ==
> --- lldb/trunk/include/lldb/Core/dwarf.h (original)
> +++ lldb/trunk/include/lldb/Core/dwarf.h Wed Sep 25 09:04:38 2019
> @@ -22,7 +22,7 @@ typedef uint32_t dw_uleb128_t;
>  typedef int32_t dw_sleb128_t;
>  typedef uint16_t dw_attr_t;
>  typedef uint16_t dw_form_t;
> -typedef uint16_t dw_tag_t;
> +typedef llvm::dwarf::Tag dw_tag_t;
>  typedef uint64_t dw_addr_t; // Dwarf address define that must be big
> enough for
>  // any addresses in the compile units that get
>  // parsed
>
> Modified:
> lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFAbbreviationDeclaration.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFAbbreviationDeclaration.cpp?rev=372891&r1=372890&r2=372891&view=diff
>
> ==
> ---
> lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFAbbreviationDeclaration.cpp
> (original)
> +++
> lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFAbbreviationDeclaration.cpp
> Wed Sep 25 09:04:38 2019
> @@ -18,7 +18,8 @@
>  using namespace lldb_private;
>
>  DWARFAbbreviationDeclaration::DWARFAbbreviationDeclaration()
> -: m_code(InvalidCode), m_tag(0), m_has_children(0), m_attributes() {}
> +: m_code(InvalidCode), m_tag(llvm::dwarf::DW_TAG_null),
> m_has_children(0),
> +  m_attributes() {}
>
>  DWARFAbbreviationDeclaration::DWARFAbbreviationDeclaration(dw_tag_t tag,
> uint8_t
> has_children)
> @@ -33,7 +34,7 @@ DWARFAbbreviationDeclaration::extract(co
>  return DWARFEnumState::Complete;
>
>m_attributes.clear();
> -  m_tag = data.GetULEB128(offset_ptr);
> +  m_tag = static_cast(data.GetULEB128(offset_ptr));
>if (m_tag == DW_TAG_null)
>  return llvm::make_error(
>  "abbrev decl requires non-null tag.");
> @@ -68,7 +69,7 @@ DWARFAbbreviationDeclaration::extract(co
>  }
>
>  bool DWARFAbbreviationDeclaration::IsValid() {
> -  return m_code != 0 && m_tag != 0;
> +  return m_code != 0 && m_tag != llvm::dwarf::DW_TAG_null;
>  }
>
>  uint32_t
>
> Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFBaseDIE.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFBaseDIE.cpp?rev=372891&r1=372890&r2=372891&view=diff
>
> ==
> --- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFBaseDIE.cpp (original)
> +++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFBaseDIE.cpp Wed Sep 25
> 09:04:38 2019
> @@ -30,7 +30,7 @@ dw_tag_t DWARFBaseDIE::Tag() const {
>if (m_die)
>  return m_die->Tag();
>else
> -return 0;
> +return llvm::dwarf::DW_TAG_null;
>  }
>
>  const char *DWARFBaseDIE::GetTagAsCString() const {
>
> Modified:
> lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp?rev=372891&r1=372890&r2=372891&view=diff
>
> ==
> --- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp
>

Re: [Lldb-commits] [PATCH] D62213: [ABI] Implement Windows ABI for x86_64

2019-06-24 Thread Rumeet Dhindsa via lldb-commits
Hi Alex,

It seems that the two variables in file ABIWindows_x86_64.cpp are unused:

Line 1656: field_bit_width
Line 1666: field_byte_flags

On Mon, Jun 24, 2019 at 11:23 AM Alex Langford via Phabricator via
lldb-commits  wrote:

> This revision was automatically updated to reflect the committed changes.
> Closed by commit rL364216: [ABI] Implement Windows ABI for x86_64
> (authored by xiaobai, committed by ).
> Herald added a project: LLVM.
> Herald added a subscriber: llvm-commits.
>
> Changed prior to commit:
>   https://reviews.llvm.org/D62213?vs=205640&id=206270#toc
>
> Repository:
>   rL LLVM
>
> CHANGES SINCE LAST ACTION
>   https://reviews.llvm.org/D62213/new/
>
> https://reviews.llvm.org/D62213
>
> Files:
>
> lldb/trunk/packages/Python/lldbsuite/test/python_api/lldbutil/iter/TestRegistersIterator.py
>   lldb/trunk/source/API/SystemInitializerFull.cpp
>   lldb/trunk/source/Plugins/ABI/CMakeLists.txt
>   lldb/trunk/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp
>   lldb/trunk/source/Plugins/ABI/Windows-x86_64/ABIWindows_x86_64.cpp
>   lldb/trunk/source/Plugins/ABI/Windows-x86_64/ABIWindows_x86_64.h
>   lldb/trunk/source/Plugins/ABI/Windows-x86_64/CMakeLists.txt
>
> lldb/trunk/source/Plugins/Process/Windows/Common/RegisterContextWindows.cpp
>
> lldb/trunk/source/Plugins/Process/Windows/Common/x64/RegisterContextWindows_x64.cpp
>
> ___
> lldb-commits mailing list
> lldb-commits@lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
>
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits