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

When adding a break point, like b Address.sol:119, it might add it to multiple files with a confusing message #4582

Open
davidmurdoch opened this issue Jan 3, 2022 · 2 comments

Comments

@davidmurdoch
Copy link
Member

davidmurdoch commented Jan 3, 2022

Setting a breakpoint may result in a confusing message. Example:

Breakpoint at line 119 in Address.sol already exists.
Breakpoint at line 122 in Address.sol already exists.
Breakpoint at line 119 in Address.sol already exists.
Breakpoint at line 119 in Address.sol already exists.

Reproduction Steps:

Create this truffle config:

truffle-config.js

module.exports = {
  networks: {
    development: {
     host: "127.0.0.1",
     port: 8545,
     network_id: "*"
    }
  }
};

start ganache like this:

ganache --fork --chain.chainId 1 --unlock 0x9429cd74A3984396f3117d51cde46ea8e0e21487 --fork.blockNumber 13593315

run this transaction

curl -H 'Content-Type: application/json'   --data '{"jsonrpc":"2.0", "id": 1, "method": "eth_sendTransaction", "params": [ {"from": "0x9429cd74A3984396f3117d51cde46ea8e0e21487", "to": "0x0a61c2146A7800bdC278833F21EBf56Cd660EE2a", "data": "0x6433a9ea0000000000000000000000002150b45626199cfa5089368bdca30cd0bfb152d60000000000000000000000000000000000000000000000000000000000000080f7709b14a0f5e8bd2d0c1e3fc53c6a443f512aa29eeb905321172bf2b1fe39be0000000000000000000000000000000000000000000000000000000000cf6ae5000000000000000000000000000000000000000000000000000000000000002436df7ea50000000000000000000000007900c70a377f89df29d1d1939469ae3b74c5b74000000000000000000000000000000000000000000000000000000000", "gas": "0xb71b00"} ] }' http://localhost:8545

Run:

truffle debug -x 0x1d3bc7a1c3f6d0f1d33f449bf7602c1fa946cb026fe1733e402d3b4ef3da3b5a

(0x1d3bc7a1c3f6d0f1d33f449bf7602c1fa946cb026fe1733e402d3b4ef3da3b5a should be the transaction hash generated by running the transaction above)

then set a breakpoint:

debug(development:0x1d3bc7a1...)> b Address.sol:119
WARNING: Acting on all matching sources because disambiguation between them is not possible.
Breakpoint at line 119 in Address.sol already exists.
Breakpoint at line 122 in Address.sol already exists.
Breakpoint at line 119 in Address.sol already exists.
Breakpoint at line 119 in Address.sol already exists.
@haltman-at
Copy link
Contributor

Probably worth noting here, the original confusing message was

debug(development:0x1d3bc7a1...)> b Address.sol:119
WARNING: Acting on all matching sources because disambiguation between them is not possible.
Breakpoint added at line 119 in Address.sol.
Breakpoint added at line 122 in Address.sol.
Breakpoint added at line 119.
Breakpoint added at line 119 in Address.sol.

@davidmurdoch
Copy link
Member Author

Ah yes, sorry I missed that important part in my reproduction steps! To get the above message you'll need to set the breakpoint while already paused in an Address.sol file.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants