source: webkit/trunk/JavaScriptCore/kjs/debugger.cpp@ 24244

Last change on this file since 24244 was 17372, checked in by darin, 19 years ago

Reviewed by Geoff.

  • made changes so the code compiles with the highest warning level under MSVC (disabling some warnings, making some code fixes)
  • API/JSCallbackConstructor.cpp: (KJS::JSCallbackConstructor::construct):
  • API/JSCallbackFunction.cpp: (KJS::JSCallbackFunction::callAsFunction):
  • API/JSCallbackObject.cpp: (KJS::JSCallbackObject::init): (KJS::JSCallbackObject::construct): (KJS::JSCallbackObject::callAsFunction):
  • API/JSObjectRef.cpp: (JSPropertyNameArrayGetNameAtIndex):
  • API/JSStringRef.cpp: (JSStringCreateWithCharacters):
  • JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  • bindings/c/c_utility.cpp: (KJS::Bindings::convertUTF8ToUTF16): (KJS::Bindings::coerceValueToNPVariantStringType): (KJS::Bindings::convertValueToNPVariant):
  • kjs/DateMath.h: (KJS::GregorianDateTime::GregorianDateTime):
  • kjs/ExecState.h: (KJS::ExecState::hadException):
  • kjs/JSImmediate.h: (KJS::JSImmediate::fromDouble): (KJS::JSImmediate::toDouble): (KJS::JSImmediate::NanAsBits): (KJS::JSImmediate::oneAsBits):
  • kjs/Parser.h:
  • kjs/PropertyNameArray.h: (KJS::PropertyNameArray::size):
  • kjs/array_object.cpp: (ArrayObjectImp::callAsFunction):
  • kjs/bool_object.cpp: (BooleanObjectImp::callAsFunction):
  • kjs/collector.cpp: (KJS::Collector::allocate): (KJS::Collector::markCurrentThreadConservatively): (KJS::Collector::collect):
  • kjs/completion.h: (KJS::Completion::isValueCompletion):
  • kjs/date_object.cpp: (KJS::findMonth):
  • kjs/debugger.cpp: (Debugger::sourceParsed): (Debugger::sourceUnused): (Debugger::exception): (Debugger::atStatement): (Debugger::callEvent): (Debugger::returnEvent):
  • kjs/dtoa.cpp:
  • kjs/error_object.cpp: (ErrorObjectImp::callAsFunction): (NativeErrorImp::callAsFunction):
  • kjs/function.cpp: (KJS::FunctionImp::processVarDecls): (KJS::GlobalFuncImp::callAsFunction):
  • kjs/function_object.cpp: (FunctionPrototype::callAsFunction):
  • kjs/grammar.y:
  • kjs/identifier.cpp: (KJS::CStringTranslator::translate): (KJS::Identifier::add):
  • kjs/internal.h:
  • kjs/lexer.cpp: (Lexer::lex): (Lexer::isIdentStart): (Lexer::isIdentPart): (isDecimalDigit): (Lexer::isHexDigit): (Lexer::isOctalDigit): (Lexer::matchPunctuator): (Lexer::singleEscape): (Lexer::convertOctal): (Lexer::convertHex): (Lexer::convertUnicode): (Lexer::record8):
  • kjs/lexer.h:
  • kjs/math_object.cpp: (MathFuncImp::callAsFunction):
  • kjs/number_object.cpp: (integer_part_noexp): (intPow10): (NumberProtoFunc::callAsFunction): (NumberObjectImp::callAsFunction):
  • kjs/object.cpp: (KJS::JSObject::deleteProperty): (KJS::JSObject::callAsFunction): (KJS::JSObject::toBoolean): (KJS::JSObject::toObject):
  • kjs/object.h: (KJS::JSObject::getPropertySlot):
  • kjs/property_map.cpp: (KJS::isValid): (KJS::PropertyMap::put): (KJS::PropertyMap::insert): (KJS::PropertyMap::containsGettersOrSetters):
  • kjs/property_map.h: (KJS::PropertyMap::hasGetterSetterProperties):
  • kjs/property_slot.h:
  • kjs/string_object.cpp: (StringInstance::getPropertyNames): (StringObjectImp::callAsFunction): (StringObjectFuncImp::callAsFunction):
  • kjs/ustring.cpp: (KJS::UString::Rep::computeHash): (KJS::UString::UString): (KJS::UString::from): (KJS::UString::append): (KJS::UString::ascii): (KJS::UString::operator=): (KJS::UString::find): (KJS::UString::rfind):
  • kjs/ustring.h: (KJS::UChar::high): (KJS::UChar::low): (KJS::UCharReference::low): (KJS::UCharReference::high):
  • kjs/value.cpp: (KJS::JSValue::toUInt16):
  • kjs/value.h:
  • pcre/pcre_compile.c: (get_othercase_range):
  • pcre/pcre_exec.c: (match):
  • pcre/pcre_internal.h:
  • wtf/HashFunctions.h: (WTF::intHash): (WTF::PtrHash::hash):
  • wtf/MathExtras.h: (isnan): (lround): (lroundf):
  • wtf/StringExtras.h: (strncasecmp):
  • wtf/unicode/icu/UnicodeIcu.h: (WTF::Unicode::isPrintableChar):
  • Property svn:eol-style set to native
