Skip to content
This repository has been archived by the owner on Apr 3, 2024. It is now read-only.

Implement v8 Inspector Protocol #329

Merged
merged 17 commits into from
Sep 25, 2017

Conversation

gaofanmichael
Copy link
Contributor

No description provided.

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Sep 11, 2017
@@ -59,10 +60,13 @@ export function create(
if (singleton && !config_.forceNewAgent_) {
return singleton;
}
let debugapi: any;

This comment was marked as spam.

Copy link
Contributor

@kjin kjin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a few comments - feel free to ping me on anything I need to elaborate on.

sourcemapper_: SourceMapper): DebugApi;
}
let debugApiConstructor: DebugApiConstructor;
let nodeVersion = /v(\d+\.\d+\.\d+)/.exec(process.version);

This comment was marked as spam.

This comment was marked as spam.

let nodeVersion = /v(\d+\.\d+\.\d+)/.exec(process.version);
if (!nodeVersion || nodeVersion.length < 2) {
console.error('can\'t get the node version.');
process.exit(1);

This comment was marked as spam.

This comment was marked as spam.

let debugapi: any;
debugapi = new debugApiConstructor(logger_, config_, jsFiles_, sourcemapper_);

singleton = {

This comment was marked as spam.

This comment was marked as spam.

singleton.disconnect();
}

let debugapi: any;

This comment was marked as spam.

This comment was marked as spam.

let singleton: DebugApi;

export function create(
logger_: Logger, config_: DebugAgentConfig, jsFiles_: ScanStats,

This comment was marked as spam.

This comment was marked as spam.

*
* @return an object with error and mirror fields.
*/
export function evaluate(

This comment was marked as spam.

This comment was marked as spam.

// Evaluate the watch expressions
const evalIndexSet = new Set();
if (this.expressions_) {
this.expressions_.forEach(async (expression, index2) => {

This comment was marked as spam.

This comment was marked as spam.

}

resolveFullPath_(frame: inspector.Debugger.CallFrame): string {
let scriptId: string = frame.location.scriptId;

This comment was marked as spam.

This comment was marked as spam.

varTableIndex: ARG_LOCAL_LIMIT_MESSAGE_INDEX
});
} else {
args = [];

This comment was marked as spam.

This comment was marked as spam.

* name.
* @function resolveLocalsList_
* @memberof StateResolver
* @param {FrameMirror} frame - A instance of FrameMirror

This comment was marked as spam.

This comment was marked as spam.

@kjin
Copy link
Contributor

kjin commented Sep 21, 2017

Also, could you give this PR (and future PRs) a more descriptive title than its branch name?

@gaofanmichael gaofanmichael changed the title Feature/interface2 Implement v8 Inspector Protocol Sep 25, 2017
Copy link
Contributor

@kjin kjin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good for the most part. I left a few more comments... should be good to go once you've addressed these.

public id: string, public active: boolean,
public apiBreakpoint: apiTypes.Breakpoint,
public parsedCondition: estree.Node,
public compile: null|((src: string) => string)) {}

This comment was marked as spam.

const nodeVersion = /v(\d+\.\d+\.\d+)/.exec(process.version);

if (!nodeVersion || nodeVersion.length < 2) {
console.error(

This comment was marked as spam.

This comment was marked as spam.

try {
this.handleDebugPausedEvent(message.params);
} catch (error) {
console.error(error);

This comment was marked as spam.

This comment was marked as spam.

}
}

handleDebugPausedEvent(params: inspector.Debugger.PausedEventDataType) {

This comment was marked as spam.

This comment was marked as spam.


export function create(
logger: Logger, config: DebugAgentConfig, jsFiles: ScanStats,
sourcemapper: SourceMapper): DebugApi|null {

This comment was marked as spam.

This comment was marked as spam.

utils.messages.V8_BREAKPOINT_CLEAR_ERROR);
}
const id = breakpoint.id;
let result = this.v8Inspector.removeBreakpoint(breakpointData.id);

This comment was marked as spam.

This comment was marked as spam.

breakpoint.logMessageFormat as string,
// TODO: Determine how to remove the `as` cast below
breakpoint.evaluatedExpressions.map(
JSON.stringify as (ob: any) => string));

This comment was marked as spam.

This comment was marked as spam.

scriptmapper: {[id: string]: any}, v8Inspector: V8Inspector) {
this.callFrames_ = callFrames;
this.breakpoint_ = breakpoint;
this.expressions_ = breakpoint.expressions as string[];

This comment was marked as spam.

This comment was marked as spam.

assert(!this.resolvedVariableTable_[index]); // shouldn't have it
// resolved yet
const isEvaluated = evalIndexSet.has(index);
if (this.rawVariableTable_[index].objectId)

This comment was marked as spam.

This comment was marked as spam.

for (let i = 0; i < count; ++i) {
let result = this.v8Inspector_.getProperties(
frame.scopeChain[i].object.objectId as string);
if (result.response && !isEmpty(result.response.result)) {

This comment was marked as spam.

This comment was marked as spam.

Copy link
Contributor

@kjin kjin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@gaofanmichael gaofanmichael merged commit 3114892 into googleapis:master Sep 25, 2017
@gaofanmichael gaofanmichael deleted the feature/interface2 branch September 29, 2017 22:06
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants