added dyninst patches for stat+dysect

This commit is contained in:
Gregory L. Lee 2016-08-08 16:02:33 -07:00
parent f9cb21e886
commit 69931996bf
4 changed files with 117 additions and 3 deletions

View file

@ -44,11 +44,17 @@ class Dyninst(Package):
version('8.1.1', 'd1a04e995b7aa70960cd1d1fac8bd6ac',
url="http://www.paradyn.org/release8.1/DyninstAPI-8.1.1.tgz")
variant('stat_dysect', default=False,
description="patch for STAT's DySectAPI")
depends_on("libelf")
depends_on("libdwarf")
depends_on("boost@1.42:")
depends_on('cmake', type='build')
patch('stat_dysect.patch', when='+stat_dysect')
patch('stackanalysis_h.patch', when='@9.2.0')
# new version uses cmake
def install(self, spec, prefix):
if spec.satisfies('@:8.1'):

View file

@ -0,0 +1,11 @@
--- a/dataflowAPI/h/stackanalysis.h 2016-06-29 14:54:14.000000000 -0700
+++ b/dataflowAPI/h/stackanalysis.h 2016-08-02 09:50:13.619079000 -0700
@@ -331,7 +331,7 @@
// To build intervals, we must replay the effect of each instruction.
// To avoid sucking enormous time, we keep those transfer functions around...
- typedef std::map<ParseAPI::Block *, std::map<Offset, TransferFuncs>>
+ typedef std::map<ParseAPI::Block *, std::map<Offset, TransferFuncs> >
InstructionEffects;
DATAFLOW_EXPORT StackAnalysis();

View file

@ -0,0 +1,96 @@
From 3aebb41ce0ea5b578a1ebf6810446c660066c525 Mon Sep 17 00:00:00 2001
From: Jesper Puge Nielsen <nielsen34@llnl.gov>
Date: Wed, 12 Aug 2015 21:07:52 -0700
Subject: [PATCH] =?UTF-8?q?Exposed=20stackwalker=20and=20proc=20callback=20status=20to=20DySect
=20=C3c?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
dyninstAPI/h/BPatch_process.h | 13 +++++++++++++
dyninstAPI/src/BPatch_process.C | 18 ++++++++++++++++++
dyninstAPI/src/dynProcess.h | 3 ++-
3 files changed, 33 insertions(+), 1 deletions(-)
diff --git a/dyninstAPI/h/BPatch_process.h b/dyninstAPI/h/BPatch_process.h
index 5e01bbb..1316bb2 100644
--- a/dyninstAPI/h/BPatch_process.h
+++ b/dyninstAPI/h/BPatch_process.h
@@ -225,6 +225,10 @@ class BPATCH_DLL_EXPORT BPatch_process : public BPatch_addressSpace {
//
// this function should go away as soon as Paradyn links against Dyninst
PCProcess *lowlevel_process() const { return llproc; }
+
+ // Expose walker from Dyninst proces
+ void *get_walker() const;
+
// These internal funcs trigger callbacks registered to matching events
bool triggerStopThread(instPoint *intPoint, func_instance *intFunc,
int cb_ID, void *retVal);
@@ -281,6 +285,15 @@ class BPATCH_DLL_EXPORT BPatch_process : public BPatch_addressSpace {
bool continueExecution();
+ // BPatch_process::keepStopped
+ //
+ // Changes the desired process stat to prevent
+ // Dyninst from resuming the process after
+ // handling the current event.
+ // Must be called from an event handler.
+
+ void keepStopped();
+
// BPatch_process::terminateExecution
//
// Terminate mutatee process
diff --git a/dyninstAPI/src/BPatch_process.C b/dyninstAPI/src/BPatch_process.C
index 115f215..809e797 100644
--- a/dyninstAPI/src/BPatch_process.C
+++ b/dyninstAPI/src/BPatch_process.C
@@ -507,6 +507,19 @@ bool BPatch_process::continueExecution()
}
/*
+ * BPatch_process::keepStopped
+ *
+ * Changes the desired process stat to prevent
+ * Dyninst from resuming the process after
+ * handling the current event.
+ * Must be called from an event handler.
+ */
+void BPatch_process::keepStopped()
+{
+ llproc->setDesiredProcessState(PCProcess::ps_stopped);
+}
+
+/*
* BPatch_process::terminateExecution
*
* Kill the thread.
@@ -1754,3 +1767,8 @@ bool BPatch_process::protectAnalyzedCode()
}
return ret;
}
+
+void *BPatch_process::get_walker() const
+{
+ return llproc->get_walker();
+}
diff --git a/dyninstAPI/src/dynProcess.h b/dyninstAPI/src/dynProcess.h
index 54b0c6e..00721d1 100644
--- a/dyninstAPI/src/dynProcess.h
+++ b/dyninstAPI/src/dynProcess.h
@@ -302,7 +302,8 @@ public:
// Stackwalking internals
bool walkStack(pdvector<Frame> &stackWalk, PCThread *thread);
bool getActiveFrame(Frame &frame, PCThread *thread);
-
+ Dyninst::Stackwalker::Walker *get_walker() { return stackwalker_; }
+
void addSignalHandler(Address, unsigned);
bool isInSignalHandler(Address addr);
--
1.7.1

View file

@ -34,8 +34,8 @@ class Stat(Package):
version('2.2.0', '26bd69dd57a15afdd5d0ebdb0b7fb6fc')
version('2.1.0', 'ece26beaf057aa9134d62adcdda1ba91')
version('2.0.0', 'c7494210b0ba26b577171b92838e1a9b')
version('3.0.0b', '31df1c2e56ce6ab2a0fe963cd47b769a',
url='https://github.com/LLNL/STAT/files/382650/STAT-3.0.0b.tar.gz')
version('3.0.0b', '4977afd3de2d444a5e1b1fc3b26a38c6',
url='https://github.com/LLNL/STAT/files/397809/STAT-3.0.0b.tar.gz')
# TODO: dysect requires Dyninst patch for version 3.0.0b
variant('dysect', default=False, description="enable DySectAPI")
@ -46,7 +46,8 @@ class Stat(Package):
depends_on('libtool', type='build')
depends_on('libelf')
depends_on('libdwarf')
depends_on('dyninst')
depends_on('dyninst', when='~dysect')
depends_on('dyninst@8.2.1+stat_dysect', when='+dysect')
depends_on('graphlib@2.0.0', when='@2.0.0:2.2.0')
depends_on('graphlib@3.0.0', when='@3:')
depends_on('graphviz', type=alldeps)