2 * Copyright (c) 1996-2008 Barton P. Miller
4 * We provide the Paradyn Parallel Performance Tools (below
5 * described as "Paradyn") on an AS IS basis, and do not warrant its
6 * validity or performance. We reserve the right to update, modify,
7 * or discontinue this software at any time. We shall have no
8 * obligation to supply such updates or modifications or any other
9 * form of support to you.
11 * By your use of Paradyn, you understand and agree that we (or any
12 * other person or entity with proprietary rights in Paradyn) are
13 * under no obligation to provide either maintenance services,
14 * update services, notices of latent defects, or correction of
15 * defects for Paradyn.
17 * This library is free software; you can redistribute it and/or
18 * modify it under the terms of the GNU Lesser General Public
19 * License as published by the Free Software Foundation; either
20 * version 2.1 of the License, or (at your option) any later version.
22 * This library is distributed in the hope that it will be useful,
23 * but WITHOUT ANY WARRANTY; without even the implied warranty of
24 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
25 * Lesser General Public License for more details.
27 * You should have received a copy of the GNU Lesser General Public
28 * License along with this library; if not, write to the Free Software
29 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
32 #include "stackwalk/h/walker.h"
33 #include "stackwalk/h/framestepper.h"
34 #include "stackwalk/h/steppergroup.h"
35 #include "stackwalk/h/swk_errors.h"
36 #include "common/h/ntHeaders.h"
40 using namespace Dyninst;
41 using namespace Dyninst::Stackwalker;
43 bool Walker::createDefaultSteppers()
45 FrameStepper *stepper;
48 stepper = new FrameFuncStepper(this);
49 result = addStepper(stepper);
52 sw_printf("[%s:%u] - Stepper %p is FrameFuncStepper\n",
53 __FILE__, __LINE__, stepper);
57 sw_printf("[%s:%u] - Error adding stepper %p\n", stepper);
61 bool ProcSelf::getThreadIds(std::vector<THR_ID> &threads)
66 result = getDefaultThread(tid);
68 sw_printf("[%s:%u] - Could not read default thread\n",
73 threads.push_back(tid);
77 bool ProcSelf::getDefaultThread(THR_ID &default_tid)
79 default_tid = GetCurrentThread();
83 bool ProcSelf::readMem(void *dest, Address source, size_t size)
85 memcpy(dest, (const void *) source, size);
89 ProcSelf::ProcSelf() :
90 ProcessState(_getpid());
94 void ProcSelf::initialize()
98 ProcDebug *ProcDebug::newProcDebug(PID pid)
103 ProcDebug *ProcDebug::newProcDebug(const std::string &executable,
104 const std::vector<std::string> &argv)
109 DebugEvent ProcDebug::debug_get_event(bool block)