[Lldb-commits] [PATCH] D93621: [lldb][wasm] Parse DWO section names

2020-12-21 Thread Philip Pfaffe via Phabricator via lldb-commits
pfaffe created this revision.
Herald added subscribers: sunfish, sbc100.
pfaffe requested review of this revision.
Herald added subscribers: lldb-commits, aheejin.
Herald added a project: LLDB.

Mirror ELF section parsing to support DWARF section names for
debug fission.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D93621

Files:
  lldb/source/Plugins/ObjectFile/wasm/ObjectFileWasm.cpp


Index: lldb/source/Plugins/ObjectFile/wasm/ObjectFileWasm.cpp
===
--- lldb/source/Plugins/ObjectFile/wasm/ObjectFileWasm.cpp
+++ lldb/source/Plugins/ObjectFile/wasm/ObjectFileWasm.cpp
@@ -253,6 +253,43 @@
 
 Symtab *ObjectFileWasm::GetSymtab() { return nullptr; }
 
+static SectionType GetSectionTypeFromName(llvm::StringRef Name) {
+  if (Name.consume_front(".debug_") || Name.consume_front(".zdebug_")) {
+return llvm::StringSwitch(Name)
+.Case("abbrev", eSectionTypeDWARFDebugAbbrev)
+.Case("abbrev.dwo", eSectionTypeDWARFDebugAbbrevDwo)
+.Case("addr", eSectionTypeDWARFDebugAddr)
+.Case("aranges", eSectionTypeDWARFDebugAranges)
+.Case("cu_index", eSectionTypeDWARFDebugCuIndex)
+.Case("frame", eSectionTypeDWARFDebugFrame)
+.Case("info", eSectionTypeDWARFDebugInfo)
+.Case("info.dwo", eSectionTypeDWARFDebugInfoDwo)
+.Cases("line", "line.dwo", eSectionTypeDWARFDebugLine)
+.Cases("line_str", "line_str.dwo", eSectionTypeDWARFDebugLineStr)
+.Case("loc", eSectionTypeDWARFDebugLoc)
+.Case("loc.dwo", eSectionTypeDWARFDebugLocDwo)
+.Case("loclists", eSectionTypeDWARFDebugLocLists)
+.Case("loclists.dwo", eSectionTypeDWARFDebugLocListsDwo)
+.Case("macinfo", eSectionTypeDWARFDebugMacInfo)
+.Cases("macro", "macro.dwo", eSectionTypeDWARFDebugMacro)
+.Case("names", eSectionTypeDWARFDebugNames)
+.Case("pubnames", eSectionTypeDWARFDebugPubNames)
+.Case("pubtypes", eSectionTypeDWARFDebugPubTypes)
+.Case("ranges", eSectionTypeDWARFDebugRanges)
+.Case("rnglists", eSectionTypeDWARFDebugRngLists)
+.Case("rnglists.dwo", eSectionTypeDWARFDebugRngListsDwo)
+.Case("str", eSectionTypeDWARFDebugStr)
+.Case("str.dwo", eSectionTypeDWARFDebugStrDwo)
+.Case("str_offsets", eSectionTypeDWARFDebugStrOffsets)
+.Case("str_offsets.dwo", eSectionTypeDWARFDebugStrOffsetsDwo)
+.Case("tu_index", eSectionTypeDWARFDebugTuIndex)
+.Case("types", eSectionTypeDWARFDebugTypes)
+.Case("types.dwo", eSectionTypeDWARFDebugTypesDwo)
+.Default(eSectionTypeOther);
+  }
+  return eSectionTypeOther;
+}
+
 void ObjectFileWasm::CreateSections(SectionList &unified_section_list) {
   if (m_sections_up)
 return;
@@ -280,29 +317,7 @@
   // Code section.
   vm_addr = 0;
 } else {
-  section_type =
-  llvm::StringSwitch(sect_info.name.GetStringRef())
-  .Case(".debug_abbrev", eSectionTypeDWARFDebugAbbrev)
-  .Case(".debug_addr", eSectionTypeDWARFDebugAddr)
-  .Case(".debug_aranges", eSectionTypeDWARFDebugAranges)
-  .Case(".debug_cu_index", eSectionTypeDWARFDebugCuIndex)
-  .Case(".debug_frame", eSectionTypeDWARFDebugFrame)
-  .Case(".debug_info", eSectionTypeDWARFDebugInfo)
-  .Case(".debug_line", eSectionTypeDWARFDebugLine)
-  .Case(".debug_line_str", eSectionTypeDWARFDebugLineStr)
-  .Case(".debug_loc", eSectionTypeDWARFDebugLoc)
-  .Case(".debug_loclists", eSectionTypeDWARFDebugLocLists)
-  .Case(".debug_macinfo", eSectionTypeDWARFDebugMacInfo)
-  .Case(".debug_macro", eSectionTypeDWARFDebugMacro)
-  .Case(".debug_names", eSectionTypeDWARFDebugNames)
-  .Case(".debug_pubnames", eSectionTypeDWARFDebugPubNames)
-  .Case(".debug_pubtypes", eSectionTypeDWARFDebugPubTypes)
-  .Case(".debug_ranges", eSectionTypeDWARFDebugRanges)
-  .Case(".debug_rnglists", eSectionTypeDWARFDebugRngLists)
-  .Case(".debug_str", eSectionTypeDWARFDebugStr)
-  .Case(".debug_str_offsets", eSectionTypeDWARFDebugStrOffsets)
-  .Case(".debug_types", eSectionTypeDWARFDebugTypes)
-  .Default(eSectionTypeOther);
+  section_type = GetSectionTypeFromName(sect_info.name.GetStringRef());
   if (section_type == eSectionTypeOther)
 continue;
   section_name = sect_info.name;


Index: lldb/source/Plugins/ObjectFile/wasm/ObjectFileWasm.cpp
===
--- lldb/source/Plugins/ObjectFile/wasm/ObjectFileWasm.cpp
+++ lldb/source/Plugins/ObjectFile/wasm/ObjectFileWasm.cpp
@@ -253,6 +253,43 @@
 
 Symtab *ObjectFileWasm::GetSymtab() { return nullptr; }
 
+static SectionType GetSectionTypeFromName(llvm::StringRef Name) {
+  if (Name.consume_front(".debug_") || Name.

[Lldb-commits] [PATCH] D91734: [FastISel] Flush local value map on every instruction

2020-12-21 Thread Paul Robinson via Phabricator via lldb-commits
probinson added a comment.

I've run this through our copy of the GDB suite (8.3, not sure how old that 
is).  There are 10 differences, with and without the patch.

  FAIL: gdb.base/foll-exec.exp: step through execlp call
  FAIL: gdb.base/foll-exec.exp: step after execlp call
  FAIL: gdb.base/foll-exec.exp: print execd-program/global_i (after execlp)
  FAIL: gdb.base/foll-exec.exp: print execd-program/local_j (after execlp)
  FAIL: gdb.base/foll-exec.exp: print follow-exec/local_k (after execlp)

These 5 are all adjacent test points; what happens is that a "next" ends up 
stepping through parameter evaluation of a call to execl(), where the test 
expects it to execute the call.  Adding two more "next" commands should fix 
that.

  FAIL: gdb.base/call-ar-st.exp: check args of sum_array_print
  FAIL: gdb.base/funcargs.exp: continue to call2i
  FAIL: gdb.base/funcargs.exp: backtrace from call7k (pattern 1)

These three are all cases where a function parameter list is long enough to 
require parameters to be passed on the stack.  In that situation, prologue_end 
is being set *way* too early, and so breaking on the function will stop before 
the parameters have all been homed.  Garbage ensues.  Haven't gotten to the 
bottom of that yet.

The news is not all bad. These two changed to PASS:

  UNTESTED: gdb.base/break-caller-line.exp: target arch has an instruction 
after call as part of the caller line
  FAIL: gdb.python/python.exp: test find_pc_line with resume address


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D91734/new/

https://reviews.llvm.org/D91734

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


[Lldb-commits] [PATCH] D93649: [lldb/Lua] add support for Lua function breakpoint

2020-12-21 Thread Pedro Tammela via Phabricator via lldb-commits
tammela created this revision.
tammela requested review of this revision.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

Adds support for running a Lua function when a breakpoint is hit.

Example:

  breakpoint command add -s lua -F abc

The above runs the Lua function 'abc' passing 2 arguments. 'frame', 'bp_loc' 
and 'extra_args'.

A third parameter 'extra_args' is only present when there is structured data
declared in the command line.

Example:

  breakpoint command add -s lua -F abc -k foo -v bar


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D93649

Files:
  lldb/bindings/lua/lua-swigsafecast.swig
  lldb/bindings/lua/lua-wrapper.swig
  lldb/source/Plugins/ScriptInterpreter/Lua/Lua.cpp
  lldb/source/Plugins/ScriptInterpreter/Lua/Lua.h
  lldb/source/Plugins/ScriptInterpreter/Lua/ScriptInterpreterLua.cpp
  lldb/source/Plugins/ScriptInterpreter/Lua/ScriptInterpreterLua.h
  lldb/test/Shell/ScriptInterpreter/Lua/breakpoint_function_callback.test
  lldb/unittests/ScriptInterpreter/Lua/LuaTests.cpp

Index: lldb/unittests/ScriptInterpreter/Lua/LuaTests.cpp
===
--- lldb/unittests/ScriptInterpreter/Lua/LuaTests.cpp
+++ lldb/unittests/ScriptInterpreter/Lua/LuaTests.cpp
@@ -24,10 +24,9 @@
 #pragma warning (disable : 4190)
 #endif
 
-extern "C" llvm::Expected
-LLDBSwigLuaBreakpointCallbackFunction(lua_State *L,
-  lldb::StackFrameSP stop_frame_sp,
-  lldb::BreakpointLocationSP bp_loc_sp) {
+extern "C" llvm::Expected LLDBSwigLuaBreakpointCallbackFunction(
+lua_State *L, lldb::StackFrameSP stop_frame_sp,
+lldb::BreakpointLocationSP bp_loc_sp, StructuredDataImpl *extra_args_impl) {
   return false;
 }
 
Index: lldb/test/Shell/ScriptInterpreter/Lua/breakpoint_function_callback.test
===
--- /dev/null
+++ lldb/test/Shell/ScriptInterpreter/Lua/breakpoint_function_callback.test
@@ -0,0 +1,21 @@
+# REQUIRES: lua
+# RUN: echo "int main() { return 0; }" | %clang_host -x c - -o %t
+# RUN: %lldb -s %s --script-language lua %t 2>&1 | FileCheck %s
+b main
+script
+function abc(a, b, c, ...)
+print(c)
+end
+quit
+breakpoint command add -s lua -F abc
+r
+# CHECK: nil
+breakpoint command add -s lua -F abc -k foo -v 123
+r
+# CHECK: 
+breakpoint command add -s lua -o "abc(frame, bp_loc, ...)"
+r
+# CHECK: nil
+breakpoint command add -s lua -F typo
+r
+# CHECK: attempt to call a nil value
Index: lldb/source/Plugins/ScriptInterpreter/Lua/ScriptInterpreterLua.h
===
--- lldb/source/Plugins/ScriptInterpreter/Lua/ScriptInterpreterLua.h
+++ lldb/source/Plugins/ScriptInterpreter/Lua/ScriptInterpreterLua.h
@@ -9,6 +9,7 @@
 #ifndef liblldb_ScriptInterpreterLua_h_
 #define liblldb_ScriptInterpreterLua_h_
 
+#include "lldb/Core/StructuredDataImpl.h"
 #include "lldb/Interpreter/ScriptInterpreter.h"
 #include "lldb/Utility/Status.h"
 #include "lldb/lldb-enumerations.h"
@@ -22,6 +23,11 @@
 CommandDataLua() : BreakpointOptions::CommandData() {
   interpreter = lldb::eScriptLanguageLua;
 }
+CommandDataLua(StructuredData::ObjectSP extra_args_sp)
+: BreakpointOptions::CommandData(), m_extra_args_sp(extra_args_sp) {
+  interpreter = lldb::eScriptLanguageLua;
+}
+StructuredData::ObjectSP m_extra_args_sp;
   };
 
   ScriptInterpreterLua(Debugger &debugger);
@@ -72,9 +78,17 @@
   Status SetBreakpointCommandCallback(BreakpointOptions *bp_options,
   const char *command_body_text) override;
 
+  Status SetBreakpointCommandCallbackFunction(
+  BreakpointOptions *bp_options, const char *function_name,
+  StructuredData::ObjectSP extra_args_sp) override;
+
 private:
   std::unique_ptr m_lua;
   bool m_session_is_active = false;
+
+  Status RegisterBreakpointCallback(BreakpointOptions *bp_options,
+const char *command_body_text,
+StructuredData::ObjectSP extra_args_sp);
 };
 
 } // namespace lldb_private
