1 /* -*- Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4 -*- */
2 /* vi: set ts=4 sw=4 expandtab: (add to ~/.vimrc: set modeline modelines=5) */
3 /* ***** BEGIN LICENSE BLOCK *****
4 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
6 * The contents of this file are subject to the Mozilla Public License Version
7 * 1.1 (the "License"); you may not use this file except in compliance with
8 * the License. You may obtain a copy of the License at
9 * http://www.mozilla.org/MPL/
11 * Software distributed under the License is distributed on an "AS IS" basis,
12 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
13 * for the specific language governing rights and limitations under the
16 * The Original Code is [Open Source Virtual Machine.].
18 * The Initial Developer of the Original Code is
19 * Adobe System Incorporated.
20 * Portions created by the Initial Developer are Copyright (C) 1993-2006
21 * the Initial Developer. All Rights Reserved.
26 * Alternatively, the contents of this file may be used under the terms of
27 * either the GNU General Public License Version 2 or later (the "GPL"), or
28 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
29 * in which case the provisions of the GPL or the LGPL are applicable instead
30 * of those above. If you wish to allow use of your version of this file only
31 * under the terms of either the GPL or the LGPL, and not to allow others to
32 * use your version of this file under the terms of the MPL, indicate your
33 * decision by deleting the provisions above and replace them with the notice
34 * and other provisions required by the GPL or the LGPL. If you do not delete
35 * the provisions above, a recipient may use your version of this file under
36 * the terms of any one of the MPL, the GPL or the LGPL.
38 * ***** END LICENSE BLOCK ***** */
49 Debugger::Debugger(AvmCore
*core
, TraceLevel tracelevel
)
50 : astrace_console(tracelevel
)
51 , astrace_callback(TRACE_OFF
)
53 , astraceStartTime(VMPI_getTime())
55 , abcList(core
->GetGC(), kListInitialCapacity
)
64 void Debugger::stepInto()
68 void Debugger::stepOver()
72 void Debugger::stepOut()
76 void Debugger::stepContinue()
80 bool Debugger::breakpointSet(SourceInfo
* source
, int linenum
)
85 bool Debugger::breakpointClear(SourceInfo
* source
, int linenum
)
90 void Debugger::debugLine(int linenum
)
94 void Debugger::debugFile(Stringp filename
)
98 void Debugger::debugMethod(MethodEnv
* /*env*/)
102 void Debugger::_debugMethod(MethodEnv
* env
)
106 void Debugger::disableAllTracing()
110 void Debugger::traceMethod(MethodInfo
* fnc
, bool ignoreArgs
)
114 void Debugger::traceLine(int line
)
118 void Debugger::processAbc(PoolObject
* pool
, ScriptBuffer code
)
122 int Debugger::frameCount()
127 DebugFrame
* Debugger::frameAt(int frameNbr
)
132 int Debugger::abcCount() const
137 AbcInfo
* Debugger::abcAt(int index
) const
142 AbcFile::AbcFile(AvmCore
* core
, int size
)
144 source(core
->GetGC(), kListInitialCapacity
),
147 sourcemap
= HeapHashtable::create(core
->GetGC());
150 int AbcFile::sourceCount() const
155 SourceInfo
* AbcFile::sourceAt(int index
) const
160 int AbcFile::size() const
165 SourceFile
* AbcFile::sourceNamed(Stringp name
)
170 void AbcFile::sourceAdd(SourceFile
* s
)
174 SourceFile::SourceFile(MMgc::GC
* gc
, Stringp name
)
176 , functions(gc
, kListInitialCapacity
)
180 Stringp
SourceFile::name() const
185 void SourceFile::addLine(int linenum
, MethodInfo
* func
, int offset
)
189 int SourceFile::functionCount() const
194 MethodInfo
* SourceFile::functionAt(int index
) const
199 bool SourceFile::setBreakpoint(int linenum
)
204 bool SourceFile::clearBreakpoint(int linenum
)
209 bool SourceFile::hasBreakpoint(int linenum
)
214 bool DebugFrame::methodName(Stringp
&)
219 bool DebugFrame::argumentName(int, Stringp
&)
224 DebugStackFrame::DebugStackFrame(int nbr
, CallStackNode
* tr
, Debugger
* debug
) : trace(NULL
)
228 bool DebugStackFrame::sourceLocation(SourceInfo
*& source
, int& linenum
)
233 bool DebugStackFrame::dhis(Atom
& a
)
238 bool DebugStackFrame::methodName(Stringp
& result
) {
242 bool DebugStackFrame::argumentName(int which
, Stringp
& result
) {
246 bool DebugStackFrame::arguments(Atom
*& ar
, int& count
)
251 bool DebugStackFrame::setArgument(int which
, Atom
& val
)
256 bool DebugStackFrame::locals(Atom
*& ar
, int& count
)
261 bool DebugStackFrame::setLocal(int which
, Atom
& val
)
267 #endif /* DEBUGGER */