Skip to content

why could not show some variable when debuging the go program? #906

@jiebanghan

Description

@jiebanghan

The result is below:

github.com/ethereum/go-ethereum/internal/ethapi.(*PublicDebugAPI).PrintBlock() ./mychain/go-ethereum/build/_workspace/src/github.com/ethereum/go-ethereum/build/_workspace/src/github.com/ethereum/go-ethereum/internal/ethapi/api.go:1392 (PC: 0xafc5e1)
1387: return fmt.Sprintf("%x", encoded), nil
1388: }
1389:
1390: // PrintBlock retrieves a block and returns its pretty printed form.
1391: func (api *PublicDebugAPI) PrintBlock(ctx context.Context, number uint64) (string, error) {
=>1392: block, _ := api.b.BlockByNumber(ctx, rpc.BlockNumber(number))
1393: if block == nil {
1394: return "", fmt.Errorf("block #%d not found", number)
1395: }
1396: return fmt.Sprintf("%s", block), nil
1397: }
(dlv) p block
Command failed: could not find symbol value for block
(dlv)

So please tell me how to show block? is there some setting in Makefile in order to debug it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions