pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

lldb-netbsd: Regnerate RegisterContextNetBSD patch



Module Name:	pkgsrc-wip
Committed By:	Kamil Rytarowski <n54%gmx.com@localhost>
Pushed By:	kamil
Date:		Thu Feb 23 09:43:04 2017 +0100
Changeset:	1fcc788326d631f3f7cb229c549377e24a0a83b0

Modified Files:
	lldb-git/distinfo
	lldb-git/patches/patch-source_Plugins_Process_Utility_RegisterContextNetBSD__x86__64.cpp

Log Message:
lldb-netbsd: Regnerate RegisterContextNetBSD patch

It got broken for some reason.

Sponsored by <The NetBSD Foundation>

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=1fcc788326d631f3f7cb229c549377e24a0a83b0

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 lldb-git/distinfo                                  |   2 +-
 ...cess_Utility_RegisterContextNetBSD__x86__64.cpp | 181 +++++----------------
 2 files changed, 40 insertions(+), 143 deletions(-)

diffs:
diff --git a/lldb-git/distinfo b/lldb-git/distinfo
index 7c61917d08..d1207eab0a 100644
--- a/lldb-git/distinfo
+++ b/lldb-git/distinfo
@@ -12,4 +12,4 @@ Size (libcxx-3.6.2.src.tar.xz) = 944020 bytes
 SHA1 (llvm-3.6.2.src.tar.xz) = 7a00257eb2bc9431e4c77c3a36b033072c54bc7e
 RMD160 (llvm-3.6.2.src.tar.xz) = 521cbc5fe2925ea3c6e90c7a31f752a04045c972
 Size (llvm-3.6.2.src.tar.xz) = 12802380 bytes
-SHA1 (patch-source_Plugins_Process_Utility_RegisterContextNetBSD__x86__64.cpp) = 7dcbdc33347ecc70c512d83357a7e196aa8bd2f3
+SHA1 (patch-source_Plugins_Process_Utility_RegisterContextNetBSD__x86__64.cpp) = 755266e51d86bc697ba828818fdbd117d6193318
diff --git a/lldb-git/patches/patch-source_Plugins_Process_Utility_RegisterContextNetBSD__x86__64.cpp b/lldb-git/patches/patch-source_Plugins_Process_Utility_RegisterContextNetBSD__x86__64.cpp
index a783788191..1e6829c950 100644
--- a/lldb-git/patches/patch-source_Plugins_Process_Utility_RegisterContextNetBSD__x86__64.cpp
+++ b/lldb-git/patches/patch-source_Plugins_Process_Utility_RegisterContextNetBSD__x86__64.cpp
@@ -1,145 +1,33 @@
 $NetBSD$
 
---- source/Plugins/Process/Utility/RegisterContextNetBSD_x86_64.cpp.orig	2017-02-23 08:00:03.141919827 +0000
+--- source/Plugins/Process/Utility/RegisterContextNetBSD_x86_64.cpp.orig	2016-10-19 22:25:12.000000000 +0000
 +++ source/Plugins/Process/Utility/RegisterContextNetBSD_x86_64.cpp
-@@ -90,410 +90,6 @@ static std::vector<lldb_private::Registe
- }
+@@ -47,10 +47,14 @@ typedef struct _GPR {
+   uint64_t ss;     /* 25 */
+ } GPR;
  
- static const RegisterInfo *
--GetRegisterInfo_i386(const lldb_private::ArchSpec &arch) {
--  static std::vector<lldb_private::RegisterInfo> g_register_infos(
--      GetSharedRegisterInfoVector());
--
--  // Allocate RegisterInfo only once
--  if (g_register_infos.empty()) {
--    // Copy the register information from base class
--    std::unique_ptr<RegisterContextFreeBSD_i386> reg_interface(
--        new RegisterContextFreeBSD_i386(arch));
--    const RegisterInfo *base_info = reg_interface->GetRegisterInfo();
--    g_register_infos.insert(g_register_infos.end(), &base_info[0],
--                            &base_info[k_num_registers_i386]);
--
--
--//---------------------------------------------------------------------------
--// Include RegisterInfos_x86_64 to update the g_register_infos structure
--//  with x86_64 offsets.
--//---------------------------------------------------------------------------
--#define UPDATE_REGISTER_INFOS_I386_STRUCT_WITH_X86_64_OFFSETS
--#include "RegisterInfos_x86_64.h"
--#undef UPDATE_REGISTER_INFOS_I386_STRUCT_WITH_X86_64_OFFSETS
--  }
--
--  return &g_register_infos[0];
--}
--
--static const RegisterInfo *
--PrivateGetRegisterInfoPtr(const lldb_private::ArchSpec &target_arch) {
--  switch (target_arch.GetMachine()) {
--  case llvm::Triple::x86_64:
--    return g_register_infos_x86_64;
--  default:
--    assert(false && "Unhandled target architecture.");
--    return nullptr;
--  }
--}
--
--static uint32_t
--PrivateGetRegisterCount(const lldb_private::ArchSpec &target_arch) {
--  switch (target_arch.GetMachine()) {
--  case llvm::Triple::x86_64:
--    return static_cast<uint32_t>(sizeof(g_register_infos_x86_64) /
--                                 sizeof(g_register_infos_x86_64[0]));
--  default:
--    assert(false && "Unhandled target architecture.");
--    return 0;
--  }
--}
--
--RegisterContextNetBSD_x86_64::RegisterContextNetBSD_x86_64(
--    const ArchSpec &target_arch)
--    : lldb_private::RegisterInfoInterface(target_arch),
--      m_register_info_p(PrivateGetRegisterInfoPtr(target_arch)),
--      m_register_count(PrivateGetRegisterCount(target_arch)) {}
--
--size_t RegisterContextNetBSD_x86_64::GetGPRSize() const { return sizeof(GPR); }
--
--const RegisterInfo *RegisterContextNetBSD_x86_64::GetRegisterInfo() const {
--  return m_register_info_p;
--}
--
--uint32_t RegisterContextNetBSD_x86_64::GetRegisterCount() const {
--  return m_register_count;
--}
--//===-- RegisterContextNetBSD_x86_64.cpp ------------------------*- C++ -*-===//
--//
--//                     The LLVM Compiler Infrastructure
--//
--// This file is distributed under the University of Illinois Open Source
--// License. See LICENSE.TXT for details.
--//
--//===----------------------------------------------------------------------===//
--
--#include "RegisterContextNetBSD_x86_64.h"
--#include "RegisterContextPOSIX_x86.h"
--#include "llvm/ADT/Triple.h"
--#include "llvm/Support/Compiler.h"
--#include <cassert>
--#include <cstddef>
--
--using namespace lldb_private;
--using namespace lldb;
--
--// src/sys/arch/amd64/include/frame_regs.h
--typedef struct _GPR {
--  uint64_t rdi;    /*  0 */
--  uint64_t rsi;    /*  1 */
--  uint64_t rdx;    /*  2 */
--  uint64_t rcx;    /*  3 */
--  uint64_t r8;     /*  4 */
--  uint64_t r9;     /*  5 */
--  uint64_t r10;    /*  6 */
--  uint64_t r11;    /*  7 */
--  uint64_t r12;    /*  8 */
--  uint64_t r13;    /*  9 */
--  uint64_t r14;    /* 10 */
--  uint64_t r15;    /* 11 */
--  uint64_t rbp;    /* 12 */
--  uint64_t rbx;    /* 13 */
--  uint64_t rax;    /* 14 */
--  uint64_t gs;     /* 15 */
--  uint64_t fs;     /* 16 */
--  uint64_t es;     /* 17 */
--  uint64_t ds;     /* 18 */
--  uint64_t trapno; /* 19 */
--  uint64_t err;    /* 20 */
--  uint64_t rip;    /* 21 */
--  uint64_t cs;     /* 22 */
--  uint64_t rflags; /* 23 */
--  uint64_t rsp;    /* 24 */
--  uint64_t ss;     /* 25 */
--} GPR;
--
 -/*
 - * As of NetBSD-7.99.25 there is no support for debug registers
 - * https://en.wikipedia.org/wiki/X86_debug_register
 - */
--
--/*
-- * src/sys/arch/amd64/include/mcontext.h
-- *
-- * typedef struct {
-- *       __gregset_t     __gregs;
-- *       __greg_t        _mc_tlsbase;
-- *       __fpregset_t    __fpregs;
-- * } mcontext_t;
-- */
--
--struct UserArea {
--  GPR gpr;
--  uint64_t mc_tlsbase;
--  FPR fpr;
--};
--
++struct DBG {
++  uint64_t dr[16]; /* debug registers */
++                   /* Index 0-3: debug address registers */
++                   /* Index 4-5: reserved */
++                   /* Index 6: debug status */
++                   /* Index 7: debug control */
++                   /* Index 8-15: reserved */
++};
+ 
+ /*
+  * src/sys/arch/amd64/include/mcontext.h
+@@ -66,276 +70,24 @@ struct UserArea {
+   GPR gpr;
+   uint64_t mc_tlsbase;
+   FPR fpr;
++  DBG dbg;
+ };
+ 
 -//---------------------------------------------------------------------------
 -// Cherry-pick parts of RegisterInfos_x86_64.h, without debug registers
 -//---------------------------------------------------------------------------
@@ -200,7 +88,8 @@ $NetBSD$
 -             LLDB_INVALID_REGNUM, lldb_st##i##_x86_64 },                       \
 -             nullptr, nullptr, nullptr, 0                                      \
 -  }
--
++#define DR_OFFSET(reg_index) (LLVM_EXTENSION offsetof(DBG, dr[reg_index]))
+ 
 -#define DEFINE_FP_MM(reg, i)                                                   \
 -  {                                                                            \
 -    #reg #i, nullptr, sizeof(uint64_t),                                        \
@@ -404,12 +293,20 @@ $NetBSD$
 -    DEFINE_YMM(ymm, 12), DEFINE_YMM(ymm, 13), DEFINE_YMM(ymm, 14),
 -    DEFINE_YMM(ymm, 15),
 -};
--
--//---------------------------------------------------------------------------
+ 
+ //---------------------------------------------------------------------------
 -// End of cherry-pick of RegisterInfos_x86_64.h
--//---------------------------------------------------------------------------
--
--static const RegisterInfo *
++// Include RegisterInfos_x86_64 to declare our g_register_infos_x86_64
++// structure.
+ //---------------------------------------------------------------------------
++#define DECLARE_REGISTER_INFOS_X86_64_STRUCT
++#include "RegisterInfos_x86_64.h"
++#undef DECLARE_REGISTER_INFOS_X86_64_STRUCT
++
++static std::vector<lldb_private::RegisterInfo> &GetSharedRegisterInfoVector() {
++  static std::vector<lldb_private::RegisterInfo> register_infos;
++  return register_infos;
++}
+ 
+ static const RegisterInfo *
  PrivateGetRegisterInfoPtr(const lldb_private::ArchSpec &target_arch) {
-   switch (target_arch.GetMachine()) {
-   case llvm::Triple::x86_64:


Home | Main Index | Thread Index | Old Index