Changeset 33979 in webkit for trunk/JavaScriptCore/kjs/debugger.h


Ignore:
Timestamp:
May 21, 2008, 6:20:45 PM (17 years ago)
Author:
[email protected]
Message:

Merge squirrelfish branch into trunk.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/debugger.h

    r28471 r33979  
    2121 */
    2222
    23 #ifndef _KJSDEBUGGER_H_
    24 #define _KJSDEBUGGER_H_
     23#ifndef Debugger_h
     24#define Debugger_h
    2525
    26 #include <wtf/HashMap.h>
     26#include <wtf/HashSet.h>
    2727#include "protect.h"
    2828
    2929namespace KJS {
    3030
    31   class DebuggerImp;
     31  class DebuggerCallFrame;
    3232  class ExecState;
    3333  class JSGlobalObject;
    3434  class JSObject;
    3535  class JSValue;
     36  class List;
     37  class SourceProvider;
    3638  class UString;
    37   class List;
    38 
     39 
    3940  /**
    4041   * @internal
     
    4344   * script-execution related events such as statement execution and function
    4445   * calls.
    45    *
    46    * WARNING: This interface is still a work in progress and is not yet
    47    * offically publicly available. It is likely to change in binary incompatible
    48    * (and possibly source incompatible) ways in future versions. It is
    49    * anticipated that at some stage the interface will be frozen and made
    50    * available for general use.
    5146   */
    5247  class Debugger {
     
    6459    virtual ~Debugger();
    6560
    66     DebuggerImp *imp() const { return rep; }
    67 
    6861    /**
    6962     * Attaches the debugger to specified global object. This will cause this
     
    7770     *
    7871     * @param The global object to attach to.
    79      *
    80      * @see detach()
    8172     */
    8273    void attach(JSGlobalObject*);
     
    8576     * Detach the debugger from a global object.
    8677     *
    87      * @param The global object to detach from. If 0, the debugger will be
    88      * detached from all global objects to which it is attached.
    89      *
    90      * @see attach()
     78     * @param The global object to detach from.
    9179     */
    9280    void detach(JSGlobalObject*);
     
    112100     * @param errorMsg The error description, or null if the source code
    113101       was valid and parsed successfully
    114      * @return true if execution should be continue, false if it should
    115      * be aborted
    116102     */
    117     virtual bool sourceParsed(ExecState *exec, int sourceId, const UString &sourceURL,
    118                               const UString &source, int startingLineNumber, int errorLine, const UString &errorMsg);
    119 
    120     /**
    121      * Called when all functions/programs associated with a particular
    122      * sourceId have been deleted. After this function has been called for
    123      * a particular sourceId, that sourceId will not be used again.
    124      *
    125      * The default implementation does nothing. Override this method if
    126      * you want to process this event.
    127      *
    128      * @param exec The current execution state
    129      * @param sourceId The ID of the source code (corresponds to the
    130      * sourceId supplied in other functions such as atLine()
    131      * @return true if execution should be continue, false if it should
    132      * be aborted
    133      */
    134     virtual bool sourceUnused(ExecState *exec, int sourceId);
     103    virtual void sourceParsed(ExecState*, int sourceId, const UString& sourceURL,
     104                              const SourceProvider& source, int startingLineNumber, int errorLine, const UString& errorMsg) = 0;
    135105
    136106    /**
     
    144114     * @param lineno The line at which the error occurred
    145115     * @param exceptionObj The exception object
    146      * @return true if execution should be continue, false if it should
    147      * be aborted
    148116     */
    149     virtual bool exception(ExecState *exec, int sourceId, int lineno,
    150                            JSValue *exception);
    151 
    152     bool hasHandledException(ExecState *, JSValue *);
     117    virtual void exception(const DebuggerCallFrame&, int sourceId, int lineno) = 0;
    153118
    154119    /**
     
    164129     * @param lastLine The ending line of the statement  that is about to be
    165130     * executed (usually the same as firstLine)
    166      * @return true if execution should be continue, false if it should
    167      * be aborted
    168131     */
    169     virtual bool atStatement(ExecState *exec, int sourceId, int firstLine,
    170                              int lastLine);
     132    virtual void atStatement(const DebuggerCallFrame&, int sourceId, int lineno) = 0;
    171133    /**
    172134     * Called on each function call. Use together with @ref #returnEvent
     
    183145     * @param sourceId The ID of the source code being executed
    184146     * @param lineno The line that is about to be executed
    185      * @param function The function being called
    186      * @param args The arguments that were passed to the function
    187      * line is being executed
    188      * @return true if execution should be continue, false if it should
    189      * be aborted
    190147     */
    191     virtual bool callEvent(ExecState *exec, int sourceId, int lineno,
    192                            JSObject *function, const List &args);
     148    virtual void callEvent(const DebuggerCallFrame&, int sourceId, int lineno) = 0;
    193149
    194150    /**
     
    206162     * @param sourceId The ID of the source code being executed
    207163     * @param lineno The line that is about to be executed
    208      * @param function The function being called
    209      * @return true if execution should be continue, false if it should
    210      * be aborted
    211164     */
    212     virtual bool returnEvent(ExecState *exec, int sourceId, int lineno,
    213                              JSObject *function);
     165    virtual void returnEvent(const DebuggerCallFrame&, int sourceId, int lineno) = 0;
    214166
    215167  private:
    216     DebuggerImp *rep;
    217     HashMap<JSGlobalObject*, ProtectedPtr<JSValue> > latestExceptions;
    218 
    219   public:
    220     static int debuggersPresent;
     168    HashSet<JSGlobalObject*> m_globalObjects;
    221169  };
    222170
    223 }
     171} // namespace KJS
    224172
    225173#endif
Note: See TracChangeset for help on using the changeset viewer.