Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions .github/workflows/ethdebug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,18 @@ on:
- "schemas/**"
- "packages/format/**"
- "packages/conformance/**"
push:
branches: [main]
paths:
- ".github/workflows/ethdebug.yml"
- "package.json"
- "yarn.lock"
- "tsconfig*.json"
- "schemas/**"
- "packages/format/**"
- "packages/conformance/**"
schedule:
- cron: "0 6 * * 1"
workflow_dispatch:
inputs:
solidity_ref:
Expand All @@ -18,17 +30,17 @@ on:
required: true
soldb_ref:
description: SolDB ref to build
default: v0.3.0
default: v0.4.0
required: true

concurrency:
group: ethdebug-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
group: ethdebug-${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

env:
FOUNDRY_VERSION: v1.0.0
SOLIDITY_REF: ${{ github.event.inputs.solidity_ref || 'develop' }}
SOLDB_REF: ${{ github.event.inputs.soldb_ref || 'v0.3.0' }}
SOLDB_REF: ${{ github.event.inputs.soldb_ref || 'v0.4.0' }}

jobs:
conformance:
Expand Down
12 changes: 9 additions & 3 deletions packages/conformance/src/adapters/soldb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,17 +73,23 @@ export function sourceBreakpointScript(target: string): string {
return `break ${target}\ncontinue\nq\n`;
}

function escapeRegExp(text: string): string {
return text.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
}

export function observeSourceBreakpoint(
result: SoldbResult,
target: string,
): { set: boolean; hit: boolean; stoppedAtTarget: boolean } {
return {
// SolDB numbers breakpoints, e.g. `Breakpoint #1 set at Counter.sol:8` and
// `Breakpoint #1 hit at step 88, Counter.sol:8, PC 558`, so match the stable
// fragments rather than an exact, unnumbered prefix.
// `Breakpoint #1 hit at step 88, Counter.sol:8` (older releases append
// `, PC 558`), so match the stable fragments rather than an exact prefix.
set: result.stdout.includes(`set at ${target}`),
hit: /Breakpoint #\d+ hit at step/.test(result.stdout),
stoppedAtTarget: result.stdout.includes(`${target}, PC`),
stoppedAtTarget: new RegExp(
`hit at step \\d+, ${escapeRegExp(target)}\\b`,
).test(result.stdout),
};
}

Expand Down
Loading