File size: 3.4 KB
Line 
1// -*- c-basic-offset: 2 -*-
2/*
3 * This file is part of the KDE libraries
4 * Copyright (C) 1999-2001 Harri Porten ([email protected])
5 * Copyright (C) 2001 Peter Kelly ([email protected])
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 *
21 */
22
23#include "config.h"
24#include "debugger.h"
25#include "ustring.h"
26
27#include "internal.h"
28
29using namespace KJS;
30
31// ------------------------------ Debugger -------------------------------------
32
33namespace KJS {
34 struct AttachedInterpreter
35 {
36 public:
37 AttachedInterpreter(Interpreter *i, AttachedInterpreter *ai) : interp(i), next(ai) { ++Debugger::debuggersPresent; }
38 ~AttachedInterpreter() { --Debugger::debuggersPresent; }
39 Interpreter *interp;
40 AttachedInterpreter *next;
41 };
42
43}
44
45int Debugger::debuggersPresent = 0;
46
47Debugger::Debugger()
48{
49 rep = new DebuggerImp();
50}
51
52Debugger::~Debugger()
53{
54 detach(0);
55 delete rep;
56}
57
58void Debugger::attach(Interpreter* interp)
59{
60 Debugger *other = interp->debugger();
61 if (other == this)
62 return;
63 if (other)
64 other->detach(interp);
65 interp->setDebugger(this);
66 rep->interps = new AttachedInterpreter(interp, rep->interps);
67}
68
69void Debugger::detach(Interpreter* interp)
70{
71 // iterate the addresses where AttachedInterpreter pointers are stored
72 // so we can unlink items from the list
73 AttachedInterpreter **p = &rep->interps;
74 AttachedInterpreter *q;
75 while ((q = *p)) {
76 if (!interp || q->interp == interp) {
77 *p = q->next;
78 q->interp->setDebugger(0);
79 delete q;
80 } else
81 p = &q->next;
82 }
83
84 if (interp)
85 latestExceptions.remove(interp);
86 else
87 latestExceptions.clear();
88}
89
90bool Debugger::hasHandledException(ExecState *exec, JSValue *exception)
91{
92 if (latestExceptions.get(exec->dynamicInterpreter()).get() == exception)
93 return true;
94
95 latestExceptions.set(exec->dynamicInterpreter(), exception);
96 return false;
97}
98
99bool Debugger::sourceParsed(ExecState*, int /*sourceId*/, const UString &/*sourceURL*/,
100 const UString &/*source*/, int /*startingLineNumber*/, int /*errorLine*/, const UString & /*errorMsg*/)
101{
102 return true;
103}
104
105bool Debugger::sourceUnused(ExecState*, int /*sourceId*/)
106{
107 return true;
108}
109
110bool Debugger::exception(ExecState*, int /*sourceId*/, int /*lineno*/,
111 JSValue* /*exception */)
112{
113 return true;
114}
115
116bool Debugger::atStatement(ExecState*, int /*sourceId*/, int /*firstLine*/,
117 int /*lastLine*/)
118{
119 return true;
120}
121
122bool Debugger::callEvent(ExecState*, int /*sourceId*/, int /*lineno*/,
123 JSObject* /*function*/, const List &/*args*/)
124{
125 return true;
126}
127
128bool Debugger::returnEvent(ExecState*, int /*sourceId*/, int /*lineno*/,
129 JSObject* /*function*/)
130{
131 return true;
132}
133
Note: See TracBrowser for help on using the repository browser.