Update prebuilt Clang to r416183b from Android.
https://android.googlesource.com/platform/prebuilts/clang/host/
linux-x86/+/06a71ddac05c22edb2d10b590e1769b3f8619bef
clang 12.0.5 (based on r416183b) from build 7284624.
Change-Id: I277a316abcf47307562d8b748b84870f31a72866
Signed-off-by: Olivier Deprez <olivier.deprez@arm.com>
diff --git a/linux-x64/clang/include/lldb/Host/common/GetOptInc.h b/linux-x64/clang/include/lldb/Host/common/GetOptInc.h
index c69f722..3fb9add 100644
--- a/linux-x64/clang/include/lldb/Host/common/GetOptInc.h
+++ b/linux-x64/clang/include/lldb/Host/common/GetOptInc.h
@@ -1,4 +1,13 @@
-#pragma once
+//===-- GetOptInc.h ---------------------------------------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLDB_HOST_COMMON_GETOPTINC_H
+#define LLDB_HOST_COMMON_GETOPTINC_H
#include "lldb/lldb-defines.h"
@@ -50,3 +59,5 @@
int getopt_long_only(int argc, char *const *argv, const char *optstring,
const struct option *longopts, int *longindex);
#endif
+
+#endif // LLDB_HOST_COMMON_GETOPTINC_H
diff --git a/linux-x64/clang/include/lldb/Host/common/NativeBreakpointList.h b/linux-x64/clang/include/lldb/Host/common/NativeBreakpointList.h
index c2725b2..21d2f09 100644
--- a/linux-x64/clang/include/lldb/Host/common/NativeBreakpointList.h
+++ b/linux-x64/clang/include/lldb/Host/common/NativeBreakpointList.h
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef liblldb_NativeBreakpointList_h_
-#define liblldb_NativeBreakpointList_h_
+#ifndef LLDB_HOST_COMMON_NATIVEBREAKPOINTLIST_H
+#define LLDB_HOST_COMMON_NATIVEBREAKPOINTLIST_H
#include "lldb/lldb-private-forward.h"
#include "lldb/lldb-types.h"
@@ -23,4 +23,4 @@
using HardwareBreakpointMap = std::map<lldb::addr_t, HardwareBreakpoint>;
}
-#endif // ifndef liblldb_NativeBreakpointList_h_
+#endif // LLDB_HOST_COMMON_NATIVEBREAKPOINTLIST_H
diff --git a/linux-x64/clang/include/lldb/Host/common/NativeProcessProtocol.h b/linux-x64/clang/include/lldb/Host/common/NativeProcessProtocol.h
index f05b8d0..5be9cb6 100644
--- a/linux-x64/clang/include/lldb/Host/common/NativeProcessProtocol.h
+++ b/linux-x64/clang/include/lldb/Host/common/NativeProcessProtocol.h
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef liblldb_NativeProcessProtocol_h_
-#define liblldb_NativeProcessProtocol_h_
+#ifndef LLDB_HOST_COMMON_NATIVEPROCESSPROTOCOL_H
+#define LLDB_HOST_COMMON_NATIVEPROCESSPROTOCOL_H
#include "NativeBreakpointList.h"
#include "NativeThreadProtocol.h"
@@ -17,6 +17,7 @@
#include "lldb/Utility/ArchSpec.h"
#include "lldb/Utility/Status.h"
#include "lldb/Utility/TraceOptions.h"
+#include "lldb/Utility/UnimplementedError.h"
#include "lldb/lldb-private-forward.h"
#include "lldb/lldb-types.h"
#include "llvm/ADT/ArrayRef.h"
@@ -32,6 +33,14 @@
class MemoryRegionInfo;
class ResumeActionList;
+struct SVR4LibraryInfo {
+ std::string name;
+ lldb::addr_t link_map;
+ lldb::addr_t base_addr;
+ lldb::addr_t ld_addr;
+ lldb::addr_t next;
+};
+
// NativeProcessProtocol
class NativeProcessProtocol {
public:
@@ -76,16 +85,51 @@
Status ReadMemoryWithoutTrap(lldb::addr_t addr, void *buf, size_t size,
size_t &bytes_read);
+ /// Reads a null terminated string from memory.
+ ///
+ /// Reads up to \p max_size bytes of memory until it finds a '\0'.
+ /// If a '\0' is not found then it reads max_size-1 bytes as a string and a
+ /// '\0' is added as the last character of the \p buffer.
+ ///
+ /// \param[in] addr
+ /// The address in memory to read from.
+ ///
+ /// \param[in] buffer
+ /// An allocated buffer with at least \p max_size size.
+ ///
+ /// \param[in] max_size
+ /// The maximum number of bytes to read from memory until it reads the
+ /// string.
+ ///
+ /// \param[out] total_bytes_read
+ /// The number of bytes read from memory into \p buffer.
+ ///
+ /// \return
+ /// Returns a StringRef backed up by the \p buffer passed in.
+ llvm::Expected<llvm::StringRef>
+ ReadCStringFromMemory(lldb::addr_t addr, char *buffer, size_t max_size,
+ size_t &total_bytes_read);
+
virtual Status WriteMemory(lldb::addr_t addr, const void *buf, size_t size,
size_t &bytes_written) = 0;
- virtual Status AllocateMemory(size_t size, uint32_t permissions,
- lldb::addr_t &addr) = 0;
+ virtual llvm::Expected<lldb::addr_t> AllocateMemory(size_t size,
+ uint32_t permissions) {
+ return llvm::make_error<UnimplementedError>();
+ }
- virtual Status DeallocateMemory(lldb::addr_t addr) = 0;
+ virtual llvm::Error DeallocateMemory(lldb::addr_t addr) {
+ return llvm::make_error<UnimplementedError>();
+ }
virtual lldb::addr_t GetSharedLibraryInfoAddress() = 0;
+ virtual llvm::Expected<std::vector<SVR4LibraryInfo>>
+ GetLoadedSVR4Libraries() {
+ return llvm::createStringError(llvm::inconvertibleErrorCode(),
+ "Not implemented");
+ }
+
virtual bool IsAlive() const;
virtual size_t UpdateThreads() = 0;
@@ -340,20 +384,19 @@
/// \param[in] traceid
/// The user id of the tracing instance.
///
- /// \param[in] config
- /// The thread id of the tracing instance, in case configuration
- /// for a specific thread is needed should be specified in the
- /// config.
- ///
- /// \param[out] error
- /// Status indicates what went wrong.
- ///
/// \param[out] config
- /// The actual configuration being used for tracing.
+ /// The configuration being used for tracing.
+ ///
+ /// \return A status indicating what went wrong.
virtual Status GetTraceConfig(lldb::user_id_t traceid, TraceOptions &config) {
return Status("Not implemented");
}
+ /// \copydoc Process::GetSupportedTraceType()
+ virtual llvm::Expected<TraceTypeInfo> GetSupportedTraceType() {
+ return llvm::make_error<UnimplementedError>();
+ }
+
protected:
struct SoftwareBreakpoint {
uint32_t ref_count;
@@ -391,6 +434,8 @@
NativeProcessProtocol(lldb::pid_t pid, int terminal_fd,
NativeDelegate &delegate);
+ void SetID(lldb::pid_t pid) { m_pid = pid; }
+
// interface for state handling
void SetState(lldb::StateType state, bool notify_delegates = true);
@@ -434,4 +479,4 @@
};
} // namespace lldb_private
-#endif // #ifndef liblldb_NativeProcessProtocol_h_
+#endif // LLDB_HOST_COMMON_NATIVEPROCESSPROTOCOL_H
diff --git a/linux-x64/clang/include/lldb/Host/common/NativeRegisterContext.h b/linux-x64/clang/include/lldb/Host/common/NativeRegisterContext.h
index 6bba8f2..f7568fe 100644
--- a/linux-x64/clang/include/lldb/Host/common/NativeRegisterContext.h
+++ b/linux-x64/clang/include/lldb/Host/common/NativeRegisterContext.h
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef liblldb_NativeRegisterContext_h_
-#define liblldb_NativeRegisterContext_h_
+#ifndef LLDB_HOST_COMMON_NATIVEREGISTERCONTEXT_H
+#define LLDB_HOST_COMMON_NATIVEREGISTERCONTEXT_H
#include "lldb/Host/common/NativeWatchpointList.h"
#include "lldb/lldb-private.h"
@@ -16,6 +16,8 @@
class NativeThreadProtocol;
+enum class ExpeditedRegs { Minimal, Full };
+
class NativeRegisterContext
: public std::enable_shared_from_this<NativeRegisterContext> {
public:
@@ -75,6 +77,8 @@
virtual bool ClearHardwareWatchpoint(uint32_t hw_index);
+ virtual Status ClearWatchpointHit(uint32_t hw_index);
+
virtual Status ClearAllHardwareWatchpoints();
virtual Status IsWatchpointHit(uint32_t wp_index, bool &is_hit);
@@ -114,6 +118,11 @@
virtual NativeThreadProtocol &GetThread() { return m_thread; }
+ virtual std::vector<uint32_t>
+ GetExpeditedRegisters(ExpeditedRegs expType) const;
+
+ virtual bool RegisterOffsetIsDynamic() const { return false; }
+
const RegisterInfo *GetRegisterInfoByName(llvm::StringRef reg_name,
uint32_t start_idx = 0);
@@ -170,9 +179,11 @@
private:
// For RegisterContext only
- DISALLOW_COPY_AND_ASSIGN(NativeRegisterContext);
+ NativeRegisterContext(const NativeRegisterContext &) = delete;
+ const NativeRegisterContext &
+ operator=(const NativeRegisterContext &) = delete;
};
} // namespace lldb_private
-#endif // liblldb_NativeRegisterContext_h_
+#endif // LLDB_HOST_COMMON_NATIVEREGISTERCONTEXT_H
diff --git a/linux-x64/clang/include/lldb/Host/common/NativeThreadProtocol.h b/linux-x64/clang/include/lldb/Host/common/NativeThreadProtocol.h
index 36ae679..8d4c035 100644
--- a/linux-x64/clang/include/lldb/Host/common/NativeThreadProtocol.h
+++ b/linux-x64/clang/include/lldb/Host/common/NativeThreadProtocol.h
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef liblldb_NativeThreadProtocol_h_
-#define liblldb_NativeThreadProtocol_h_
+#ifndef LLDB_HOST_COMMON_NATIVETHREADPROTOCOL_H
+#define LLDB_HOST_COMMON_NATIVETHREADPROTOCOL_H
#include <memory>
@@ -53,4 +53,4 @@
};
}
-#endif // #ifndef liblldb_NativeThreadProtocol_h_
+#endif // LLDB_HOST_COMMON_NATIVETHREADPROTOCOL_H
diff --git a/linux-x64/clang/include/lldb/Host/common/NativeWatchpointList.h b/linux-x64/clang/include/lldb/Host/common/NativeWatchpointList.h
index c83ba1e..66f93bf 100644
--- a/linux-x64/clang/include/lldb/Host/common/NativeWatchpointList.h
+++ b/linux-x64/clang/include/lldb/Host/common/NativeWatchpointList.h
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef liblldb_NativeWatchpointList_h_
-#define liblldb_NativeWatchpointList_h_
+#ifndef LLDB_HOST_COMMON_NATIVEWATCHPOINTLIST_H
+#define LLDB_HOST_COMMON_NATIVEWATCHPOINTLIST_H
#include "lldb/Utility/Status.h"
#include "lldb/lldb-private-forward.h"
@@ -38,4 +38,4 @@
};
}
-#endif // ifndef liblldb_NativeWatchpointList_h_
+#endif // LLDB_HOST_COMMON_NATIVEWATCHPOINTLIST_H
diff --git a/linux-x64/clang/include/lldb/Host/common/TCPSocket.h b/linux-x64/clang/include/lldb/Host/common/TCPSocket.h
index faf3bb6..b782c9e 100644
--- a/linux-x64/clang/include/lldb/Host/common/TCPSocket.h
+++ b/linux-x64/clang/include/lldb/Host/common/TCPSocket.h
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef liblldb_TCPSocket_h_
-#define liblldb_TCPSocket_h_
+#ifndef LLDB_HOST_COMMON_TCPSOCKET_H
+#define LLDB_HOST_COMMON_TCPSOCKET_H
#include "lldb/Host/Socket.h"
#include "lldb/Host/SocketAddress.h"
@@ -57,4 +57,4 @@
};
}
-#endif // ifndef liblldb_TCPSocket_h_
+#endif // LLDB_HOST_COMMON_TCPSOCKET_H
diff --git a/linux-x64/clang/include/lldb/Host/common/UDPSocket.h b/linux-x64/clang/include/lldb/Host/common/UDPSocket.h
index b7b6db6..bae707e 100644
--- a/linux-x64/clang/include/lldb/Host/common/UDPSocket.h
+++ b/linux-x64/clang/include/lldb/Host/common/UDPSocket.h
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef liblldb_UDPSocket_h_
-#define liblldb_UDPSocket_h_
+#ifndef LLDB_HOST_COMMON_UDPSOCKET_H
+#define LLDB_HOST_COMMON_UDPSOCKET_H
#include "lldb/Host/Socket.h"
@@ -16,8 +16,8 @@
public:
UDPSocket(bool should_close, bool child_processes_inherit);
- static Status Connect(llvm::StringRef name, bool child_processes_inherit,
- Socket *&socket);
+ static llvm::Expected<std::unique_ptr<UDPSocket>>
+ Connect(llvm::StringRef name, bool child_processes_inherit);
std::string GetRemoteConnectionURI() const override;
@@ -33,4 +33,4 @@
};
}
-#endif // ifndef liblldb_UDPSocket_h_
+#endif // LLDB_HOST_COMMON_UDPSOCKET_H