pkgsrc-WIP-changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
edb-debugger: Drop local patches and upgrade to 0.9.21
Module Name: pkgsrc-wip
Committed By: Kamil Rytarowski <n54%gmx.com@localhost>
Pushed By: kamil
Date: Wed Feb 8 20:10:23 2017 +0100
Changeset: 87316558bcd469b2002b8eb3513902e739eac96c
Modified Files:
edb-debugger/Makefile
edb-debugger/distinfo
Removed Files:
edb-debugger/patches/patch-plugins_BinaryInfo_ELF32.cpp
edb-debugger/patches/patch-plugins_BinaryInfo_ELF64.cpp
edb-debugger/patches/patch-plugins_DebuggerCore_DebuggerCore.pro
edb-debugger/patches/patch-plugins_DebuggerCore_unix_netbsd_DebuggerCore.cpp
edb-debugger/patches/patch-plugins_DebuggerCore_unix_netbsd_DebuggerCore.h
edb-debugger/patches/patch-plugins_DebuggerCore_unix_netbsd_PlatformEvent.cpp
edb-debugger/patches/patch-plugins_DebuggerCore_unix_netbsd_PlatformEvent.h
edb-debugger/patches/patch-plugins_DebuggerCore_unix_netbsd_PlatformRegion.cpp
edb-debugger/patches/patch-plugins_DebuggerCore_unix_netbsd_PlatformRegion.h
edb-debugger/patches/patch-plugins_DebuggerCore_unix_netbsd_PlatformState.cpp
edb-debugger/patches/patch-plugins_DebuggerCore_unix_netbsd_PlatformState.h
edb-debugger/patches/patch-plugins_HeapAnalyzer_DialogHeap.cpp
edb-debugger/patches/patch-plugins_ProcessProperties_DialogProcessProperties.cpp
edb-debugger/patches/patch-plugins_plugins.pri
edb-debugger/patches/patch-src_Debugger.cpp
edb-debugger/patches/patch-src_src.pro
Log Message:
edb-debugger: Drop local patches and upgrade to 0.9.21
Incomplete update. This debugger will be used to verify register contexts.
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=87316558bcd469b2002b8eb3513902e739eac96c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
diffstat:
edb-debugger/Makefile | 25 +-
edb-debugger/distinfo | 24 +-
.../patches/patch-plugins_BinaryInfo_ELF32.cpp | 13 -
.../patches/patch-plugins_BinaryInfo_ELF64.cpp | 13 -
.../patch-plugins_DebuggerCore_DebuggerCore.pro | 16 -
...ugins_DebuggerCore_unix_netbsd_DebuggerCore.cpp | 651 ---------------------
...plugins_DebuggerCore_unix_netbsd_DebuggerCore.h | 111 ----
...gins_DebuggerCore_unix_netbsd_PlatformEvent.cpp | 264 ---------
...lugins_DebuggerCore_unix_netbsd_PlatformEvent.h | 67 ---
...ins_DebuggerCore_unix_netbsd_PlatformRegion.cpp | 101 ----
...ugins_DebuggerCore_unix_netbsd_PlatformRegion.h | 73 ---
...gins_DebuggerCore_unix_netbsd_PlatformState.cpp | 398 -------------
...lugins_DebuggerCore_unix_netbsd_PlatformState.h | 73 ---
.../patch-plugins_HeapAnalyzer_DialogHeap.cpp | 22 -
...s_ProcessProperties_DialogProcessProperties.cpp | 13 -
edb-debugger/patches/patch-plugins_plugins.pri | 27 -
edb-debugger/patches/patch-src_Debugger.cpp | 22 -
edb-debugger/patches/patch-src_src.pro | 58 --
18 files changed, 18 insertions(+), 1953 deletions(-)
diffs:
diff --git a/edb-debugger/Makefile b/edb-debugger/Makefile
index 5c7a8e32a1..ef439ebe0e 100644
--- a/edb-debugger/Makefile
+++ b/edb-debugger/Makefile
@@ -1,24 +1,27 @@
# $NetBSD$
-DISTNAME= debugger-0.9.20
-PKGNAME= edb-${DISTNAME}
+DISTNAME= edb-debugger-0.9.21
CATEGORIES= devel
-MASTER_SITES= http://www.codef00.com/downloads/
-EXTRACT_SUFX= .tgz
+MASTER_SITES= ${MASTER_SITE_GITHUB:=eteran/}
-WRKSRC= ${WRKDIR}/debugger
+#WRKSRC= ${WRKDIR}/debugger
MAINTAINER= pkgsrc-users%NetBSD.org@localhost
HOMEPAGE= http://codef00.com/projects#debugger
COMMENT= Cross platform x86/x86-64 debugger
LICENSE= gnu-gpl-v2
+USE_CMAKE= yes
USE_LANGUAGES= c c++
+USE_TOOLS+= pkg-config
-do-configure:
- ${RUN} cd ${WRKSRC} && ${QTDIR}/bin/qmake -makefile DEFAULT_PLUGIN_PATH="${PREFIX}/lib/${PKGBASE}/"
-
-.include "../../devel/boost-headers/buildlink3.mk"
-.include "../../x11/qt4-libs/buildlink3.mk"
-.include "../../x11/qt4-tools/buildlink3.mk"
+#do-configure:
+# ${RUN} cd ${WRKSRC} && ${QTDIR}/bin/qmake -makefile DEFAULT_PLUGIN_PATH="${PREFIX}/lib/${PKGBASE}/"
+#
+#.include "../../devel/boost-headers/buildlink3.mk"
+#.include "../../x11/qt4-libs/buildlink3.mk"
+#.include "../../x11/qt4-tools/buildlink3.mk"
+.include "../../x11/qt5-qtxmlpatterns/buildlink3.mk"
+.include "../../x11/qt5-qtbase/buildlink3.mk"
+.include "../../devel/capstone/buildlink3.mk"
.include "../../mk/bsd.pkg.mk"
diff --git a/edb-debugger/distinfo b/edb-debugger/distinfo
index b3759f8622..296edb2e66 100644
--- a/edb-debugger/distinfo
+++ b/edb-debugger/distinfo
@@ -1,22 +1,6 @@
$NetBSD$
-SHA1 (debugger-0.9.20.tgz) = 4a0c839caab185bf8834725f3ae6fab79b11b816
-RMD160 (debugger-0.9.20.tgz) = 0302f5e3d26d6ae23c549113021cce442d5e3483
-SHA512 (debugger-0.9.20.tgz) = c65c023c351ee7aee47dbb743a6e84e9b9c680e9eef39caa1a873903c53aa48b451ea92b5363720d55277d81ca8a95741c0777a2748da9fb6d09957ff000ecb1
-Size (debugger-0.9.20.tgz) = 791820 bytes
-SHA1 (patch-plugins_BinaryInfo_ELF32.cpp) = bf9ea68d80be00f4ccfdbeecdb774916a8491954
-SHA1 (patch-plugins_BinaryInfo_ELF64.cpp) = 255a25419ec7eaaa3231eb168c7dac2c92430fbe
-SHA1 (patch-plugins_DebuggerCore_DebuggerCore.pro) = 2afec83ad714818d6535327f6f0b64a448d3b77c
-SHA1 (patch-plugins_DebuggerCore_unix_netbsd_DebuggerCore.cpp) = a77e980a124dac49a8aad44ff397913a56ad6cb7
-SHA1 (patch-plugins_DebuggerCore_unix_netbsd_DebuggerCore.h) = 1e841035c6238d2f36e588306b44991b0cebcefa
-SHA1 (patch-plugins_DebuggerCore_unix_netbsd_PlatformEvent.cpp) = e4d386f0f7f2bacdb419d6811ca853913b14a6ac
-SHA1 (patch-plugins_DebuggerCore_unix_netbsd_PlatformEvent.h) = 047ea37f192c5da8a96e4f1ee7d0c21fe72a6d6e
-SHA1 (patch-plugins_DebuggerCore_unix_netbsd_PlatformRegion.cpp) = d760076ead3167e1b04a072b1d61321c7f8ea148
-SHA1 (patch-plugins_DebuggerCore_unix_netbsd_PlatformRegion.h) = b41a91d68f9d649a967fc60be08939d3dea92c85
-SHA1 (patch-plugins_DebuggerCore_unix_netbsd_PlatformState.cpp) = 4ae2040b5ce27747f37ba472ddf76d49a1459505
-SHA1 (patch-plugins_DebuggerCore_unix_netbsd_PlatformState.h) = 3affef2a2462fc7952e7eee38cba19ee7d0fa2bc
-SHA1 (patch-plugins_HeapAnalyzer_DialogHeap.cpp) = 7e58098de5024568ad5db428d772507283d83d31
-SHA1 (patch-plugins_ProcessProperties_DialogProcessProperties.cpp) = b115da629d9cc9342d360765866c6d5059fd774b
-SHA1 (patch-plugins_plugins.pri) = 98faafa752786f32be035b3c9760159baad2034d
-SHA1 (patch-src_Debugger.cpp) = ba7425b45916b72e6ed81f01b413d03989dcac9f
-SHA1 (patch-src_src.pro) = a3e6d14c9db3f707022b1d710e68d7b3c0996354
+SHA1 (edb-debugger-0.9.21.tar.gz) = eff050b5ec53f02ebc96dbbb80f1731036e2c6f6
+RMD160 (edb-debugger-0.9.21.tar.gz) = d7821e07b607667090b1158b559053856ef077de
+SHA512 (edb-debugger-0.9.21.tar.gz) = 88a04cafb2c27a3af6bcfc48c841c795fb5bba348f64fe52957716c2c03e4cd056d045b241135c5be7fd7174d2c5a35fa5c95dc2b6aad4fb5c04f4fe36ab4f0d
+Size (edb-debugger-0.9.21.tar.gz) = 996932 bytes
diff --git a/edb-debugger/patches/patch-plugins_BinaryInfo_ELF32.cpp b/edb-debugger/patches/patch-plugins_BinaryInfo_ELF32.cpp
deleted file mode 100644
index 07f8129bfa..0000000000
--- a/edb-debugger/patches/patch-plugins_BinaryInfo_ELF32.cpp
+++ /dev/null
@@ -1,13 +0,0 @@
-$NetBSD$
-
---- plugins/BinaryInfo/ELF32.cpp.orig 2014-01-08 02:59:13.000000000 +0000
-+++ plugins/BinaryInfo/ELF32.cpp
-@@ -28,7 +28,7 @@ along with this program. If not, see <h
- #include <QFile>
- #include <cstring>
-
--#if defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD) || defined(Q_OS_OPENBSD)
-+#if defined(Q_OS_FREEBSD) || defined(Q_OS_LINUX) || defined(Q_OS_NETBSD) || defined(Q_OS_OPENBSD)
- #include <link.h>
- #endif
-
diff --git a/edb-debugger/patches/patch-plugins_BinaryInfo_ELF64.cpp b/edb-debugger/patches/patch-plugins_BinaryInfo_ELF64.cpp
deleted file mode 100644
index c08bcf92c3..0000000000
--- a/edb-debugger/patches/patch-plugins_BinaryInfo_ELF64.cpp
+++ /dev/null
@@ -1,13 +0,0 @@
-$NetBSD$
-
---- plugins/BinaryInfo/ELF64.cpp.orig 2014-01-08 02:59:13.000000000 +0000
-+++ plugins/BinaryInfo/ELF64.cpp
-@@ -28,7 +28,7 @@ along with this program. If not, see <h
- #include <QFile>
- #include <cstring>
-
--#if defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD) || defined(Q_OS_OPENBSD)
-+#if defined(Q_OS_FREEBSD) || defined(Q_OS_LINUX) || defined(Q_OS_NETBSD) || defined(Q_OS_OPENBSD)
- #include <link.h>
- #endif
-
diff --git a/edb-debugger/patches/patch-plugins_DebuggerCore_DebuggerCore.pro b/edb-debugger/patches/patch-plugins_DebuggerCore_DebuggerCore.pro
deleted file mode 100644
index b4e6d1604e..0000000000
--- a/edb-debugger/patches/patch-plugins_DebuggerCore_DebuggerCore.pro
+++ /dev/null
@@ -1,16 +0,0 @@
-$NetBSD$
-
---- plugins/DebuggerCore/DebuggerCore.pro.orig 2013-07-26 01:50:18.000000000 +0000
-+++ plugins/DebuggerCore/DebuggerCore.pro
-@@ -13,6 +13,11 @@ unix {
- INCLUDEPATH += unix/linux
- }
-
-+ netbsd-* {
-+ VPATH += unix/netbsd
-+ INCLUDEPATH += unix/netbsd
-+ }
-+
- openbsd-* {
- VPATH += unix/openbsd
- INCLUDEPATH += unix/openbsd
diff --git a/edb-debugger/patches/patch-plugins_DebuggerCore_unix_netbsd_DebuggerCore.cpp b/edb-debugger/patches/patch-plugins_DebuggerCore_unix_netbsd_DebuggerCore.cpp
deleted file mode 100644
index 23a1217805..0000000000
--- a/edb-debugger/patches/patch-plugins_DebuggerCore_unix_netbsd_DebuggerCore.cpp
+++ /dev/null
@@ -1,651 +0,0 @@
-$NetBSD$
-
---- plugins/DebuggerCore/unix/netbsd/DebuggerCore.cpp.orig 2016-01-07 04:12:58.000000000 +0000
-+++ plugins/DebuggerCore/unix/netbsd/DebuggerCore.cpp
-@@ -0,0 +1,646 @@
-+/*
-+Copyright (C) 2006 - 2014 Evan Teran
-+ eteran%alum.rit.edu@localhost
-+
-+This program is free software: you can redistribute it and/or modify
-+it under the terms of the GNU General Public License as published by
-+the Free Software Foundation, either version 2 of the License, or
-+(at your option) any later version.
-+
-+This program is distributed in the hope that it will be useful,
-+but WITHOUT ANY WARRANTY; without even the implied warranty of
-+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+GNU General Public License for more details.
-+
-+You should have received a copy of the GNU General Public License
-+along with this program. If not, see <http://www.gnu.org/licenses/>.
-+*/
-+
-+#include "DebuggerCore.h"
-+#include "PlatformEvent.h"
-+#include "PlatformRegion.h"
-+#include "PlatformState.h"
-+#include "State.h"
-+#include "string_hash.h"
-+
-+#include <QDebug>
-+#include <QMessageBox>
-+
-+#include <cerrno>
-+#include <cstring>
-+
-+#include <fcntl.h>
-+#include <kvm.h>
-+#include <machine/reg.h>
-+#include <paths.h>
-+#include <signal.h>
-+#include <sys/exec.h>
-+#include <sys/lock.h>
-+#include <sys/mman.h>
-+#include <sys/param.h>
-+#include <sys/ptrace.h>
-+#include <sys/types.h>
-+#include <sys/user.h>
-+#include <sys/wait.h>
-+#include <unistd.h>
-+#include <uvm/uvm.h>
-+
-+#define __need_process
-+#include <sys/sysctl.h>
-+#include <sys/proc.h>
-+
-+namespace DebuggerCore {
-+
-+namespace {
-+int resume_code(int status) {
-+ if(WIFSIGNALED(status)) {
-+ return WTERMSIG(status);
-+ } else if(WIFSTOPPED(status)) {
-+ return WSTOPSIG(status);
-+ }
-+ return 0;
-+}
-+}
-+
-+//------------------------------------------------------------------------------
-+// Name: DebuggerCore
-+// Desc: constructor
-+//------------------------------------------------------------------------------
-+DebuggerCore::DebuggerCore() {
-+#if defined(_SC_PAGESIZE)
-+ page_size_ = sysconf(_SC_PAGESIZE);
-+#elif defined(_SC_PAGE_SIZE)
-+ page_size_ = sysconf(_SC_PAGE_SIZE);
-+#else
-+ page_size_ = PAGE_SIZE;
-+#endif
-+}
-+
-+//------------------------------------------------------------------------------
-+// Name:
-+// Desc:
-+//------------------------------------------------------------------------------
-+bool DebuggerCore::has_extension(quint64 ext) const {
-+ return false;
-+}
-+
-+//------------------------------------------------------------------------------
-+// Name: page_size
-+// Desc: returns the size of a page on this system
-+//------------------------------------------------------------------------------
-+edb::address_t DebuggerCore::page_size() const {
-+ return page_size_;
-+}
-+
-+//------------------------------------------------------------------------------
-+// Name: ~DebuggerCore
-+// Desc:
-+//------------------------------------------------------------------------------
-+DebuggerCore::~DebuggerCore() {
-+ detach();
-+}
-+
-+//------------------------------------------------------------------------------
-+// Name: wait_debug_event
-+// Desc: waits for a debug event, msecs is a timeout
-+// it will return false if an error or timeout occurs
-+//------------------------------------------------------------------------------
-+IDebugEvent::const_pointer DebuggerCore::wait_debug_event(int msecs) {
-+ if(attached()) {
-+ int status;
-+ bool timeout;
-+
-+ const edb::tid_t tid = native::waitpid_timeout(pid(), &status, 0, msecs, &timeout);
-+ if(!timeout) {
-+ if(tid > 0) {
-+
-+ // normal event
-+ PlatformEvent *const e = new PlatformEvent;
-+
-+ e->pid = pid();
-+ e->tid = tid;
-+ e->status = status;
-+
-+ char errbuf[_POSIX2_LINE_MAX];
-+ if(kvm_t *const kd = kvm_openfiles(NULL, NULL, NULL, O_RDONLY, errbuf)) {
-+ int rc;
-+ struct kinfo_proc *const kiproc = kvm_getprocs(kd, KERN_PROC_PID, pid(), sizeof(struct kinfo_proc), &rc);
-+
-+ struct proc proc;
-+ kvm_read(kd, kiproc->p_paddr, &proc, sizeof(proc));
-+
-+ e->fault_code_ = proc.p_sicode;
-+ e->fault_address_ = proc.p_sigval.sival_ptr;
-+
-+ //printf("ps_sig : %d\n", sigacts.ps_sig);
-+ //printf("ps_type : %d\n", sigacts.ps_type);
-+
-+ kvm_close(kd);
-+ } else {
-+ e->fault_code_ = 0;
-+ e->fault_address_ = 0;
-+ }
-+
-+
-+ active_thread_ = tid;
-+ threads_[tid].status = status;
-+ return IDebugEvent::const_pointer(e);
-+ }
-+ }
-+ }
-+ return IDebugEvent::const_pointer();
-+}
-+
-+//------------------------------------------------------------------------------
-+// Name: read_data
-+// Desc:
-+//------------------------------------------------------------------------------
-+long DebuggerCore::read_data(edb::address_t address, bool *ok) {
-+
-+ Q_ASSERT(ok);
-+
-+ errno = 0;
-+ const long v = ptrace(PT_READ_D, pid(), reinterpret_cast<char*>(address), 0);
-+ SET_OK(*ok, v);
-+ return v;
-+}
-+
-+//------------------------------------------------------------------------------
-+// Name: write_data
-+// Desc:
-+//------------------------------------------------------------------------------
-+bool DebuggerCore::write_data(edb::address_t address, long value) {
-+ return ptrace(PT_WRITE_D, pid(), reinterpret_cast<char*>(address), value) != -1;
-+}
-+
-+//------------------------------------------------------------------------------
-+// Name: attach
-+// Desc:
-+//------------------------------------------------------------------------------
-+bool DebuggerCore::attach(edb::pid_t pid) {
-+ detach();
-+
-+ const long ret = ptrace(PT_ATTACH, pid, 0, 0);
-+ if(ret == 0) {
-+ pid_ = pid;
-+ active_thread_ = pid;
-+ threads_.clear();
-+ threads_.insert(pid, thread_info());
-+
-+ // TODO: attach to all of the threads
-+ }
-+
-+ return ret == 0;
-+}
-+
-+//------------------------------------------------------------------------------
-+// Name: detach
-+// Desc:
-+//------------------------------------------------------------------------------
-+void DebuggerCore::detach() {
-+ if(attached()) {
-+
-+ // TODO: do i need to stop each thread first, and wait for them?
-+
-+ clear_breakpoints();
-+ ptrace(PT_DETACH, pid(), 0, 0);
-+ pid_ = 0;
-+ threads_.clear();
-+ }
-+}
-+
-+//------------------------------------------------------------------------------
-+// Name: kill
-+// Desc:
-+//------------------------------------------------------------------------------
-+void DebuggerCore::kill() {
-+ if(attached()) {
-+ clear_breakpoints();
-+ ptrace(PT_KILL, pid(), 0, 0);
-+ native::waitpid(pid(), 0, WAIT_ANY);
-+ pid_ = 0;
-+ threads_.clear();
-+ }
-+}
-+
-+//------------------------------------------------------------------------------
-+// Name: pause
-+// Desc: stops *all* threads of a process
-+//------------------------------------------------------------------------------
-+void DebuggerCore::pause() {
-+ if(attached()) {
-+ for(threadmap_t::const_iterator it = threads_.begin(); it != threads_.end(); ++it) {
-+ ::kill(it.key(), SIGSTOP);
-+ }
-+ }
-+}
-+
-+//------------------------------------------------------------------------------
-+// Name: resume
-+// Desc:
-+//------------------------------------------------------------------------------
-+void DebuggerCore::resume(edb::EVENT_STATUS status) {
-+ // TODO: assert that we are paused
-+
-+ if(attached()) {
-+ if(status != edb::DEBUG_STOP) {
-+ const edb::tid_t tid = active_thread();
-+ const int code = (status == edb::DEBUG_EXCEPTION_NOT_HANDLED) ? resume_code(threads_[tid].status) : 0;
-+ ptrace(PT_CONTINUE, tid, reinterpret_cast<caddr_t>(1), code);
-+ }
-+ }
-+}
-+
-+//------------------------------------------------------------------------------
-+// Name: step
-+// Desc:
-+//------------------------------------------------------------------------------
-+void DebuggerCore::step(edb::EVENT_STATUS status) {
-+ // TODO: assert that we are paused
-+
-+ if(attached()) {
-+ if(status != edb::DEBUG_STOP) {
-+ const edb::tid_t tid = active_thread();
-+ const int code = (status == edb::DEBUG_EXCEPTION_NOT_HANDLED) ? resume_code(threads_[tid].status) : 0;
-+ ptrace(PT_STEP, tid, reinterpret_cast<caddr_t>(1), code);
-+ }
-+ }
-+}
-+
-+//------------------------------------------------------------------------------
-+// Name: get_state
-+// Desc:
-+//------------------------------------------------------------------------------
-+void DebuggerCore::get_state(State *state) {
-+
-+ Q_ASSERT(state);
-+
-+ // TODO: assert that we are paused
-+ PlatformState *const state_impl = static_cast<PlatformState *>(state->impl_);
-+
-+ if(attached()) {
-+ if(ptrace(PT_GETREGS, active_thread(), reinterpret_cast<char*>(&state_impl->regs_), 0) != -1) {
-+ // TODO
-+ state_impl->gs_base = 0;
-+ state_impl->fs_base = 0;
-+ }
-+
-+ if(ptrace(PT_GETFPREGS, active_thread(), reinterpret_cast<char*>(&state_impl->fpregs_), 0) != -1) {
-+ }
-+
-+ // TODO: Debug Registers
-+
-+ } else {
-+ state->clear();
-+ }
-+}
-+
-+//------------------------------------------------------------------------------
-+// Name: set_state
-+// Desc:
-+//------------------------------------------------------------------------------
-+void DebuggerCore::set_state(const State &state) {
-+
-+ // TODO: assert that we are paused
-+ PlatformState *const state_impl = static_cast<PlatformState *>(state.impl_);
-+
-+ if(attached()) {
-+ ptrace(PT_SETREGS, active_thread(), reinterpret_cast<char*>(&state_impl->regs_), 0);
-+
-+ // TODO: FPU
-+ // TODO: Debug Registers
-+ }
-+}
-+
-+//------------------------------------------------------------------------------
-+// Name: open
-+// Desc:
-+//------------------------------------------------------------------------------
-+bool DebuggerCore::open(const QString &path, const QString &cwd, const QList<QByteArray> &args, const QString &tty) {
-+ detach();
-+ pid_t pid;
-+
-+ switch(pid = fork()) {
-+ case 0:
-+ // we are in the child now...
-+
-+ // set ourselves (the child proc) up to be traced
-+ ptrace(PT_TRACE_ME, 0, 0, 0);
-+
-+ // redirect it's I/O
-+ if(!tty.isEmpty()) {
-+ FILE *const std_out = freopen(qPrintable(tty), "r+b", stdout);
-+ FILE *const std_in = freopen(qPrintable(tty), "r+b", stdin);
-+ FILE *const std_err = freopen(qPrintable(tty), "r+b", stderr);
-+
-+ Q_UNUSED(std_out);
-+ Q_UNUSED(std_in);
-+ Q_UNUSED(std_err);
-+ }
-+
-+ // do the actual exec
-+ execute_process(path, cwd, args);
-+
-+ // we should never get here!
-+ abort();
-+ break;
-+ case -1:
-+ // error!
-+ pid_ = 0;
-+ return false;
-+ default:
-+ // parent
-+ do {
-+ threads_.clear();
-+
-+ int status;
-+ if(native::waitpid(pid, &status, 0) == -1) {
-+ return false;
-+ }
-+
-+ // the very first event should be a STOP of type SIGTRAP
-+ if(!WIFSTOPPED(status) || WSTOPSIG(status) != SIGTRAP) {
-+ detach();
-+ return false;
-+ }
-+
-+ // setup the first event data for the primary thread
-+ threads_.insert(pid, thread_info());
-+ pid_ = pid;
-+ active_thread_ = pid;
-+ threads_[pid].status = status;
-+ return true;
-+ } while(0);
-+ break;
-+ }
-+}
-+
-+//------------------------------------------------------------------------------
-+// Name: set_active_thread
-+// Desc:
-+//------------------------------------------------------------------------------
-+void DebuggerCore::set_active_thread(edb::tid_t tid) {
-+ Q_ASSERT(threads_.contains(tid));
-+ active_thread_ = tid;
-+}
-+
-+
-+//------------------------------------------------------------------------------
-+// Name: create_state
-+// Desc:
-+//------------------------------------------------------------------------------
-+IState *DebuggerCore::create_state() const {
-+ return new PlatformState;
-+}
-+
-+//------------------------------------------------------------------------------
-+// Name: enumerate_processes
-+// Desc:
-+//------------------------------------------------------------------------------
-+QMap<edb::pid_t, Process> DebuggerCore::enumerate_processes() const {
-+ QMap<edb::pid_t, Process> ret;
-+
-+ char ebuffer[_POSIX2_LINE_MAX];
-+ int numprocs;
-+
-+ if(kvm_t *const kaccess = kvm_openfiles(NULL, NULL, NULL, O_RDONLY, ebuffer)) {
-+ if(struct kinfo_proc *const kprocaccess = kvm_getprocs(kaccess, KERN_PROC_ALL, 0, sizeof *kprocaccess, &numprocs)) {
-+ for(int i = 0; i < numprocs; ++i) {
-+ Process procInfo;
-+ procInfo.pid = kprocaccess[i].p_pid;
-+ procInfo.uid = kprocaccess[i].p_uid;
-+ procInfo.name = kprocaccess[i].p_comm;
-+
-+ ret.insert(procInfo.pid, procInfo);
-+ }
-+ }
-+ kvm_close(kaccess);
-+ } else {
-+ QMessageBox::warning(0, "Error Listing Processes", ebuffer);
-+ }
-+
-+ return ret;
-+}
-+
-+//------------------------------------------------------------------------------
-+// Name:
-+// Desc:
-+//------------------------------------------------------------------------------
-+QString DebuggerCore::process_exe(edb::pid_t pid) const {
-+ QString ret;
-+
-+ char errbuf[_POSIX2_LINE_MAX];
-+ if(kvm_t *kd = kvm_openfiles(NULL, NULL, NULL, O_RDONLY, errbuf)) {
-+ char p_comm[KI_MAXCOMLEN] = "";
-+ int rc;
-+ if(struct kinfo_proc *const proc = kvm_getprocs(kd, KERN_PROC_PID, pid, sizeof(struct kinfo_proc), &rc)) {
-+ memcpy(p_comm, proc->p_comm, sizeof(p_comm));
-+ }
-+
-+ kvm_close(kd);
-+ return p_comm;
-+ }
-+
-+ return ret;
-+}
-+
-+//------------------------------------------------------------------------------
-+// Name:
-+// Desc:
-+//------------------------------------------------------------------------------
-+QString DebuggerCore::process_cwd(edb::pid_t pid) const {
-+ // TODO: implement this
-+ return QString();
-+}
-+
-+//------------------------------------------------------------------------------
-+// Name:
-+// Desc:
-+//------------------------------------------------------------------------------
-+edb::pid_t DebuggerCore::parent_pid(edb::pid_t pid) const {
-+ edb::pid_t ret = 0;
-+ char errbuf[_POSIX2_LINE_MAX];
-+ if(kvm_t *kd = kvm_openfiles(NULL, NULL, NULL, O_RDONLY, errbuf)) {
-+ int rc;
-+ struct kinfo_proc *const proc = kvm_getprocs(kd, KERN_PROC_PID, pid, sizeof *proc, &rc);
-+ ret = proc->p_ppid;
-+ kvm_close(kd);
-+ }
-+ return ret;
-+}
-+
-+//------------------------------------------------------------------------------
-+// Name:
-+// Desc:
-+//------------------------------------------------------------------------------
-+QList<IRegion::pointer> DebuggerCore::memory_regions() const {
-+
-+ QList<IRegion::pointer> regions;
-+
-+ if(pid_ != 0) {
-+
-+ char err_buf[_POSIX2_LINE_MAX];
-+ if(kvm_t *const kd = kvm_openfiles(NULL, NULL, NULL, O_RDONLY, err_buf)) {
-+ int rc;
-+ struct kinfo_proc *const proc = kvm_getprocs(kd, KERN_PROC_PID, pid_, sizeof *proc, &rc);
-+ Q_ASSERT(proc);
-+
-+ struct vmspace vmsp;
-+
-+
-+ kvm_read(kd, proc->p_vmspace, &vmsp, sizeof vmsp);
-+
-+#if defined(OpenBSD) && (OpenBSD > 201205)
-+ uvm_map_addr root;
-+ RB_INIT(&root);
-+ if (load_vmmap_entries(kd, (u_long)RB_ROOT(&vmsp.vm_map.addr), &RB_ROOT(&root), NULL) == -1)
-+ goto do_unload;
-+
-+ struct vm_map_entry *e;
-+ RB_FOREACH(e, uvm_map_addr, &root) {
-+ const edb::address_t start = e->start;
-+ const edb::address_t end = e->end;
-+ const edb::address_t base = e->offset;
-+ const QString name = QString();
-+ const IRegion::permissions_t permissions =
-+ ((e->protection & VM_PROT_READ) ? PROT_READ : 0) |
-+ ((e->protection & VM_PROT_WRITE) ? PROT_WRITE : 0) |
-+ ((e->protection & VM_PROT_EXECUTE) ? PROT_EXEC : 0);
-+
-+ regions.push_back(IRegion::pointer(new PlatformRegion(start, end, base, name, permissions)));
-+ }
-+
-+do_unload:
-+ unload_vmmap_entries(RB_ROOT(&root));
-+#else
-+ struct vm_map_entry e;
-+ if(vmsp.vm_map.header.next != 0) {
-+ kvm_read(kd, (u_long)vmsp.vm_map.header.next, &e, sizeof(e));
-+ while(e.next != vmsp.vm_map.header.next) {
-+
-+ const edb::address_t start = e.start;
-+ const edb::address_t end = e.end;
-+ const edb::address_t base = e.offset;
-+ const QString name = QString();
-+ const IRegion::permissions_t permissions =
-+ ((e.protection & VM_PROT_READ) ? PROT_READ : 0) |
-+ ((e.protection & VM_PROT_WRITE) ? PROT_WRITE : 0) |
-+ ((e.protection & VM_PROT_EXECUTE) ? PROT_EXEC : 0);
-+
-+ regions.push_back(IRegion::pointer(new PlatformRegion(start, end, base, name, permissions)));
-+ kvm_read(kd, (u_long)e.next, &e, sizeof(e));
-+ }
-+ }
-+#endif
-+ kvm_close(kd);
-+ } else {
-+ fprintf(stderr, "sync: %s\n", err_buf);
-+ return QList<IRegion::pointer>();
-+ }
-+ }
-+
-+ return regions;
-+}
-+
-+//------------------------------------------------------------------------------
-+// Name:
-+// Desc:
-+//------------------------------------------------------------------------------
-+QList<QByteArray> DebuggerCore::process_args(edb::pid_t pid) const {
-+ QList<QByteArray> ret;
-+ if(pid != 0) {
-+
-+ // TODO: assert attached!
-+ char errbuf[_POSIX2_LINE_MAX];
-+ if(kvm_t *kd = kvm_openfiles(NULL, NULL, NULL, O_RDONLY, errbuf)) {
-+ int rc;
-+ if(struct kinfo_proc *const proc = kvm_getprocs(kd, KERN_PROC_PID, sizeof *proc, pid, &rc)) {
-+ char **argv = kvm_getargv(kd, proc, 0);
-+ char **p = argv;
-+ while(*p) {
-+ ret << *p++;
-+ }
-+ }
-+ kvm_close(kd);
-+ }
-+
-+ }
-+ return ret;
-+}
-+
-+//------------------------------------------------------------------------------
-+// Name:
-+// Desc:
-+//------------------------------------------------------------------------------
-+edb::address_t DebuggerCore::process_code_address() const {
-+ qDebug() << "TODO: implement DebuggerCore::process_code_address";
-+ return 0;
-+}
-+
-+//------------------------------------------------------------------------------
-+// Name:
-+// Desc:
-+//------------------------------------------------------------------------------
-+edb::address_t DebuggerCore::process_data_address() const {
-+ qDebug() << "TODO: implement DebuggerCore::process_data_address";
-+ return 0;
-+}
-+
-+//------------------------------------------------------------------------------
-+// Name:
-+// Desc:
-+//------------------------------------------------------------------------------
-+QList<Module> DebuggerCore::loaded_modules() const {
-+ QList<Module> modules;
-+ qDebug() << "TODO: implement DebuggerCore::loaded_modules";
-+ return modules;
-+}
-+
-+//------------------------------------------------------------------------------
-+// Name:
-+// Desc:
-+//------------------------------------------------------------------------------
-+QDateTime DebuggerCore::process_start(edb::pid_t pid) const {
-+ qDebug() << "TODO: implement DebuggerCore::process_start";
-+ return QDateTime();
-+}
-+
-+//------------------------------------------------------------------------------
-+// Name:
-+// Desc:
-+//------------------------------------------------------------------------------
-+quint64 DebuggerCore::cpu_type() const {
-+#ifdef EDB_X86
-+ return edb::string_hash<'x', '8', '6'>::value;
-+#elif defined(EDB_X86_64)
-+ return edb::string_hash<'x', '8', '6', '-', '6', '4'>::value;
-+#endif
-+}
-+
-+//------------------------------------------------------------------------------
-+// Name:
-+// Desc:
-+//------------------------------------------------------------------------------
-+QWidget *DebuggerCore::create_register_view() const {
-+ return 0;
-+}
-+
-+//------------------------------------------------------------------------------
-+// Name:
-+// Desc:
-+//------------------------------------------------------------------------------
-+QString DebuggerCore::format_pointer(edb::address_t address) const {
-+ char buf[32];
-+#ifdef EDB_X86
-+ qsnprintf(buf, sizeof(buf), "%08x", address);
-+#elif defined(EDB_X86_64)
-+ qsnprintf(buf, sizeof(buf), "%016llx", address);
-+#endif
-+ return buf;
-+}
-+
-+#if QT_VERSION < 0x050000
-+Q_EXPORT_PLUGIN2(DebuggerCore, DebuggerCore)
-+#endif
-+
-+}
diff --git a/edb-debugger/patches/patch-plugins_DebuggerCore_unix_netbsd_DebuggerCore.h b/edb-debugger/patches/patch-plugins_DebuggerCore_unix_netbsd_DebuggerCore.h
deleted file mode 100644
index f1791e0ae2..0000000000
--- a/edb-debugger/patches/patch-plugins_DebuggerCore_unix_netbsd_DebuggerCore.h
+++ /dev/null
@@ -1,111 +0,0 @@
-$NetBSD$
-
---- plugins/DebuggerCore/unix/netbsd/DebuggerCore.h.orig 2016-01-07 03:04:04.000000000 +0000
-+++ plugins/DebuggerCore/unix/netbsd/DebuggerCore.h
-@@ -0,0 +1,106 @@
-+/*
-+Copyright (C) 2006 - 2014 Evan Teran
-+ eteran%alum.rit.edu@localhost
-+
-+This program is free software: you can redistribute it and/or modify
-+it under the terms of the GNU General Public License as published by
-+the Free Software Foundation, either version 2 of the License, or
-+(at your option) any later version.
-+
-+This program is distributed in the hope that it will be useful,
-+but WITHOUT ANY WARRANTY; without even the implied warranty of
-+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+GNU General Public License for more details.
-+
-+You should have received a copy of the GNU General Public License
-+along with this program. If not, see <http://www.gnu.org/licenses/>.
-+*/
-+
-+#ifndef DEBUGGERCORE_20090529_H_
-+#define DEBUGGERCORE_20090529_H_
-+
-+#include "DebuggerCoreUNIX.h"
-+#include <QHash>
-+
-+namespace DebuggerCore {
-+
-+class DebuggerCore : public DebuggerCoreUNIX {
-+ Q_OBJECT
-+ Q_INTERFACES(IDebuggerCore)
-+ Q_CLASSINFO("author", "Evan Teran")
-+ Q_CLASSINFO("url", "http://www.codef00.com")
-+
-+public:
-+ DebuggerCore();
-+ virtual ~DebuggerCore();
-+
-+public:
-+ virtual edb::address_t page_size() const;
-+ virtual bool has_extension(quint64 ext) const;
-+ virtual IDebugEvent::const_pointer wait_debug_event(int msecs);
-+ virtual bool attach(edb::pid_t pid);
-+ virtual void detach();
-+ virtual void kill();
-+ virtual void pause();
-+ virtual void resume(edb::EVENT_STATUS status);
-+ virtual void step(edb::EVENT_STATUS status);
-+ virtual void get_state(State *state);
-+ virtual void set_state(const State &state);
-+ virtual bool open(const QString &path, const QString &cwd, const QList<QByteArray> &args, const QString &tty);
-+
-+public:
-+ // thread support stuff (optional)
-+ virtual QList<edb::tid_t> thread_ids() const { return threads_.keys(); }
-+ virtual edb::tid_t active_thread() const { return active_thread_; }
-+ virtual void set_active_thread(edb::tid_t);
-+
-+public:
-+ virtual QList<IRegion::pointer> memory_regions() const;
-+ virtual edb::address_t process_code_address() const;
-+ virtual edb::address_t process_data_address() const;
-+
-+public:
-+ virtual IState *create_state() const;
-+ virtual QWidget *create_register_view() const;
-+
-+public:
-+ // process properties
-+ virtual QList<QByteArray> process_args(edb::pid_t pid) const;
-+ virtual QString process_exe(edb::pid_t pid) const;
-+ virtual QString process_cwd(edb::pid_t pid) const;
-+ virtual edb::pid_t parent_pid(edb::pid_t pid) const;
-+ virtual QDateTime process_start(edb::pid_t pid) const;
-+ virtual quint64 cpu_type() const;
-+
-+private:
-+ virtual QMap<edb::pid_t, Process> enumerate_processes() const;
-+ virtual QList<Module> loaded_modules() const;
-+
-+public:
-+ virtual QString format_pointer(edb::address_t address) const;
-+
-+private:
-+ virtual long read_data(edb::address_t address, bool *ok);
-+ virtual bool write_data(edb::address_t address, long value);
-+
-+private:
-+ struct thread_info {
-+ public:
-+ thread_info() : status(0) {
-+ }
-+
-+ thread_info(int s) : status(s) {
-+ }
-+
-+ int status;
-+ };
-+
-+ typedef QHash<edb::tid_t, thread_info> threadmap_t;
-+
-+ edb::address_t page_size_;
-+ threadmap_t threads_;
-+};
-+
-+}
-+
-+#endif
diff --git a/edb-debugger/patches/patch-plugins_DebuggerCore_unix_netbsd_PlatformEvent.cpp b/edb-debugger/patches/patch-plugins_DebuggerCore_unix_netbsd_PlatformEvent.cpp
deleted file mode 100644
index 61f2870f39..0000000000
--- a/edb-debugger/patches/patch-plugins_DebuggerCore_unix_netbsd_PlatformEvent.cpp
+++ /dev/null
@@ -1,264 +0,0 @@
-$NetBSD$
-
---- plugins/DebuggerCore/unix/netbsd/PlatformEvent.cpp.orig 2016-01-07 03:04:04.000000000 +0000
-+++ plugins/DebuggerCore/unix/netbsd/PlatformEvent.cpp
-@@ -0,0 +1,259 @@
-+/*
-+Copyright (C) 2006 - 2014 Evan Teran
-+ eteran%alum.rit.edu@localhost
-+
-+This program is free software: you can redistribute it and/or modify
-+it under the terms of the GNU General Public License as published by
-+the Free Software Foundation, either version 2 of the License, or
-+(at your option) any later version.
-+
-+This program is distributed in the hope that it will be useful,
-+but WITHOUT ANY WARRANTY; without even the implied warranty of
-+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+GNU General Public License for more details.
-+
-+You should have received a copy of the GNU General Public License
-+along with this program. If not, see <http://www.gnu.org/licenses/>.
-+*/
-+
-+#include "PlatformEvent.h"
-+#include "edb.h"
-+#include <cstdio>
-+#include <cstring>
-+#include <fcntl.h>
-+#include <kvm.h>
-+#include <sys/exec.h>
-+#include <sys/mman.h>
-+#include <sys/param.h>
-+#include <sys/proc.h>
-+#include <sys/ptrace.h>
-+#include <sys/signalvar.h>
-+#include <sys/sysctl.h>
-+#include <sys/types.h>
-+#include <sys/wait.h>
-+#include <unistd.h>
-+#include <uvm/uvm.h>
-+#include <uvm/uvm_amap.h>
-+#include <signal.h> // for the SIG* definitions
-+
-+namespace DebuggerCore {
-+
-+//------------------------------------------------------------------------------
-+// Name:
-+//------------------------------------------------------------------------------
-+PlatformEvent::PlatformEvent() : status(0), pid(-1), tid(-1), fault_address_(0), fault_code_(0) {
-+}
-+
-+//------------------------------------------------------------------------------
-+// Name:
-+//------------------------------------------------------------------------------
-+PlatformEvent *PlatformEvent::clone() const {
-+ return new PlatformEvent(*this);
-+}
-+
-+//------------------------------------------------------------------------------
-+// Name:
-+//------------------------------------------------------------------------------
-+IDebugEvent::Message PlatformEvent::error_description() const {
-+ Q_ASSERT(is_error());
-+
-+ const edb::address_t fault_address = reinterpret_cast<edb::address_t>(fault_address_);
-+
-+ switch(code()) {
-+ case SIGSEGV:
-+ return Message(
-+ tr("Illegal Access Fault"),
-+ tr(
-+ "<p>The debugged application encountered a segmentation fault.<br />The address <strong>0x%1</strong> could not be accessed.</p>"
-+ "<p>If you would like to pass this exception to the application press Shift+[F7/F8/F9]</p>").arg(edb::v1::format_pointer(fault_address))
-+ );
-+ case SIGILL:
-+ return Message(
-+ tr("Illegal Instruction Fault"),
-+ tr(
-+ "<p>The debugged application attempted to execute an illegal instruction.</p>"
-+ "<p>If you would like to pass this exception to the application press Shift+[F7/F8/F9]</p>")
-+ );
-+ case SIGFPE:
-+ switch(fault_code_) {
-+ case FPE_INTDIV:
-+ return Message(
-+ tr("Divide By Zero"),
-+ tr(
-+ "<p>The debugged application tried to divide an integer value by an integer divisor of zero.</p>"
-+ "<p>If you would like to pass this exception to the application press Shift+[F7/F8/F9]</p>")
-+ );
-+ default:
-+ return Message(
-+ tr("Floating Point Exception"),
-+ tr(
-+ "<p>The debugged application encountered a floating-point exception.</p>"
-+ "<p>If you would like to pass this exception to the application press Shift+[F7/F8/F9]</p>")
-+ );
-+ }
-+
-+ case SIGABRT:
-+ return Message(
-+ tr("Application Aborted"),
-+ tr(
-+ "<p>The debugged application has aborted.</p>"
-+ "<p>If you would like to pass this exception to the application press Shift+[F7/F8/F9]</p>")
-+ );
-+ case SIGBUS:
-+ return Message(
-+ tr("Bus Error"),
-+ tr(
-+ "<p>The debugged application tried to read or write data that is misaligned.</p>"
-+ "<p>If you would like to pass this exception to the application press Shift+[F7/F8/F9]</p>")
-+ );
-+#ifdef SIGSTKFLT
-+ case SIGSTKFLT:
-+ return Message(
-+ tr("Stack Fault"),
-+ tr(
-+ "<p>The debugged application encountered a stack fault.</p>"
-+ "<p>If you would like to pass this exception to the application press Shift+[F7/F8/F9]</p>")
-+ );
-+#endif
-+ case SIGPIPE:
-+ return Message(
-+ tr("Broken Pipe Fault"),
-+ tr(
-+ "<p>The debugged application encountered a broken pipe fault.</p>"
-+ "<p>If you would like to pass this exception to the application press Shift+[F7/F8/F9]</p>")
-+ );
-+ default:
-+ return Message();
-+ }
-+}
-+
-+//------------------------------------------------------------------------------
-+// Name:
-+//------------------------------------------------------------------------------
-+IDebugEvent::REASON PlatformEvent:: reason() const {
-+ // this basically converts our value into a 'switchable' value for convenience
-+
-+ if(stopped()) {
-+ return EVENT_STOPPED;
-+ } else if(terminated()) {
-+ return EVENT_TERMINATED;
-+ } else if(exited()) {
-+ return EVENT_EXITED;
-+ } else {
-+ return EVENT_UNKNOWN;
-+ }
-+}
-+
-+//------------------------------------------------------------------------------
-+// Name:
-+//------------------------------------------------------------------------------
-+IDebugEvent::TRAP_REASON PlatformEvent::trap_reason() const {
-+ switch(fault_code_) {
-+ case TRAP_TRACE: return TRAP_STEPPING;
-+ default: return TRAP_BREAKPOINT;
-+ }
-+}
-+
-+//------------------------------------------------------------------------------
-+// Name:
-+//------------------------------------------------------------------------------
-+bool PlatformEvent::exited() const {
-+ return WIFEXITED(status) != 0;
-+}
-+
-+//------------------------------------------------------------------------------
-+// Name:
-+//------------------------------------------------------------------------------
-+bool PlatformEvent::is_error() const {
-+ if(stopped()) {
-+ switch(code()) {
-+ case SIGTRAP:
-+ case SIGSTOP:
-+ return false;
-+ case SIGSEGV:
-+ case SIGILL:
-+ case SIGFPE:
-+ case SIGABRT:
-+ case SIGBUS:
-+#ifdef SIGSTKFLT
-+ case SIGSTKFLT:
-+#endif
-+ case SIGPIPE:
-+ return true;
-+ default:
-+ return false;
-+ }
-+ } else {
-+ return false;
-+ }
-+}
-+
-+//------------------------------------------------------------------------------
-+// Name:
-+//------------------------------------------------------------------------------
-+bool PlatformEvent::is_kill() const {
-+ return stopped() && code() == SIGKILL;
-+}
-+
-+//------------------------------------------------------------------------------
-+// Name:
-+//------------------------------------------------------------------------------
-+bool PlatformEvent::is_stop() const {
-+ return stopped() && code() == SIGSTOP;
-+}
-+
-+//------------------------------------------------------------------------------
-+// Name:
-+//------------------------------------------------------------------------------
-+bool PlatformEvent::is_trap() const {
-+ return stopped() && code() == SIGTRAP;
-+}
-+
-+//------------------------------------------------------------------------------
-+// Name:
-+//------------------------------------------------------------------------------
-+bool PlatformEvent::terminated() const {
-+ return WIFSIGNALED(status) != 0;
-+}
-+
-+//------------------------------------------------------------------------------
-+// Name:
-+//------------------------------------------------------------------------------
-+bool PlatformEvent::stopped() const {
-+ return WIFSTOPPED(status) != 0;
-+}
-+
-+//------------------------------------------------------------------------------
-+// Name:
-+//------------------------------------------------------------------------------
-+edb::pid_t PlatformEvent::process() const {
-+ return pid;
-+}
-+
-+//------------------------------------------------------------------------------
-+// Name:
-+//------------------------------------------------------------------------------
-+edb::tid_t PlatformEvent::thread() const {
-+ return tid;
-+}
-+
-+//------------------------------------------------------------------------------
-+// Name:
-+//------------------------------------------------------------------------------
-+int PlatformEvent::code() const {
-+ if(stopped()) {
-+ return WSTOPSIG(status);
-+ }
-+
-+ if(terminated()) {
-+ return WTERMSIG(status);
-+ }
-+
-+ if(exited()) {
-+ return WEXITSTATUS(status);
-+ }
-+
-+ return 0;
-+}
-+
-+}
diff --git a/edb-debugger/patches/patch-plugins_DebuggerCore_unix_netbsd_PlatformEvent.h b/edb-debugger/patches/patch-plugins_DebuggerCore_unix_netbsd_PlatformEvent.h
deleted file mode 100644
index 02eacc0c46..0000000000
--- a/edb-debugger/patches/patch-plugins_DebuggerCore_unix_netbsd_PlatformEvent.h
+++ /dev/null
@@ -1,67 +0,0 @@
-$NetBSD$
-
---- plugins/DebuggerCore/unix/netbsd/PlatformEvent.h.orig 2016-01-07 03:04:04.000000000 +0000
-+++ plugins/DebuggerCore/unix/netbsd/PlatformEvent.h
-@@ -0,0 +1,62 @@
-+/*
-+Copyright (C) 2006 - 2014 Evan Teran
-+ eteran%alum.rit.edu@localhost
-+
-+This program is free software: you can redistribute it and/or modify
-+it under the terms of the GNU General Public License as published by
-+the Free Software Foundation, either version 2 of the License, or
-+(at your option) any later version.
-+
-+This program is distributed in the hope that it will be useful,
-+but WITHOUT ANY WARRANTY; without even the implied warranty of
-+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+GNU General Public License for more details.
-+
-+You should have received a copy of the GNU General Public License
-+along with this program. If not, see <http://www.gnu.org/licenses/>.
-+*/
-+
-+#ifndef PLATFORM_EVENT_20121005_H_
-+#define PLATFORM_EVENT_20121005_H_
-+
-+#include <QCoreApplication>
-+#include "IDebugEvent.h"
-+
-+namespace DebuggerCore {
-+
-+class PlatformEvent : IDebugEvent {
-+ Q_DECLARE_TR_FUNCTIONS(PlatformEvent)
-+ friend class DebuggerCore;
-+
-+public:
-+ PlatformEvent();
-+
-+public:
-+ virtual PlatformEvent *clone() const;
-+
-+public:
-+ virtual Message error_description() const;
-+ virtual REASON reason() const;
-+ virtual TRAP_REASON trap_reason() const;
-+ virtual bool exited() const;
-+ virtual bool is_error() const;
-+ virtual bool is_kill() const;
-+ virtual bool is_stop() const;
-+ virtual bool is_trap() const;
-+ virtual bool terminated() const;
-+ virtual bool stopped() const;
-+ virtual edb::pid_t process() const;
-+ virtual edb::tid_t thread() const;
-+ virtual int code() const;
-+
-+private:
-+ int status;
-+ edb::pid_t pid;
-+ edb::tid_t tid;
-+ void * fault_address_;
-+ long fault_code_;
-+};
-+
-+}
-+
-+#endif
diff --git a/edb-debugger/patches/patch-plugins_DebuggerCore_unix_netbsd_PlatformRegion.cpp b/edb-debugger/patches/patch-plugins_DebuggerCore_unix_netbsd_PlatformRegion.cpp
deleted file mode 100644
index 803a057caa..0000000000
--- a/edb-debugger/patches/patch-plugins_DebuggerCore_unix_netbsd_PlatformRegion.cpp
+++ /dev/null
@@ -1,101 +0,0 @@
-$NetBSD$
-
---- plugins/DebuggerCore/unix/netbsd/PlatformRegion.cpp.orig 2016-01-07 03:04:04.000000000 +0000
-+++ plugins/DebuggerCore/unix/netbsd/PlatformRegion.cpp
-@@ -0,0 +1,96 @@
-+/*
-+Copyright (C) 2006 - 2014 Evan Teran
-+ eteran%alum.rit.edu@localhost
-+
-+This program is free software: you can redistribute it and/or modify
-+it under the terms of the GNU General Public License as published by
-+the Free Software Foundation, either version 2 of the License, or
-+(at your option) any later version.
-+
-+This program is distributed in the hope that it will be useful,
-+but WITHOUT ANY WARRANTY; without even the implied warranty of
-+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+GNU General Public License for more details.
-+
-+You should have received a copy of the GNU General Public License
-+along with this program. If not, see <http://www.gnu.org/licenses/>.
-+*/
-+
-+#include "PlatformRegion.h"
-+
-+#include "MemoryRegions.h"
-+#include "edb.h"
-+#include "IDebuggerCore.h"
-+#include "State.h"
-+#include "IDebugEventHandler.h"
-+#include <QMessageBox>
-+#include <sys/syscall.h>
-+#include <sys/mman.h>
-+
-+namespace DebuggerCore {
-+
-+PlatformRegion::PlatformRegion(edb::address_t start, edb::address_t end, edb::address_t base, const QString &name, permissions_t permissions) : start_(start), end_(end), base_(base), name_(name), permissions_(permissions) {
-+}
-+
-+PlatformRegion::~PlatformRegion() {
-+}
-+
-+IRegion *PlatformRegion::clone() const {
-+ return new PlatformRegion(start_, end_, base_, name_, permissions_);
-+}
-+
-+bool PlatformRegion::accessible() const {
-+ return readable() || writable() || executable();
-+}
-+
-+bool PlatformRegion::readable() const {
-+ return (permissions_ & PROT_READ) != 0;
-+}
-+
-+bool PlatformRegion::writable() const {
-+ return (permissions_ & PROT_WRITE) != 0;
-+}
-+
-+bool PlatformRegion::executable() const {
-+ return (permissions_ & PROT_EXEC) != 0;
-+}
-+
-+edb::address_t PlatformRegion::size() const {
-+ return end_ - start_;
-+}
-+
-+void PlatformRegion::set_permissions(bool read, bool write, bool execute) {
-+ Q_UNUSED(read);
-+ Q_UNUSED(write);
-+ Q_UNUSED(execute);
-+}
-+
-+edb::address_t PlatformRegion::start() const {
-+ return start_;
-+}
-+
-+edb::address_t PlatformRegion::end() const {
-+ return end_;
-+}
-+
-+edb::address_t PlatformRegion::base() const {
-+ return base_;
-+}
-+
-+QString PlatformRegion::name() const {
-+ return name_;
-+}
-+
-+IRegion::permissions_t PlatformRegion::permissions() const {
-+ return permissions_;
-+}
-+
-+void PlatformRegion::set_start(edb::address_t address) {
-+ start_ = address;
-+}
-+
-+void PlatformRegion::set_end(edb::address_t address) {
-+ end_ = address;
-+}
-+
-+}
diff --git a/edb-debugger/patches/patch-plugins_DebuggerCore_unix_netbsd_PlatformRegion.h b/edb-debugger/patches/patch-plugins_DebuggerCore_unix_netbsd_PlatformRegion.h
deleted file mode 100644
index 4dad9e31ee..0000000000
--- a/edb-debugger/patches/patch-plugins_DebuggerCore_unix_netbsd_PlatformRegion.h
+++ /dev/null
@@ -1,73 +0,0 @@
-$NetBSD$
-
---- plugins/DebuggerCore/unix/netbsd/PlatformRegion.h.orig 2016-01-07 03:04:04.000000000 +0000
-+++ plugins/DebuggerCore/unix/netbsd/PlatformRegion.h
-@@ -0,0 +1,68 @@
-+/*
-+Copyright (C) 2006 - 2014 Evan Teran
-+ eteran%alum.rit.edu@localhost
-+
-+This program is free software: you can redistribute it and/or modify
-+it under the terms of the GNU General Public License as published by
-+the Free Software Foundation, either version 2 of the License, or
-+(at your option) any later version.
-+
-+This program is distributed in the hope that it will be useful,
-+but WITHOUT ANY WARRANTY; without even the implied warranty of
-+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+GNU General Public License for more details.
-+
-+You should have received a copy of the GNU General Public License
-+along with this program. If not, see <http://www.gnu.org/licenses/>.
-+*/
-+
-+#ifndef PLATFORM_REGION_20120330_H_
-+#define PLATFORM_REGION_20120330_H_
-+
-+#include "IRegion.h"
-+#include <QString>
-+#include <QCoreApplication>
-+
-+namespace DebuggerCore {
-+
-+class PlatformRegion : public IRegion {
-+ Q_DECLARE_TR_FUNCTIONS(PlatformRegion)
-+
-+public:
-+ PlatformRegion(edb::address_t start, edb::address_t end, edb::address_t base, const QString &name, permissions_t permissions);
-+ virtual ~PlatformRegion();
-+
-+public:
-+ virtual IRegion *clone() const;
-+
-+public:
-+ virtual bool accessible() const;
-+ virtual bool readable() const;
-+ virtual bool writable() const;
-+ virtual bool executable() const;
-+ virtual edb::address_t size() const;
-+
-+public:
-+ virtual void set_permissions(bool read, bool write, bool execute);
-+ virtual void set_start(edb::address_t address);
-+ virtual void set_end(edb::address_t address);
-+
-+public:
-+ virtual edb::address_t start() const;
-+ virtual edb::address_t end() const;
-+ virtual edb::address_t base() const;
-+ virtual QString name() const;
-+ virtual permissions_t permissions() const;
-+
-+private:
-+ edb::address_t start_;
-+ edb::address_t end_;
-+ edb::address_t base_;
-+ QString name_;
-+ permissions_t permissions_;
-+};
-+
-+}
-+
-+#endif
-+
diff --git a/edb-debugger/patches/patch-plugins_DebuggerCore_unix_netbsd_PlatformState.cpp b/edb-debugger/patches/patch-plugins_DebuggerCore_unix_netbsd_PlatformState.cpp
deleted file mode 100644
index e1075d2b54..0000000000
--- a/edb-debugger/patches/patch-plugins_DebuggerCore_unix_netbsd_PlatformState.cpp
+++ /dev/null
@@ -1,398 +0,0 @@
-$NetBSD$
-
---- plugins/DebuggerCore/unix/netbsd/PlatformState.cpp.orig 2016-01-07 03:04:04.000000000 +0000
-+++ plugins/DebuggerCore/unix/netbsd/PlatformState.cpp
-@@ -0,0 +1,393 @@
-+/*
-+Copyright (C) 2006 - 2014 Evan Teran
-+ eteran%alum.rit.edu@localhost
-+
-+This program is free software: you can redistribute it and/or modify
-+it under the terms of the GNU General Public License as published by
-+the Free Software Foundation, either version 2 of the License, or
-+(at your option) any later version.
-+
-+This program is distributed in the hope that it will be useful,
-+but WITHOUT ANY WARRANTY; without even the implied warranty of
-+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+GNU General Public License for more details.
-+
-+You should have received a copy of the GNU General Public License
-+along with this program. If not, see <http://www.gnu.org/licenses/>.
-+*/
-+
-+#include "PlatformState.h"
-+
-+namespace DebuggerCore {
-+
-+//------------------------------------------------------------------------------
-+// Name: PlatformState
-+// Desc:
-+//------------------------------------------------------------------------------
-+PlatformState::PlatformState() {
-+ memset(®s_, 0, sizeof(regs_));
-+ memset(&fpregs_, 0, sizeof(fpregs_));
-+ memset(&dr_, 0, sizeof(dr_));
-+ fs_base = 0;
-+ gs_base = 0;
-+}
-+
-+//------------------------------------------------------------------------------
-+// Name: PlatformState::clone
-+// Desc: makes a copy of the state object
-+//------------------------------------------------------------------------------
-+IState *PlatformState::clone() const {
-+ return new PlatformState(*this);
-+}
-+
-+//------------------------------------------------------------------------------
-+// Name: flags_to_string
-+// Desc: returns the flags in a string form appropriate for this platform
-+//------------------------------------------------------------------------------
-+QString PlatformState::flags_to_string(edb::reg_t flags) const {
-+ char buf[14];
-+ qsnprintf(
-+ buf,
-+ sizeof(buf),
-+ "%c %c %c %c %c %c %c",
-+ ((flags & 0x001) ? 'C' : 'c'),
-+ ((flags & 0x004) ? 'P' : 'p'),
-+ ((flags & 0x010) ? 'A' : 'a'),
-+ ((flags & 0x040) ? 'Z' : 'z'),
-+ ((flags & 0x080) ? 'S' : 's'),
-+ ((flags & 0x400) ? 'D' : 'd'),
-+ ((flags & 0x800) ? 'O' : 'o'));
-+
-+ return buf;
-+}
-+
-+//------------------------------------------------------------------------------
-+// Name: flags_to_string
-+// Desc: returns the flags in a string form appropriate for this platform
-+//------------------------------------------------------------------------------
-+QString PlatformState::flags_to_string() const {
-+ return flags_to_string(flags());
-+}
-+
-+//------------------------------------------------------------------------------
-+// Name: value
-+// Desc: returns a Register object which represents the register with the name
-+// supplied
-+//------------------------------------------------------------------------------
-+Register PlatformState::value(const QString ®) const {
-+ const QString lreg = reg.toLower();
-+
-+#if defined(EDB_X86)
-+ if(lreg == "eax") return Register("eax", regs_.r_eax, Register::TYPE_GPR);
-+ else if(lreg == "ebx") return Register("ebx", regs_.r_ebx, Register::TYPE_GPR);
-+ else if(lreg == "ecx") return Register("ecx", regs_.r_ecx, Register::TYPE_GPR);
-+ else if(lreg == "edx") return Register("edx", regs_.r_edx, Register::TYPE_GPR);
-+ else if(lreg == "ebp") return Register("ebp", regs_.r_ebp, Register::TYPE_GPR);
-+ else if(lreg == "esp") return Register("esp", regs_.r_esp, Register::TYPE_GPR);
-+ else if(lreg == "esi") return Register("esi", regs_.r_esi, Register::TYPE_GPR);
-+ else if(lreg == "edi") return Register("edi", regs_.r_edi, Register::TYPE_GPR);
-+ else if(lreg == "eip") return Register("eip", regs_.r_eip, Register::TYPE_IP);
-+ else if(lreg == "ax") return Register("ax", regs_.r_eax & 0xffff, Register::TYPE_GPR);
-+ else if(lreg == "bx") return Register("bx", regs_.r_ebx & 0xffff, Register::TYPE_GPR);
-+ else if(lreg == "cx") return Register("cx", regs_.r_ecx & 0xffff, Register::TYPE_GPR);
-+ else if(lreg == "dx") return Register("dx", regs_.r_edx & 0xffff, Register::TYPE_GPR);
-+ else if(lreg == "bp") return Register("bp", regs_.r_ebp & 0xffff, Register::TYPE_GPR);
-+ else if(lreg == "sp") return Register("sp", regs_.r_esp & 0xffff, Register::TYPE_GPR);
-+ else if(lreg == "si") return Register("si", regs_.r_esi & 0xffff, Register::TYPE_GPR);
-+ else if(lreg == "di") return Register("di", regs_.r_edi & 0xffff, Register::TYPE_GPR);
-+ else if(lreg == "al") return Register("al", regs_.r_eax & 0xff, Register::TYPE_GPR);
-+ else if(lreg == "bl") return Register("bl", regs_.r_ebx & 0xff, Register::TYPE_GPR);
-+ else if(lreg == "cl") return Register("cl", regs_.r_ecx & 0xff, Register::TYPE_GPR);
-+ else if(lreg == "dl") return Register("dl", regs_.r_edx & 0xff, Register::TYPE_GPR);
-+ else if(lreg == "ah") return Register("ah", (regs_.r_eax >> 8) & 0xff, Register::TYPE_GPR);
-+ else if(lreg == "bh") return Register("bh", (regs_.r_ebx >> 8) & 0xff, Register::TYPE_GPR);
-+ else if(lreg == "ch") return Register("ch", (regs_.r_ecx >> 8) & 0xff, Register::TYPE_GPR);
-+ else if(lreg == "dh") return Register("dh", (regs_.r_edx >> 8) & 0xff, Register::TYPE_GPR);
-+ else if(lreg == "cs") return Register("cs", regs_.r_cs, Register::TYPE_SEG);
-+ else if(lreg == "ds") return Register("ds", regs_.r_ds, Register::TYPE_SEG);
-+ else if(lreg == "es") return Register("es", regs_.r_es, Register::TYPE_SEG);
-+ else if(lreg == "fs") return Register("fs", regs_.r_fs, Register::TYPE_SEG);
-+ else if(lreg == "gs") return Register("gs", regs_.r_gs, Register::TYPE_SEG);
-+ else if(lreg == "ss") return Register("ss", regs_.r_ss, Register::TYPE_SEG);
-+ else if(lreg == "fs_base") return Register("fs_base", fs_base, Register::TYPE_SEG);
-+ else if(lreg == "gs_base") return Register("gs_base", gs_base, Register::TYPE_SEG);
-+ else if(lreg == "eflags") return Register("eflags", regs_.r_eflags, Register::TYPE_COND);
-+#elif defined(EDB_X86_64)
-+ if(lreg == "rax") return Register("rax", regs_.r_rax, Register::TYPE_GPR);
-+ else if(lreg == "rbx") return Register("rbx", regs_.r_rbx, Register::TYPE_GPR);
-+ else if(lreg == "rcx") return Register("rcx", regs_.r_rcx, Register::TYPE_GPR);
-+ else if(lreg == "rdx") return Register("rdx", regs_.r_rdx, Register::TYPE_GPR);
-+ else if(lreg == "rbp") return Register("rbp", regs_.r_rbp, Register::TYPE_GPR);
-+ else if(lreg == "rsp") return Register("rsp", regs_.r_rsp, Register::TYPE_GPR);
-+ else if(lreg == "rsi") return Register("rsi", regs_.r_rsi, Register::TYPE_GPR);
-+ else if(lreg == "rdi") return Register("rdi", regs_.r_rdi, Register::TYPE_GPR);
-+ else if(lreg == "rip") return Register("rip", regs_.r_rip, Register::TYPE_IP);
-+ else if(lreg == "r8") return Register("r8", regs_.r_r8, Register::TYPE_GPR);
-+ else if(lreg == "r9") return Register("r9", regs_.r_r9, Register::TYPE_GPR);
-+ else if(lreg == "r10") return Register("r10", regs_.r_r10, Register::TYPE_GPR);
-+ else if(lreg == "r11") return Register("r11", regs_.r_r11, Register::TYPE_GPR);
-+ else if(lreg == "r12") return Register("r12", regs_.r_r12, Register::TYPE_GPR);
-+ else if(lreg == "r13") return Register("r13", regs_.r_r13, Register::TYPE_GPR);
-+ else if(lreg == "r14") return Register("r14", regs_.r_r14, Register::TYPE_GPR);
-+ else if(lreg == "r15") return Register("r15", regs_.r_r15, Register::TYPE_GPR);
-+ else if(lreg == "eax") return Register("eax", regs_.r_rax & 0xffffffff, Register::TYPE_GPR);
-+ else if(lreg == "ebx") return Register("ebx", regs_.r_rbx & 0xffffffff, Register::TYPE_GPR);
-+ else if(lreg == "ecx") return Register("ecx", regs_.r_rcx & 0xffffffff, Register::TYPE_GPR);
-+ else if(lreg == "edx") return Register("edx", regs_.r_rdx & 0xffffffff, Register::TYPE_GPR);
-+ else if(lreg == "ebp") return Register("ebp", regs_.r_rbp & 0xffffffff, Register::TYPE_GPR);
-+ else if(lreg == "esp") return Register("esp", regs_.r_rsp & 0xffffffff, Register::TYPE_GPR);
-+ else if(lreg == "esi") return Register("esi", regs_.r_rsi & 0xffffffff, Register::TYPE_GPR);
-+ else if(lreg == "edi") return Register("edi", regs_.r_rdi & 0xffffffff, Register::TYPE_GPR);
-+ else if(lreg == "r8d") return Register("r8d", regs_.r_r8 & 0xffffffff, Register::TYPE_GPR);
-+ else if(lreg == "r9d") return Register("r9d", regs_.r_r9 & 0xffffffff, Register::TYPE_GPR);
-+ else if(lreg == "r10d") return Register("r10d", regs_.r_r10 & 0xffffffff, Register::TYPE_GPR);
-+ else if(lreg == "r11d") return Register("r11d", regs_.r_r11 & 0xffffffff, Register::TYPE_GPR);
-+ else if(lreg == "r12d") return Register("r12d", regs_.r_r12 & 0xffffffff, Register::TYPE_GPR);
-+ else if(lreg == "r13d") return Register("r13d", regs_.r_r13 & 0xffffffff, Register::TYPE_GPR);
-+ else if(lreg == "r14d") return Register("r14d", regs_.r_r14 & 0xffffffff, Register::TYPE_GPR);
-+ else if(lreg == "r15d") return Register("r15d", regs_.r_r15 & 0xffffffff, Register::TYPE_GPR);
-+ else if(lreg == "ax") return Register("ax", regs_.r_rax & 0xffff, Register::TYPE_GPR);
-+ else if(lreg == "bx") return Register("bx", regs_.r_rbx & 0xffff, Register::TYPE_GPR);
-+ else if(lreg == "cx") return Register("cx", regs_.r_rcx & 0xffff, Register::TYPE_GPR);
-+ else if(lreg == "dx") return Register("dx", regs_.r_rdx & 0xffff, Register::TYPE_GPR);
-+ else if(lreg == "bp") return Register("bp", regs_.r_rbp & 0xffff, Register::TYPE_GPR);
-+ else if(lreg == "sp") return Register("sp", regs_.r_rsp & 0xffff, Register::TYPE_GPR);
-+ else if(lreg == "si") return Register("si", regs_.r_rsi & 0xffff, Register::TYPE_GPR);
-+ else if(lreg == "di") return Register("di", regs_.r_rdi & 0xffff, Register::TYPE_GPR);
-+ else if(lreg == "r8w") return Register("r8w", regs_.r_r8 & 0xffff, Register::TYPE_GPR);
-+ else if(lreg == "r9w") return Register("r9w", regs_.r_r9 & 0xffff, Register::TYPE_GPR);
-+ else if(lreg == "r10w") return Register("r10w", regs_.r_r10 & 0xffff, Register::TYPE_GPR);
-+ else if(lreg == "r11w") return Register("r11w", regs_.r_r11 & 0xffff, Register::TYPE_GPR);
-+ else if(lreg == "r12w") return Register("r12w", regs_.r_r12 & 0xffff, Register::TYPE_GPR);
-+ else if(lreg == "r13w") return Register("r13w", regs_.r_r13 & 0xffff, Register::TYPE_GPR);
-+ else if(lreg == "r14w") return Register("r14w", regs_.r_r14 & 0xffff, Register::TYPE_GPR);
-+ else if(lreg == "r15w") return Register("r15w", regs_.r_r15 & 0xffff, Register::TYPE_GPR);
-+ else if(lreg == "al") return Register("al", regs_.r_rax & 0xff, Register::TYPE_GPR);
-+ else if(lreg == "bl") return Register("bl", regs_.r_rbx & 0xff, Register::TYPE_GPR);
-+ else if(lreg == "cl") return Register("cl", regs_.r_rcx & 0xff, Register::TYPE_GPR);
-+ else if(lreg == "dl") return Register("dl", regs_.r_rdx & 0xff, Register::TYPE_GPR);
-+ else if(lreg == "ah") return Register("ah", (regs_.r_rax >> 8) & 0xff, Register::TYPE_GPR);
-+ else if(lreg == "bh") return Register("bh", (regs_.r_rbx >> 8) & 0xff, Register::TYPE_GPR);
-+ else if(lreg == "ch") return Register("ch", (regs_.r_rcx >> 8) & 0xff, Register::TYPE_GPR);
-+ else if(lreg == "dh") return Register("dh", (regs_.r_rdx >> 8) & 0xff, Register::TYPE_GPR);
-+ else if(lreg == "spl") return Register("spl", (regs_.r_rsp >> 8) & 0xff, Register::TYPE_GPR);
-+ else if(lreg == "bpl") return Register("bpl", (regs_.r_rbp >> 8) & 0xff, Register::TYPE_GPR);
-+ else if(lreg == "sil") return Register("sil", (regs_.r_rsi >> 8) & 0xff, Register::TYPE_GPR);
-+ else if(lreg == "dil") return Register("dil", (regs_.r_rdi >> 8) & 0xff, Register::TYPE_GPR);
-+ else if(lreg == "r8b") return Register("r8b", regs_.r_r8 & 0xff, Register::TYPE_GPR);
-+ else if(lreg == "r9b") return Register("r9b", regs_.r_r9 & 0xff, Register::TYPE_GPR);
-+ else if(lreg == "r10b") return Register("r10b", regs_.r_r10 & 0xff, Register::TYPE_GPR);
-+ else if(lreg == "r11b") return Register("r11b", regs_.r_r11 & 0xff, Register::TYPE_GPR);
-+ else if(lreg == "r12b") return Register("r12b", regs_.r_r12 & 0xff, Register::TYPE_GPR);
-+ else if(lreg == "r13b") return Register("r13b", regs_.r_r13 & 0xff, Register::TYPE_GPR);
-+ else if(lreg == "r14b") return Register("r14b", regs_.r_r14 & 0xff, Register::TYPE_GPR);
-+ else if(lreg == "r15b") return Register("r15b", regs_.r_r15 & 0xff, Register::TYPE_GPR);
-+ else if(lreg == "cs") return Register("cs", regs_.r_cs, Register::TYPE_SEG);
-+ else if(lreg == "ds") return Register("ds", regs_.r_ds, Register::TYPE_SEG);
-+ else if(lreg == "es") return Register("es", regs_.r_es, Register::TYPE_SEG);
-+ else if(lreg == "fs") return Register("fs", regs_.r_fs, Register::TYPE_SEG);
-+ else if(lreg == "gs") return Register("gs", regs_.r_gs, Register::TYPE_SEG);
-+ else if(lreg == "ss") return Register("ss", regs_.r_ss, Register::TYPE_SEG);
-+ else if(lreg == "fs_base") return Register("fs_base", fs_base, Register::TYPE_SEG);
-+ else if(lreg == "gs_base") return Register("gs_base", gs_base, Register::TYPE_SEG);
-+ else if(lreg == "rflags") return Register("rflags", regs_.r_rflags, Register::TYPE_COND);
-+#endif
-+
-+ return Register();
-+}
-+
-+//------------------------------------------------------------------------------
-+// Name: frame_pointer
-+// Desc: returns what is conceptually the frame pointer for this platform
-+//------------------------------------------------------------------------------
-+edb::address_t PlatformState::frame_pointer() const {
-+#if defined(EDB_X86)
-+ return regs_.r_ebp;
-+#elif defined(EDB_X86_64)
-+ return regs_.r_rbp;
-+#endif
-+}
-+
-+//------------------------------------------------------------------------------
-+// Name: instruction_pointer
-+// Desc: returns the instruction pointer for this platform
-+//------------------------------------------------------------------------------
-+edb::address_t PlatformState::instruction_pointer() const {
-+#if defined(EDB_X86)
-+ return regs_.r_eip;
-+#elif defined(EDB_X86_64)
-+ return regs_.r_rip;
-+#endif
-+}
-+
-+//------------------------------------------------------------------------------
-+// Name: stack_pointer
-+// Desc: returns the stack pointer for this platform
-+//------------------------------------------------------------------------------
-+edb::address_t PlatformState::stack_pointer() const {
-+#if defined(EDB_X86)
-+ return regs_.r_esp;
-+#elif defined(EDB_X86_64)
-+ return regs_.r_rsp;
-+#endif
-+}
-+
-+//------------------------------------------------------------------------------
-+// Name: debug_register
-+// Desc:
-+//------------------------------------------------------------------------------
-+edb::reg_t PlatformState::debug_register(int n) const {
-+ return dr_[n];
-+}
-+
-+//------------------------------------------------------------------------------
-+// Name: flags
-+// Desc:
-+//------------------------------------------------------------------------------
-+edb::reg_t PlatformState::flags() const {
-+#if defined(EDB_X86)
-+ return regs_.r_eflags;
-+#elif defined(EDB_X86_64)
-+ return regs_.r_rflags;
-+#endif
-+}
-+
-+//------------------------------------------------------------------------------
-+// Name: fpu_register
-+// Desc:
-+//------------------------------------------------------------------------------
-+long double PlatformState::fpu_register(int n) const {
-+ return reinterpret_cast<const long double *>(&fpregs_)[n];
-+}
-+
-+//------------------------------------------------------------------------------
-+// Name: adjust_stack
-+// Desc:
-+//------------------------------------------------------------------------------
-+void PlatformState::adjust_stack(int bytes) {
-+#if defined(EDB_X86)
-+ regs_.r_esp += bytes;
-+#elif defined(EDB_X86_64)
-+ regs_.r_rsp += bytes;
-+#endif
-+}
-+
-+//------------------------------------------------------------------------------
-+// Name: clear
-+// Desc:
-+//------------------------------------------------------------------------------
-+void PlatformState::clear() {
-+ memset(®s_, 0, sizeof(regs_));
-+ memset(&fpregs_, 0, sizeof(fpregs_));
-+ memset(&dr_, 0, sizeof(dr_));
-+#if defined(EDB_X86)
-+ fs_base = 0;
-+ gs_base = 0;
-+#endif
-+}
-+
-+//------------------------------------------------------------------------------
-+// Name: set_debug_register
-+// Desc:
-+//------------------------------------------------------------------------------
-+void PlatformState::set_debug_register(int n, edb::reg_t value) {
-+ dr_[n] = value;
-+}
-+
-+//------------------------------------------------------------------------------
-+// Name: set_flags
-+// Desc:
-+//------------------------------------------------------------------------------
-+void PlatformState::set_flags(edb::reg_t flags) {
-+#if defined(EDB_X86)
-+ regs_.r_eflags = flags;
-+#elif defined(EDB_X86_64)
-+ regs_.r_rflags = flags;
-+#endif
-+}
-+
-+//------------------------------------------------------------------------------
-+// Name: set_instruction_pointer
-+// Desc:
-+//------------------------------------------------------------------------------
-+void PlatformState::set_instruction_pointer(edb::address_t value) {
-+#if defined(EDB_X86)
-+ regs_.r_eip = value;
-+#elif defined(EDB_X86_64)
-+ regs_.r_rip = value;
-+#endif
-+
-+}
-+
-+//------------------------------------------------------------------------------
-+// Name: set_register
-+// Desc:
-+//------------------------------------------------------------------------------
-+void PlatformState::set_register(const QString &name, edb::reg_t value) {
-+
-+ const QString lreg = name.toLower();
-+#if defined(EDB_X86)
-+ if(lreg == "eax") { regs_.r_eax = value; }
-+ else if(lreg == "ebx") { regs_.r_ebx = value; }
-+ else if(lreg == "ecx") { regs_.r_ecx = value; }
-+ else if(lreg == "edx") { regs_.r_edx = value; }
-+ else if(lreg == "ebp") { regs_.r_ebp = value; }
-+ else if(lreg == "esp") { regs_.r_esp = value; }
-+ else if(lreg == "esi") { regs_.r_esi = value; }
-+ else if(lreg == "edi") { regs_.r_edi = value; }
-+ else if(lreg == "eip") { regs_.r_eip = value; }
-+ else if(lreg == "cs") { regs_.r_cs = value; }
-+ else if(lreg == "ds") { regs_.r_ds = value; }
-+ else if(lreg == "es") { regs_.r_es = value; }
-+ else if(lreg == "fs") { regs_.r_fs = value; }
-+ else if(lreg == "gs") { regs_.r_gs = value; }
-+ else if(lreg == "ss") { regs_.r_ss = value; }
-+ else if(lreg == "eflags") { regs_.r_eflags = value; }
-+#elif defined(EDB_X86_64)
-+ if(lreg == "rax") { regs_.r_rax = value; }
-+ else if(lreg == "rbx") { regs_.r_rbx = value; }
-+ else if(lreg == "rcx") { regs_.r_rcx = value; }
-+ else if(lreg == "rdx") { regs_.r_rdx = value; }
-+ else if(lreg == "rbp") { regs_.r_rbp = value; }
-+ else if(lreg == "rsp") { regs_.r_rsp = value; }
-+ else if(lreg == "rsi") { regs_.r_rsi = value; }
-+ else if(lreg == "rdi") { regs_.r_rdi = value; }
-+ else if(lreg == "r8") { regs_.r_r8 = value; }
-+ else if(lreg == "r9") { regs_.r_r9 = value; }
-+ else if(lreg == "r10") { regs_.r_r10 = value; }
-+ else if(lreg == "r11") { regs_.r_r11 = value; }
-+ else if(lreg == "r12") { regs_.r_r12 = value; }
-+ else if(lreg == "r13") { regs_.r_r13 = value; }
-+ else if(lreg == "r14") { regs_.r_r14 = value; }
-+ else if(lreg == "r15") { regs_.r_r15 = value; }
-+ else if(lreg == "rip") { regs_.r_rip = value; }
-+ else if(lreg == "cs") { regs_.r_cs = value; }
-+ else if(lreg == "ds") { regs_.r_ds = value; }
-+ else if(lreg == "es") { regs_.r_es = value; }
-+ else if(lreg == "fs") { regs_.r_fs = value; }
-+ else if(lreg == "gs") { regs_.r_gs = value; }
-+ else if(lreg == "ss") { regs_.r_ss = value; }
-+ else if(lreg == "rflags") { regs_.r_rflags = value; }
-+#endif
-+}
-+
-+
-+//------------------------------------------------------------------------------
-+// Name:
-+// Desc:
-+//------------------------------------------------------------------------------
-+quint64 PlatformState::mmx_register(int n) const {
-+ Q_UNUSED(n);
-+ return 0;
-+}
-+
-+//------------------------------------------------------------------------------
-+// Name:
-+// Desc:
-+//------------------------------------------------------------------------------
-+QByteArray PlatformState::xmm_register(int n) const {
-+ Q_UNUSED(n);
-+ return QByteArray();
-+}
-+
-+}
diff --git a/edb-debugger/patches/patch-plugins_DebuggerCore_unix_netbsd_PlatformState.h b/edb-debugger/patches/patch-plugins_DebuggerCore_unix_netbsd_PlatformState.h
deleted file mode 100644
index 4f01725a3b..0000000000
--- a/edb-debugger/patches/patch-plugins_DebuggerCore_unix_netbsd_PlatformState.h
+++ /dev/null
@@ -1,73 +0,0 @@
-$NetBSD$
-
---- plugins/DebuggerCore/unix/netbsd/PlatformState.h.orig 2016-01-07 03:04:04.000000000 +0000
-+++ plugins/DebuggerCore/unix/netbsd/PlatformState.h
-@@ -0,0 +1,68 @@
-+/*
-+Copyright (C) 2006 - 2014 Evan Teran
-+ eteran%alum.rit.edu@localhost
-+
-+This program is free software: you can redistribute it and/or modify
-+it under the terms of the GNU General Public License as published by
-+the Free Software Foundation, either version 2 of the License, or
-+(at your option) any later version.
-+
-+This program is distributed in the hope that it will be useful,
-+but WITHOUT ANY WARRANTY; without even the implied warranty of
-+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+GNU General Public License for more details.
-+
-+You should have received a copy of the GNU General Public License
-+along with this program. If not, see <http://www.gnu.org/licenses/>.
-+*/
-+
-+#ifndef PLATFORMSTATE_20110330_H_
-+#define PLATFORMSTATE_20110330_H_
-+
-+#include "IState.h"
-+#include "Types.h"
-+#include <sys/types.h>
-+#include <machine/reg.h>
-+
-+namespace DebuggerCore {
-+
-+class PlatformState : public IState {
-+ friend class DebuggerCore;
-+
-+public:
-+ PlatformState();
-+
-+public:
-+ virtual IState *clone() const;
-+
-+public:
-+ virtual QString flags_to_string() const;
-+ virtual QString flags_to_string(edb::reg_t flags) const;
-+ virtual Register value(const QString ®) const;
-+ virtual edb::address_t frame_pointer() const;
-+ virtual edb::address_t instruction_pointer() const;
-+ virtual edb::address_t stack_pointer() const;
-+ virtual edb::reg_t debug_register(int n) const;
-+ virtual edb::reg_t flags() const;
-+ virtual long double fpu_register(int n) const;
-+ virtual void adjust_stack(int bytes);
-+ virtual void clear();
-+ virtual void set_debug_register(int n, edb::reg_t value);
-+ virtual void set_flags(edb::reg_t flags);
-+ virtual void set_instruction_pointer(edb::address_t value);
-+ virtual void set_register(const QString &name, edb::reg_t value);
-+ virtual quint64 mmx_register(int n) const;
-+ virtual QByteArray xmm_register(int n) const;
-+
-+private:
-+ struct reg regs_;
-+ struct fpreg fpregs_;
-+ edb::reg_t dr_[8];
-+ edb::address_t fs_base;
-+ edb::address_t gs_base;
-+};
-+
-+}
-+
-+#endif
-+
diff --git a/edb-debugger/patches/patch-plugins_HeapAnalyzer_DialogHeap.cpp b/edb-debugger/patches/patch-plugins_HeapAnalyzer_DialogHeap.cpp
deleted file mode 100644
index 74eb963a06..0000000000
--- a/edb-debugger/patches/patch-plugins_HeapAnalyzer_DialogHeap.cpp
+++ /dev/null
@@ -1,22 +0,0 @@
-$NetBSD$
-
---- plugins/HeapAnalyzer/DialogHeap.cpp.orig 2014-01-08 04:14:36.000000000 +0000
-+++ plugins/HeapAnalyzer/DialogHeap.cpp
-@@ -263,7 +263,7 @@ void DialogHeap::collect_blocks(edb::add
- const int min_string_length = edb::v1::config().min_string_length;
-
- if(start_address != 0 && end_address != 0) {
--#if defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD) || defined(Q_OS_OPENBSD)
-+#if defined(Q_OS_FREEBSD) || defined(Q_OS_LINUX) || defined(Q_OS_NETBSD) || defined(Q_OS_OPENBSD)
- malloc_chunk currentChunk;
- malloc_chunk nextChunk;
- edb::address_t currentChunkAddress = start_address;
-@@ -412,7 +412,7 @@ void DialogHeap::do_find() {
- QString ldName;
-
- get_library_names(&libcName, &ldName);
--#if defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD) || defined(Q_OS_OPENBSD)
-+#if defined(Q_OS_FREEBSD) || defined(Q_OS_LINUX) || defined(Q_OS_NETBSD) || defined(Q_OS_OPENBSD)
- s = edb::v1::symbol_manager().find(libcName + "::__curbrk");
- if(s) {
- end_address = s->address;
diff --git a/edb-debugger/patches/patch-plugins_ProcessProperties_DialogProcessProperties.cpp b/edb-debugger/patches/patch-plugins_ProcessProperties_DialogProcessProperties.cpp
deleted file mode 100644
index eaaeb07ddf..0000000000
--- a/edb-debugger/patches/patch-plugins_ProcessProperties_DialogProcessProperties.cpp
+++ /dev/null
@@ -1,13 +0,0 @@
-$NetBSD$
-
---- plugins/ProcessProperties/DialogProcessProperties.cpp.orig 2014-01-08 04:19:31.000000000 +0000
-+++ plugins/ProcessProperties/DialogProcessProperties.cpp
-@@ -34,7 +34,7 @@ along with this program. If not, see <h
- #include <QStringListModel>
- #include <QUrl>
-
--#if defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD) || defined(Q_OS_OPENBSD)
-+#if defined(Q_OS_FREEBSD) || defined(Q_OS_LINUX) || defined(Q_OS_NETBSD) || defined(Q_OS_OPENBSD)
- #include <link.h>
- #include <arpa/inet.h>
- #endif
diff --git a/edb-debugger/patches/patch-plugins_plugins.pri b/edb-debugger/patches/patch-plugins_plugins.pri
deleted file mode 100644
index 81fffa8497..0000000000
--- a/edb-debugger/patches/patch-plugins_plugins.pri
+++ /dev/null
@@ -1,27 +0,0 @@
-$NetBSD$
-
---- plugins/plugins.pri.orig 2013-07-23 02:30:10.000000000 +0000
-+++ plugins/plugins.pri
-@@ -23,10 +23,11 @@ unix {
- INCLUDEPATH += $$LEVEL/include $$LEVEL/include/os/unix
-
- # OS include paths
-- linux-* : INCLUDEPATH += $$LEVEL/include/os/unix/linux
-- openbsd-* : INCLUDEPATH += $$LEVEL/include/os/unix/openbsd /usr/local/include
- freebsd-* : INCLUDEPATH += $$LEVEL/include/os/unix/freebsd
-+ linux-* : INCLUDEPATH += $$LEVEL/include/os/unix/linux
- macx-* : INCLUDEPATH += $$LEVEL/include/os/unix/osx /opt/local/include
-+ netbsd-* : INCLUDEPATH += $$LEVEL/include/os/unix/netbsd
-+ openbsd-* : INCLUDEPATH += $$LEVEL/include/os/unix/openbsd /usr/local/include
-
- # arch include paths
- macx {
-@@ -34,7 +35,7 @@ unix {
- include(plugins-x86_64.pri)
- }
-
-- !macx:contains(QMAKE_HOST.arch, x86_64) {
-+ !macx:contains(QMAKE_HOST.arch, x86_64|amd64) {
- INCLUDEPATH += $$LEVEL/include/arch/x86_64
- include(plugins-x86_64.pri)
- }
diff --git a/edb-debugger/patches/patch-src_Debugger.cpp b/edb-debugger/patches/patch-src_Debugger.cpp
deleted file mode 100644
index 938bdd5692..0000000000
--- a/edb-debugger/patches/patch-src_Debugger.cpp
+++ /dev/null
@@ -1,22 +0,0 @@
-$NetBSD$
-
---- src/Debugger.cpp.orig 2014-01-14 17:26:29.000000000 +0000
-+++ src/Debugger.cpp
-@@ -77,7 +77,7 @@ along with this program. If not, see <h
-
- #include <sys/types.h>
- #include <sys/stat.h>
--#if defined(Q_OS_LINUX) || defined(Q_OS_OPENBSD)
-+#if defined(Q_OS_LINUX) || defined(Q_OS_NETBSD) || defined(Q_OS_OPENBSD)
- #include <unistd.h>
- #endif
-
-@@ -314,7 +314,7 @@ void Debugger::update_menu_state(GUI_STA
- // Desc: creates a TTY object for our command line I/O
- //------------------------------------------------------------------------------
- QString Debugger::create_tty() {
--#if defined(Q_OS_LINUX) || defined(Q_OS_OPENBSD) || defined(Q_OS_FREEBSD)
-+#if defined(Q_OS_LINUX) || defined(Q_OS_NETBSD) || defined(Q_OS_OPENBSD) || defined(Q_OS_FREEBSD)
- // we attempt to reuse an open output window
- if(edb::v1::config().tty_enabled && tty_proc_->state() != QProcess::Running) {
- const QString command = edb::v1::config().tty_command;
diff --git a/edb-debugger/patches/patch-src_src.pro b/edb-debugger/patches/patch-src_src.pro
deleted file mode 100644
index 9ba736e882..0000000000
--- a/edb-debugger/patches/patch-src_src.pro
+++ /dev/null
@@ -1,58 +0,0 @@
-$NetBSD$
-
---- src/src.pro.orig 2014-01-14 21:10:03.000000000 +0000
-+++ src/src.pro
-@@ -176,21 +176,16 @@ unix {
- VPATH += $$LEVEL/include/os/unix edisassm
- INCLUDEPATH += $$LEVEL/include/os/unix edisassm
-
-- linux-* {
-- VPATH += $$LEVEL/include/os/unix/linux
-- INCLUDEPATH += $$LEVEL/include/os/unix/linux
-- }
--
-- openbsd-* {
-- VPATH += $$LEVEL/include/os/unix/openbsd
-- INCLUDEPATH += $$LEVEL/include/os/unix/openbsd /usr/local/include
-- }
--
- freebsd-* {
- VPATH += $$LEVEL/include/os/unix/freebsd
- INCLUDEPATH += $$LEVEL/include/os/unix/freebsd
- }
-
-+ linux-* {
-+ VPATH += $$LEVEL/include/os/unix/linux
-+ INCLUDEPATH += $$LEVEL/include/os/unix/linux
-+ }
-+
- macx-* {
- VPATH += $$LEVEL/include/os/unix/osx
- INCLUDEPATH += $$LEVEL/include/os/unix/osx /opt/local/include
-@@ -201,7 +196,17 @@ unix {
- INCLUDEPATH += arch/x86_64 $$LEVEL/include/arch/x86_64
- }
-
-- !macx:contains(QMAKE_HOST.arch, x86_64) {
-+ netbsd-* {
-+ VPATH += $$LEVEL/include/os/unix/netbsd
-+ INCLUDEPATH += $$LEVEL/include/os/unix/netbsd
-+ }
-+
-+ openbsd-* {
-+ VPATH += $$LEVEL/include/os/unix/openbsd
-+ INCLUDEPATH += $$LEVEL/include/os/unix/openbsd /usr/local/include
-+ }
-+
-+ !macx:contains(QMAKE_HOST.arch, x86_64|amd64) {
- VPATH += arch/x86_64 $$LEVEL/include/arch/x86_64
- INCLUDEPATH += arch/x86_64 $$LEVEL/include/arch/x86_64
- }
-@@ -221,6 +226,6 @@ unix {
- linux-g++* : QMAKE_LFLAGS += -rdynamic $$(LDFLAGS)
- macx-clang* : QMAKE_LFLAGS += -rdynamic $$(LDFLAGS)
- macx-g++* : QMAKE_LFLAGS += -rdynamic $$(LDFLAGS)
-+ netbsd-g++* : QMAKE_LFLAGS += -lkvm -Wl,--export-dynamic $$(LDFLAGS)
- openbsd-g++* : QMAKE_LFLAGS += -lkvm -Wl,--export-dynamic $$(LDFLAGS)
- }
--
Home |
Main Index |
Thread Index |
Old Index