Index: lldb/source/Plugins/ScriptInterpreter/Lua/ScriptInterpreterLua.cpp
===
--- lldb/source/Plugins/ScriptInterpreter/Lua/ScriptInterpreterLua.cpp
+++ lldb/source/Plugins/ScriptInterpreter/Lua/ScriptInterpreterLua.cpp
@@ -265,8 +265,9 @@
   debugger.GetScriptInterpreter(true, eScriptLanguageLua));
   Lua &lua = lua_interpreter->GetLua();
 
-  llvm::Expected BoolOrErr =
-  lua.CallBreakpointCallback(baton, stop_frame_sp, bp_loc_sp);
+  CommandDataLua *bp_option_data = static_cast(baton);
+  llvm::Expected BoolOrErr = lua.CallBreakpointCallback(
+  baton, stop_frame_sp, bp_loc_sp, bp_option_data->m_extra_args_sp);
   if (llvm::Error E = BoolOrErr.takeError()) {
 debugger.GetErrorStream() << toString(std::move(E));
 retur

[Lldb-commits] [lldb] 3f3ab03 - [lldb] Remove anonymous namespace from NativeRegisterContextLinux_x86_64

2020-12-21 Thread Pavel Labath via lldb-commits

Author: Pavel Labath
Date: 2020-12-21T20:39:05+01:00
New Revision: 3f3ab03ab7bbaf13329b0ff07c5d3de40970bfcd

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

LOG: [lldb] Remove anonymous namespace from NativeRegisterContextLinux_x86_64

Use "static" instead.

Added: 


Modified: 
lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp

Removed: 




diff  --git 
a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp 
b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp
index 6462441249c0..c6aa320c0c14 100644
--- a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp
+++ b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp
@@ -41,11 +41,8 @@ static inline int get_cpuid_count(unsigned int __leaf,
 using namespace lldb_private;
 using namespace lldb_private::process_linux;
 
-// Private namespace.
-
-namespace {
 // x86 32-bit general purpose registers.
-const uint32_t g_gpr_regnums_i386[] = {
+static const uint32_t g_gpr_regnums_i386[] = {
 lldb_eax_i386,  lldb_ebx_i386,lldb_ecx_i386, lldb_edx_i386,
 lldb_edi_i386,  lldb_esi_i386,lldb_ebp_i386, lldb_esp_i386,
 lldb_eip_i386,  lldb_eflags_i386, lldb_cs_i386,  lldb_fs_i386,
@@ -62,7 +59,7 @@ static_assert((sizeof(g_gpr_regnums_i386) / 
sizeof(g_gpr_regnums_i386[0])) -
   "g_gpr_regnums_i386 has wrong number of register infos");
 
 // x86 32-bit floating point registers.
-const uint32_t g_fpu_regnums_i386[] = {
+static const uint32_t g_fpu_regnums_i386[] = {
 lldb_fctrl_i386,lldb_fstat_i386, lldb_ftag_i386,  lldb_fop_i386,
 lldb_fiseg_i386,lldb_fioff_i386, lldb_foseg_i386, lldb_fooff_i386,
 lldb_mxcsr_i386,lldb_mxcsrmask_i386, lldb_st0_i386,   lldb_st1_i386,
@@ -80,7 +77,7 @@ static_assert((sizeof(g_fpu_regnums_i386) / 
sizeof(g_fpu_regnums_i386[0])) -
   "g_fpu_regnums_i386 has wrong number of register infos");
 
 // x86 32-bit AVX registers.
-const uint32_t g_avx_regnums_i386[] = {
+static const uint32_t g_avx_regnums_i386[] = {
 lldb_ymm0_i386, lldb_ymm1_i386, lldb_ymm2_i386, lldb_ymm3_i386,
 lldb_ymm4_i386, lldb_ymm5_i386, lldb_ymm6_i386, lldb_ymm7_i386,
 LLDB_INVALID_REGNUM // register sets need to end with this flag
@@ -196,7 +193,7 @@ static_assert((sizeof(g_mpx_regnums_x86_64) / 
sizeof(g_mpx_regnums_x86_64[0])) -
   "g_mpx_regnums_x86_64 has wrong number of register infos");
 
 // Number of register sets provided by this context.
-enum { k_num_extended_register_sets = 2, k_num_register_sets = 4 };
+constexpr unsigned k_num_extended_register_sets = 2, k_num_register_sets = 4;
 
 // Register sets for x86 32-bit.
 static const RegisterSet g_reg_sets_i386[k_num_register_sets] = {
@@ -219,7 +216,6 @@ static const RegisterSet 
g_reg_sets_x86_64[k_num_register_sets] = {
  g_avx_regnums_x86_64},
 { "Memory Protection Extensions", "mpx", k_num_mpx_registers_x86_64,
  g_mpx_regnums_x86_64}};
-}
 
 #define REG_CONTEXT_SIZE (GetRegisterInfoInterface().GetGPRSize() + 
sizeof(FPR))
 



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


[Lldb-commits] [PATCH] D93541: [Process/NetBSD] Copy changes from FreeBSDRemote and reformat [WIP]

2020-12-21 Thread Pavel Labath via Phabricator via lldb-commits
labath added inline comments.



Comment at: 
lldb/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD_x86_64.cpp:41
+
+namespace {
+// x86 64-bit general purpose registers.

mgorny wrote:
> labath wrote:
> > I don't know if this namespace snuck into the FreeBSD file, but generally, 
> > this is not the proper use of anonymous namespaces in llvm. See [[ 
> > http://llvm.org/docs/CodingStandards.html#anonymous-namespaces | the coding 
> > standards ]] for more details.
> I guess I've copied it from Linux. Should I eliminate it entirely or move to 
> `lldb_private::process_netbsd`?
Remove it, and use "static" instead. Objects which are local to a file should 
be marked as such. Just, according to the coding standards, we should use 
"static" whereever possible. I've just done something like that in linux with 
3f3ab03ab7b.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D93541/new/

https://reviews.llvm.org/D93541

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


[Lldb-commits] [PATCH] D93621: [lldb][wasm] Parse DWO section names

2020-12-21 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment.

It would be nice to "mirror" the test case 
(test/Shell/ObjectFile/ELF/section-types.yaml) too. Other than that, this is 
fine.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D93621/new/

https://reviews.llvm.org/D93621

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


[Lldb-commits] [PATCH] D93657: [lldb] Ad os_signpost support to `lldb_private::Timer`

2020-12-21 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere created this revision.
JDevlieghere added a reviewer: LLDB.
JDevlieghere requested review of this revision.

Emit `os_signposts` when supported from LLDB's timer class. A vast amount of 
performance sensitive places in LLDB are already instrumented with the Timer 
class. By emitting signposts we can  examine this information in Instruments. I 
recommend looking at Daniel's differential for why this is so powerful: 
https://reviews.llvm.org/D52954.


https://reviews.llvm.org/D93657

Files:
  lldb/include/lldb/Utility/Timer.h
  lldb/source/Utility/Timer.cpp


Index: lldb/source/Utility/Timer.cpp
===
--- lldb/source/Utility/Timer.cpp
+++ lldb/source/Utility/Timer.cpp
@@ -7,6 +7,8 @@
 
//===--===//
 #include "lldb/Utility/Timer.h"
 #include "lldb/Utility/Stream.h"
+#include "llvm/Support/ManagedStatic.h"
+#include "llvm/Support/Signposts.h"
 
 #include 
 #include 
@@ -28,6 +30,9 @@
 static std::atomic g_categories;
 } // end of anonymous namespace
 
+/// Allows llvm::Timer to emit signposts when supported.
+static llvm::ManagedStatic Signposts;
+
 std::atomic Timer::g_quiet(true);
 std::atomic Timer::g_display_depth(0);
 static std::mutex &GetFileMutex() {
@@ -54,6 +59,7 @@
 
 Timer::Timer(Timer::Category &category, const char *format, ...)
 : m_category(category), m_total_start(std::chrono::steady_clock::now()) {
+  Signposts->startInterval(this, m_category.GetName());
   TimerStack &stack = GetTimerStackForCurrentThread();
 
   stack.push_back(this);
@@ -80,6 +86,8 @@
   auto total_dur = stop_time - m_total_start;
   auto timer_dur = total_dur - m_child_duration;
 
+  Signposts->endInterval(this, m_category.GetName());
+
   TimerStack &stack = GetTimerStackForCurrentThread();
   if (g_quiet && stack.size() <= g_display_depth) {
 std::lock_guard lock(GetFileMutex());
Index: lldb/include/lldb/Utility/Timer.h
===
--- lldb/include/lldb/Utility/Timer.h
+++ lldb/include/lldb/Utility/Timer.h
@@ -25,6 +25,7 @@
   class Category {
   public:
 explicit Category(const char *category_name);
+llvm::StringRef GetName() { return m_name; }
 
   private:
 friend class Timer;


Index: lldb/source/Utility/Timer.cpp
===
--- lldb/source/Utility/Timer.cpp
+++ lldb/source/Utility/Timer.cpp
@@ -7,6 +7,8 @@
 //===--===//
 #include "lldb/Utility/Timer.h"
 #include "lldb/Utility/Stream.h"
+#include "llvm/Support/ManagedStatic.h"
+#include "llvm/Support/Signposts.h"
 
 #include 
 #include 
@@ -28,6 +30,9 @@
 static std::atomic g_categories;
 } // end of anonymous namespace
 
+/// Allows llvm::Timer to emit signposts when supported.
+static llvm::ManagedStatic Signposts;
+
 std::atomic Timer::g_quiet(true);
 std::atomic Timer::g_display_depth(0);
 static std::mutex &GetFileMutex() {
@@ -54,6 +59,7 @@
 
 Timer::Timer(Timer::Category &category, const char *format, ...)
 : m_category(category), m_total_start(std::chrono::steady_clock::now()) {
+  Signposts->startInterval(this, m_category.GetName());
   TimerStack &stack = GetTimerStackForCurrentThread();
 
   stack.push_back(this);
@@ -80,6 +86,8 @@
   auto total_dur = stop_time - m_total_start;
   auto timer_dur = total_dur - m_child_duration;
 
+  Signposts->endInterval(this, m_category.GetName());
+
   TimerStack &stack = GetTimerStackForCurrentThread();
   if (g_quiet && stack.size() <= g_display_depth) {
 std::lock_guard lock(GetFileMutex());
Index: lldb/include/lldb/Utility/Timer.h
===
--- lldb/include/lldb/Utility/Timer.h
+++ lldb/include/lldb/Utility/Timer.h
@@ -25,6 +25,7 @@
   class Category {
   public:
 explicit Category(const char *category_name);
+llvm::StringRef GetName() { return m_name; }
 
   private:
 friend class Timer;
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D93481: [lldb/Lua] add support for multiline scripted breakpoints

2020-12-21 Thread Pavel Labath via Phabricator via lldb-commits
labath added inline comments.



Comment at: lldb/source/Plugins/ScriptInterpreter/Lua/Lua.h:39
   llvm::Error LoadModule(llvm::StringRef filename);
+  llvm::Error LoadBuffer(llvm::StringRef buffer, bool pop_result = true);
   llvm::Error ChangeIO(FILE *out, FILE *err);

This default value does not seem particularly useful. In fact, I am not sure if 
this argument should even exist at all. The usage in `IOHandlerIsInputComplete` 
is sufficiently unorthodox that it might be a good idea to draw attention to 
the fact that something funky is happening via an explicit pop (and maybe a 
comment).


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D93481/new/

https://reviews.llvm.org/D93481

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


[Lldb-commits] [PATCH] D93657: [lldb] Ad os_signpost support to `lldb_private::Timer`

2020-12-21 Thread Med Ismail Bennani via Phabricator via lldb-commits
mib accepted this revision.
mib added inline comments.
This revision is now accepted and ready to land.



Comment at: lldb/source/Utility/Timer.cpp:62
 : m_category(category), m_total_start(std::chrono::steady_clock::now()) {
+  Signposts->startInterval(this, m_category.GetName());
   TimerStack &stack = GetTimerStackForCurrentThread();

Did you mean `startTimerInterval` here ? I don't see `startInterval` in the 
llvm headers ...



Comment at: lldb/source/Utility/Timer.cpp:89
 
+  Signposts->endInterval(this, m_category.GetName());
+

Same here with `llvm::SignpostEmitter::endTimerInterval`


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D93657/new/

https://reviews.llvm.org/D93657

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


[Lldb-commits] [PATCH] D93657: [lldb] Ad os_signpost support to `lldb_private::Timer`

2020-12-21 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere marked 2 inline comments as done.
JDevlieghere added inline comments.



Comment at: lldb/source/Utility/Timer.cpp:62
 : m_category(category), m_total_start(std::chrono::steady_clock::now()) {
+  Signposts->startInterval(this, m_category.GetName());
   TimerStack &stack = GetTimerStackForCurrentThread();

mib wrote:
> Did you mean `startTimerInterval` here ? I don't see `startInterval` in the 
> llvm headers ...
No, those are instances of `llvm::Timer`. If you look at the "Stack" you can 
see this depends on D93655 which changes the Signpost interface to work with 
arbitrary objects.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D93657/new/

https://reviews.llvm.org/D93657

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


[Lldb-commits] [PATCH] D93657: [lldb] Ad os_signpost support to `lldb_private::Timer`

2020-12-21 Thread Med Ismail Bennani via Phabricator via lldb-commits
mib accepted this revision.
mib added a comment.
This revision is now accepted and ready to land.

Right! I thought it was depending on D52954  
... LGTM then !


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D93657/new/

https://reviews.llvm.org/D93657

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


[Lldb-commits] [lldb] bd2e833 - [lldb] [Process/FreeBSDRemote] Remove anonymous namespace

2020-12-21 Thread Michał Górny via lldb-commits

Author: Michał Górny
Date: 2020-12-21T22:26:54+01:00
New Revision: bd2e8ece6afa8a6c1975d19d403d63349414

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

LOG: [lldb] [Process/FreeBSDRemote] Remove anonymous namespace

Added: 


Modified: 

lldb/source/Plugins/Process/FreeBSDRemote/NativeRegisterContextFreeBSD_x86_64.cpp

Removed: 




diff  --git 
a/lldb/source/Plugins/Process/FreeBSDRemote/NativeRegisterContextFreeBSD_x86_64.cpp
 
b/lldb/source/Plugins/Process/FreeBSDRemote/NativeRegisterContextFreeBSD_x86_64.cpp
index b3b4a6cb0578..d5052e7d1b3a 100644
--- 
a/lldb/source/Plugins/Process/FreeBSDRemote/NativeRegisterContextFreeBSD_x86_64.cpp
+++ 
b/lldb/source/Plugins/Process/FreeBSDRemote/NativeRegisterContextFreeBSD_x86_64.cpp
@@ -29,9 +29,6 @@
 using namespace lldb_private;
 using namespace lldb_private::process_freebsd;
 
-// Private namespace.
-
-namespace {
 // x86 64-bit general purpose registers.
 static const uint32_t g_gpr_regnums_x86_64[] = {
 lldb_rax_x86_64,lldb_rbx_x86_64,lldb_rcx_x86_64, lldb_rdx_x86_64,
@@ -138,7 +135,7 @@ static_assert((sizeof(g_dbr_regnums_x86_64) / 
sizeof(g_dbr_regnums_x86_64[0])) -
   "g_dbr_regnums_x86_64 has wrong number of register infos");
 
 // x86 32-bit general purpose registers.
-const uint32_t g_gpr_regnums_i386[] = {
+static const uint32_t g_gpr_regnums_i386[] = {
 lldb_eax_i386,  lldb_ebx_i386,lldb_ecx_i386, lldb_edx_i386,
 lldb_edi_i386,  lldb_esi_i386,lldb_ebp_i386, lldb_esp_i386,
 lldb_eip_i386,  lldb_eflags_i386, lldb_cs_i386,  lldb_fs_i386,
@@ -155,7 +152,7 @@ static_assert((sizeof(g_gpr_regnums_i386) / 
sizeof(g_gpr_regnums_i386[0])) -
   "g_gpr_regnums_i386 has wrong number of register infos");
 
 // x86 32-bit floating point registers.
-const uint32_t g_fpu_regnums_i386[] = {
+static const uint32_t g_fpu_regnums_i386[] = {
 lldb_fctrl_i386,lldb_fstat_i386, lldb_ftag_i386,  lldb_fop_i386,
 lldb_fiseg_i386,lldb_fioff_i386, lldb_foseg_i386, lldb_fooff_i386,
 lldb_mxcsr_i386,lldb_mxcsrmask_i386, lldb_st0_i386,   lldb_st1_i386,
@@ -236,7 +233,6 @@ static const RegisterSet 
g_reg_sets_x86_64[k_num_register_sets] = {
 };
 
 #define REG_CONTEXT_SIZE (GetRegisterInfoInterface().GetGPRSize())
-} // namespace
 
 NativeRegisterContextFreeBSD *
 NativeRegisterContextFreeBSD::CreateHostNativeRegisterContextFreeBSD(



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


[Lldb-commits] [PATCH] D93495: CrashReason: Add MTE tag check faults to the list of crash reasons.

2020-12-21 Thread Peter Collingbourne via Phabricator via lldb-commits
pcc updated this revision to Diff 313190.
pcc added a comment.

Show fault address for SEGV_MTESERR


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D93495/new/

https://reviews.llvm.org/D93495

Files:
  lldb/source/Plugins/Process/POSIX/CrashReason.cpp
  lldb/source/Plugins/Process/POSIX/CrashReason.h


Index: lldb/source/Plugins/Process/POSIX/CrashReason.h
===
--- lldb/source/Plugins/Process/POSIX/CrashReason.h
+++ lldb/source/Plugins/Process/POSIX/CrashReason.h
@@ -22,6 +22,8 @@
   eInvalidAddress,
   ePrivilegedAddress,
   eBoundViolation,
+  eAsyncTagCheckFault,
+  eSyncTagCheckFault,
 
   // SIGILL crash reasons.
   eIllegalOpcode,
Index: lldb/source/Plugins/Process/POSIX/CrashReason.cpp
===
--- lldb/source/Plugins/Process/POSIX/CrashReason.cpp
+++ lldb/source/Plugins/Process/POSIX/CrashReason.cpp
@@ -58,6 +58,16 @@
 #endif
   case SEGV_BNDERR:
 return CrashReason::eBoundViolation;
+#ifndef SEGV_MTEAERR
+#define SEGV_MTEAERR 8
+#endif
+  case SEGV_MTEAERR:
+return CrashReason::eAsyncTagCheckFault;
+#ifndef SEGV_MTESERR
+#define SEGV_MTESERR 9
+#endif
+  case SEGV_MTESERR:
+return CrashReason::eSyncTagCheckFault;
   }
 
   return CrashReason::eInvalidCrashReason;
@@ -166,6 +176,13 @@
   case CrashReason::eBoundViolation:
 str = "signal SIGSEGV: bound violation";
 break;
+  case CrashReason::eAsyncTagCheckFault:
+str = "signal SIGSEGV: async tag check fault";
+break;
+  case CrashReason::eSyncTagCheckFault:
+str = "signal SIGSEGV: sync tag check fault";
+AppendFaultAddr(str, fault_addr);
+break;
   case CrashReason::eIllegalOpcode:
 str = "signal SIGILL: illegal instruction";
 break;
@@ -246,6 +263,12 @@
   case CrashReason::eBoundViolation:
 str = "eBoundViolation";
 break;
+  case CrashReason::eAsyncTagCheckFault:
+str = "eAsyncTagCheckFault";
+break;
+  case CrashReason::eSyncTagCheckFault:
+str = "eSyncTagCheckFault";
+break;
 
   // SIGILL crash reasons.
   case CrashReason::eIllegalOpcode:


Index: lldb/source/Plugins/Process/POSIX/CrashReason.h
===
--- lldb/source/Plugins/Process/POSIX/CrashReason.h
+++ lldb/source/Plugins/Process/POSIX/CrashReason.h
@@ -22,6 +22,8 @@
   eInvalidAddress,
   ePrivilegedAddress,
   eBoundViolation,
+  eAsyncTagCheckFault,
+  eSyncTagCheckFault,
 
   // SIGILL crash reasons.
   eIllegalOpcode,
Index: lldb/source/Plugins/Process/POSIX/CrashReason.cpp
===
--- lldb/source/Plugins/Process/POSIX/CrashReason.cpp
+++ lldb/source/Plugins/Process/POSIX/CrashReason.cpp
@@ -58,6 +58,16 @@
 #endif
   case SEGV_BNDERR:
 return CrashReason::eBoundViolation;
+#ifndef SEGV_MTEAERR
+#define SEGV_MTEAERR 8
+#endif
+  case SEGV_MTEAERR:
+return CrashReason::eAsyncTagCheckFault;
+#ifndef SEGV_MTESERR
+#define SEGV_MTESERR 9
+#endif
+  case SEGV_MTESERR:
+return CrashReason::eSyncTagCheckFault;
   }
 
   return CrashReason::eInvalidCrashReason;
@@ -166,6 +176,13 @@
   case CrashReason::eBoundViolation:
 str = "signal SIGSEGV: bound violation";
 break;
+  case CrashReason::eAsyncTagCheckFault:
+str = "signal SIGSEGV: async tag check fault";
+break;
+  case CrashReason::eSyncTagCheckFault:
+str = "signal SIGSEGV: sync tag check fault";
+AppendFaultAddr(str, fault_addr);
+break;
   case CrashReason::eIllegalOpcode:
 str = "signal SIGILL: illegal instruction";
 break;
@@ -246,6 +263,12 @@
   case CrashReason::eBoundViolation:
 str = "eBoundViolation";
 break;
+  case CrashReason::eAsyncTagCheckFault:
+str = "eAsyncTagCheckFault";
+break;
+  case CrashReason::eSyncTagCheckFault:
+str = "eSyncTagCheckFault";
+break;
 
   // SIGILL crash reasons.
   case CrashReason::eIllegalOpcode:
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D93495: CrashReason: Add MTE tag check faults to the list of crash reasons.

2020-12-21 Thread Peter Collingbourne via Phabricator via lldb-commits
pcc added a comment.

In D93495#2462581 , @DavidSpickett 
wrote:

> I assume that the signal displays without tag bits just like any other SEGV?
>
> I was thinking about testing but I don't see any tests for specific signals 
> so it would only be needed if your change to add the tag bits to siginfo has 
> gone in.
> (I have been following it from a distance but not sure of the status)

With 5.10 the tag bits don't appear but with the latest version of my patch 
series, which is due to land in 5.11, the tag bits will appear in si_addr in 
the siginfo retrieved via ptrace(PTRACE_GETSIGINFO) and therefore will appear 
in the fault address displayed by the debugger. The tag bits are only hidden 
from signal handlers, and then only if SA_EXPOSE_TAGBITS is clear, so they will 
be exposed to ptrace no matter whether the debuggee has SA_EXPOSE_TAGBITS clear 
or set in its signal handler. Note that the tag bits will be exposed for all 
faults with a fault address, not just SEGV_MTESERR (though with SEGV_MTESERR we 
only get the low nibble of the tag due to hardware limitations).

I verified all of this behavior in FVP and also noticed that I didn't add a 
line of code here that makes the fault address visible in the sync tag check 
fault case so I've now added it.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D93495/new/

https://reviews.llvm.org/D93495

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


[Lldb-commits] [PATCH] D93663: [lldb] Abstract scoped timer logic behind LLDB_SCOPED_TIMER (NFC)

2020-12-21 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere created this revision.
JDevlieghere added reviewers: LLDB, labath, mib.
Herald added subscribers: arphaman, sbc100, emaste.
Herald added a reviewer: espindola.
JDevlieghere requested review of this revision.
Herald added subscribers: MaskRay, aheejin.

This patch introduces a `LLDB_SCOPED_TIMER` macro to hide the needlessly 
repetitive creation of scoped timers in LLDB. It's similar to the `LLDB_LOG(F)` 
macro.


https://reviews.llvm.org/D93663

Files:
  lldb/include/lldb/Utility/Timer.h
  lldb/source/API/SystemInitializerFull.cpp
  lldb/source/Commands/CommandObjectTarget.cpp
  lldb/source/Core/Disassembler.cpp
  lldb/source/Core/Mangled.cpp
  lldb/source/Core/Module.cpp
  lldb/source/Initialization/SystemInitializerCommon.cpp
  lldb/source/Interpreter/CommandInterpreter.cpp
  lldb/source/Plugins/LanguageRuntime/CPlusPlus/CPPLanguageRuntime.cpp
  
lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
  lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp
  lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
  lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
  lldb/source/Plugins/ScriptInterpreter/Lua/ScriptInterpreterLua.cpp
  lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
  lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp
  lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp
  lldb/source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.cpp
  lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
  lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
  lldb/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp
  lldb/source/Plugins/SymbolVendor/wasm/SymbolVendorWasm.cpp
  lldb/source/Symbol/CompileUnit.cpp
  lldb/source/Symbol/DWARFCallFrameInfo.cpp
  lldb/source/Symbol/LocateSymbolFile.cpp
  lldb/source/Symbol/ObjectFile.cpp
  lldb/source/Symbol/Symtab.cpp
  lldb/source/Target/Target.cpp
  lldb/source/Target/TargetList.cpp
  lldb/tools/lldb-test/SystemInitializerTest.cpp

Index: lldb/tools/lldb-test/SystemInitializerTest.cpp
===
--- lldb/tools/lldb-test/SystemInitializerTest.cpp
+++ lldb/tools/lldb-test/SystemInitializerTest.cpp
@@ -54,9 +54,6 @@
 }
 
 void SystemInitializerTest::Terminate() {
-  static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);
-  Timer scoped_timer(func_cat, LLVM_PRETTY_FUNCTION);
-
   Debugger::SettingsTerminate();
 
   // Terminate and unload and loaded system or user LLDB plug-ins
Index: lldb/source/Target/TargetList.cpp
===
--- lldb/source/Target/TargetList.cpp
+++ lldb/source/Target/TargetList.cpp
@@ -286,10 +286,9 @@
 LoadDependentFiles load_dependent_files,
 lldb::PlatformSP &platform_sp,
 lldb::TargetSP &target_sp) {
-  static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);
-  Timer scoped_timer(
-  func_cat, "TargetList::CreateTarget (file = '%s', arch = '%s')",
-  user_exe_path.str().c_str(), specified_arch.GetArchitectureName());
+  LLDB_SCOPED_TIMERF("TargetList::CreateTarget (file = '%s', arch = '%s')",
+ user_exe_path.str().c_str(),
+ specified_arch.GetArchitectureName());
   Status error;
   const bool is_dummy_target = false;
 
Index: lldb/source/Target/Target.cpp
===
--- lldb/source/Target/Target.cpp
+++ lldb/source/Target/Target.cpp
@@ -1400,9 +1400,7 @@
   ClearModules(false);
 
   if (executable_sp) {
-static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);
-Timer scoped_timer(func_cat,
-   "Target::SetExecutableModule (executable = '%s')",
+LLDB_SCOPED_TIMERF("Target::SetExecutableModule (executable = '%s')",
executable_sp->GetFileSpec().GetPath().c_str());
 
 const bool notify = true;
Index: lldb/source/Symbol/Symtab.cpp
===
--- lldb/source/Symbol/Symtab.cpp
+++ lldb/source/Symbol/Symtab.cpp
@@ -251,8 +251,7 @@
   // Protected function, no need to lock mutex...
   if (!m_name_indexes_computed) {
 m_name_indexes_computed = true;
-static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);
-Timer scoped_timer(func_cat, "%s", LLVM_PRETTY_FUNCTION);
+LLDB_SCOPED_TIMER();
 // Create the name index vector to be able to quickly search by name
 const size_t num_symbols = m_symbols.size();
 m_name_to_index.Reserve(num_symbols);
@@ -411,9 +410,8 @@
 void Symtab::AppendSymbolNamesToMap(const IndexCollection &indexes,
 bool add_demangled, bool add_mangled,
 NameToIndexMap &name_to_index_map) const {
+  LLDB_SCOPED_TIMER();
   if (add_demangled || add_mangled) {
-static Timer::Category f

[Lldb-commits] [PATCH] D93541: [Process/NetBSD] Copy changes from FreeBSDRemote and reformat

2020-12-21 Thread Michał Górny via Phabricator via lldb-commits
mgorny updated this revision to Diff 313201.
mgorny retitled this revision from "[Process/NetBSD] Copy changes from 
FreeBSDRemote and reformat [WIP]" to "[Process/NetBSD] Copy changes from 
FreeBSDRemote and reformat".
mgorny edited the summary of this revision.
mgorny added a comment.

Fixed FPR writing bug, updated tests and removed anonymous namespace.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D93541/new/

https://reviews.llvm.org/D93541

Files:
  lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp
  lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.h
  lldb/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD_x86_64.cpp
  lldb/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD_x86_64.h
  lldb/test/API/python_api/lldbutil/iter/TestRegistersIterator.py
  lldb/test/API/tools/lldb-server/TestLldbGdbServer.py
  
lldb/test/API/tools/lldb-server/registers-target-xml-reading/TestGdbRemoteTargetXmlPacket.py

Index: lldb/test/API/tools/lldb-server/registers-target-xml-reading/TestGdbRemoteTargetXmlPacket.py
===
--- lldb/test/API/tools/lldb-server/registers-target-xml-reading/TestGdbRemoteTargetXmlPacket.py
+++ lldb/test/API/tools/lldb-server/registers-target-xml-reading/TestGdbRemoteTargetXmlPacket.py
@@ -12,7 +12,6 @@
 
 mydir = TestBase.compute_mydir(__file__)
 
-@expectedFailureNetBSD
 @llgs_test
 def test_g_target_xml_returns_correct_data(self):
 self.build()
Index: lldb/test/API/tools/lldb-server/TestLldbGdbServer.py
===
--- lldb/test/API/tools/lldb-server/TestLldbGdbServer.py
+++ lldb/test/API/tools/lldb-server/TestLldbGdbServer.py
@@ -335,7 +335,6 @@
 "Advanced Vector Extensions" in register_sets)
 
 @expectedFailureAll(oslist=["windows"]) # no avx for now.
-@expectedFailureAll(oslist=["netbsd"])
 @llgs_test
 def test_qRegisterInfo_contains_avx_registers_llgs(self):
 self.build()
@@ -499,7 +498,6 @@
 self.set_inferior_startup_launch()
 self.p_returns_correct_data_size_for_each_qRegisterInfo()
 
-@expectedFailureAll(oslist=["netbsd"])
 @llgs_test
 def test_p_returns_correct_data_size_for_each_qRegisterInfo_launch_llgs(
 self):
@@ -515,7 +513,6 @@
 self.set_inferior_startup_attach()
 self.p_returns_correct_data_size_for_each_qRegisterInfo()
 
-@expectedFailureAll(oslist=["netbsd"])
 @llgs_test
 def test_p_returns_correct_data_size_for_each_qRegisterInfo_attach_llgs(
 self):
Index: lldb/test/API/python_api/lldbutil/iter/TestRegistersIterator.py
===
--- lldb/test/API/python_api/lldbutil/iter/TestRegistersIterator.py
+++ lldb/test/API/python_api/lldbutil/iter/TestRegistersIterator.py
@@ -23,7 +23,6 @@
 'main.cpp', '// Set break point at this line.')
 
 @add_test_categories(['pyapi'])
-@expectedFailureNetBSD
 def test_iter_registers(self):
 """Test iterator works correctly for lldbutil.iter_registers()."""
 self.build()
Index: lldb/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD_x86_64.h
===
--- lldb/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD_x86_64.h
+++ lldb/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD_x86_64.h
@@ -18,6 +18,8 @@
 #include 
 // clang-format on
 
+#include 
+
 #include "Plugins/Process/NetBSD/NativeRegisterContextNetBSD.h"
 #include "Plugins/Process/Utility/RegisterContext_x86.h"
 #include "Plugins/Process/Utility/NativeRegisterContextWatchpoint_x86.h"
@@ -53,18 +55,34 @@
 
 private:
   // Private member types.
-  enum { GPRegSet, XStateRegSet, DBRegSet };
+  enum RegSetKind {
+GPRegSet,
+FPRegSet,
+DBRegSet,
+MaxRegularRegSet = DBRegSet,
+YMMRegSet,
+MPXRegSet,
+MaxRegSet = MPXRegSet,
+  };
 
   // Private member variables.
-  struct reg m_gpr;
-  struct xstate m_xstate;
-  struct dbreg m_dbr;
+  std::array m_gpr;
+  std::array m_xstate;
+  std::array m_dbr;
+  std::array m_regset_offsets;
+
+  llvm::Optional GetSetForNativeRegNum(uint32_t reg_num) const;
+
+  Status ReadRegisterSet(RegSetKind set);
+  Status WriteRegisterSet(RegSetKind set);
 
-  int GetSetForNativeRegNum(int reg_num) const;
-  int GetDR(int num) const;
+  uint8_t *GetOffsetRegSetData(RegSetKind set, size_t reg_offset);
 
-  Status ReadRegisterSet(uint32_t set);
-  Status WriteRegisterSet(uint32_t set);
+  struct YMMSplitPtr {
+void *xmm;
+void *ymm_hi;
+  };
+  llvm::Optional GetYMMSplitReg(uint32_t reg);
 };
 
 } // namespace process_netbsd
Index: lldb/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD_x86_64.cpp
===
--- lldb/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD_x86_64.cpp
+++ lldb/source/Plugins

[Lldb-commits] [PATCH] D93663: [lldb] Abstract scoped timer logic behind LLDB_SCOPED_TIMER (NFC)

2020-12-21 Thread Med Ismail Bennani via Phabricator via lldb-commits
mib accepted this revision.
mib added a comment.
This revision is now accepted and ready to land.

LGTM.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D93663/new/

https://reviews.llvm.org/D93663

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