Breakpoints ignored when debugging ethereum-go in Visual Studio Code with Rich Go extension










0















I am trying to debug go-ethereum code inside the Visual Studio Code. So far I was able to build debug version of binaries by modifying the Makefile and run the project inside the VS Code with "Rich Go" extension installed.



Entry to the MakeFile:



debug:
# https://ethereum.stackexchange.com/questions/41489/how-to-debug-geth-with-delve?rq=1
@echo building debug version
build/env.sh go build -o ./build/bin/geth -gcflags=all='-N -l' -v ./cmd/geth
@echo end building debug version
@echo "Run "$(GOBIN)/geth" to launch geth."


My launch.json file is:



 
"name": "Launch",
"type": "go",
"request": "launch",
"mode": "exec",
"trace": "verbose",
"remotePath": "$workspaceRoot",
"port": 2345,
"host": "127.0.0.1",
"program": "$workspaceRoot/build/bin/geth",
"sources": "$workspaceRoot",
"args": [

],
"showLog": true
,


I am able to run the project inside the Visual Studio Code but all breakpoints are ignored.



Creating on: /Users/work/go/efsn/core/blockchain.go (/Users/work/go/efsn/core/blockchain.go) :256
Error on CreateBreakpoint: could not find /Users/work/go/efsn/core/blockchain.go:256


This is printout from my debug console:



Verbose logs are written to:
/var/folders/f0/8kqy01l55s3f5b642wc2w47w0000gp/T/vscode-go-debug.txt
10:18:57 AM, 11/14/2018
InitializeRequest
InitializeResponse
Using GOPATH: /Users/work/go
Current working directory: /Users/work/go/efsn/build/bin
Running: /Users/work/go/bin/dlv exec /Users/work/go/efsn/build/bin/geth --headless=true --listen=127.0.0.1:2345 --api-version=2 --log=true --
API server listening at: 127.0.0.1:2345
time="2018-11-14T10:18:57-05:00" level=info msg="launching process with args: [/Users/work/go/efsn/build/bin/geth]" layer=debugger
InitializeEvent
SetBreakPointsRequest
All cleared
Creating on: /Users/work/go/efsn/core/blockchain.go (/Users/work/go/efsn/core/blockchain.go) :256
Error on CreateBreakpoint: could not find /Users/work/go/efsn/core/blockchain.go:256
All set:[null]
SetBreakPointsResponse
ConfigurationDoneRequest
ContinueRequest
ContinueResponse
time="2018-11-14T10:18:58-05:00" level=debug msg=continuing layer=debugger
INFO [11-14|10:18:59.171] Maximum peer count ETH=25 LES=0 total=25
INFO [11-14|10:18:59.184] Starting peer-to-peer node instance=Geth/v1.8.16-unstable/darwin-amd64/go1.11.2


I have installed following packages needed by Rich Go extension:



go get -u github.com/derekparker/delve/cmd/dlv
go get -u -v github.com/nsf/gocode
go get -u -v github.com/rogpeppe/godef
go get -u -v github.com/golang/lint/golint
go get -u -v github.com/lukehoban/go-outline
go get -u -v sourcegraph.com/sqs/goreturns
go get -u -v golang.org/x/tools/cmd/gorename
go get -u -v github.com/tpng/gopkgs
go get -u -v github.com/newhook/go-symbols
go get -u -v golang.org/x/tools/cmd/guru


Any help would be greatly appreciated.
Thanks










share|improve this question


























    0















    I am trying to debug go-ethereum code inside the Visual Studio Code. So far I was able to build debug version of binaries by modifying the Makefile and run the project inside the VS Code with "Rich Go" extension installed.



    Entry to the MakeFile:



    debug:
    # https://ethereum.stackexchange.com/questions/41489/how-to-debug-geth-with-delve?rq=1
    @echo building debug version
    build/env.sh go build -o ./build/bin/geth -gcflags=all='-N -l' -v ./cmd/geth
    @echo end building debug version
    @echo "Run "$(GOBIN)/geth" to launch geth."


    My launch.json file is:



     
    "name": "Launch",
    "type": "go",
    "request": "launch",
    "mode": "exec",
    "trace": "verbose",
    "remotePath": "$workspaceRoot",
    "port": 2345,
    "host": "127.0.0.1",
    "program": "$workspaceRoot/build/bin/geth",
    "sources": "$workspaceRoot",
    "args": [

    ],
    "showLog": true
    ,


    I am able to run the project inside the Visual Studio Code but all breakpoints are ignored.



    Creating on: /Users/work/go/efsn/core/blockchain.go (/Users/work/go/efsn/core/blockchain.go) :256
    Error on CreateBreakpoint: could not find /Users/work/go/efsn/core/blockchain.go:256


    This is printout from my debug console:



    Verbose logs are written to:
    /var/folders/f0/8kqy01l55s3f5b642wc2w47w0000gp/T/vscode-go-debug.txt
    10:18:57 AM, 11/14/2018
    InitializeRequest
    InitializeResponse
    Using GOPATH: /Users/work/go
    Current working directory: /Users/work/go/efsn/build/bin
    Running: /Users/work/go/bin/dlv exec /Users/work/go/efsn/build/bin/geth --headless=true --listen=127.0.0.1:2345 --api-version=2 --log=true --
    API server listening at: 127.0.0.1:2345
    time="2018-11-14T10:18:57-05:00" level=info msg="launching process with args: [/Users/work/go/efsn/build/bin/geth]" layer=debugger
    InitializeEvent
    SetBreakPointsRequest
    All cleared
    Creating on: /Users/work/go/efsn/core/blockchain.go (/Users/work/go/efsn/core/blockchain.go) :256
    Error on CreateBreakpoint: could not find /Users/work/go/efsn/core/blockchain.go:256
    All set:[null]
    SetBreakPointsResponse
    ConfigurationDoneRequest
    ContinueRequest
    ContinueResponse
    time="2018-11-14T10:18:58-05:00" level=debug msg=continuing layer=debugger
    INFO [11-14|10:18:59.171] Maximum peer count ETH=25 LES=0 total=25
    INFO [11-14|10:18:59.184] Starting peer-to-peer node instance=Geth/v1.8.16-unstable/darwin-amd64/go1.11.2


    I have installed following packages needed by Rich Go extension:



    go get -u github.com/derekparker/delve/cmd/dlv
    go get -u -v github.com/nsf/gocode
    go get -u -v github.com/rogpeppe/godef
    go get -u -v github.com/golang/lint/golint
    go get -u -v github.com/lukehoban/go-outline
    go get -u -v sourcegraph.com/sqs/goreturns
    go get -u -v golang.org/x/tools/cmd/gorename
    go get -u -v github.com/tpng/gopkgs
    go get -u -v github.com/newhook/go-symbols
    go get -u -v golang.org/x/tools/cmd/guru


    Any help would be greatly appreciated.
    Thanks










    share|improve this question
























      0












      0








      0








      I am trying to debug go-ethereum code inside the Visual Studio Code. So far I was able to build debug version of binaries by modifying the Makefile and run the project inside the VS Code with "Rich Go" extension installed.



      Entry to the MakeFile:



      debug:
      # https://ethereum.stackexchange.com/questions/41489/how-to-debug-geth-with-delve?rq=1
      @echo building debug version
      build/env.sh go build -o ./build/bin/geth -gcflags=all='-N -l' -v ./cmd/geth
      @echo end building debug version
      @echo "Run "$(GOBIN)/geth" to launch geth."


      My launch.json file is:



       
      "name": "Launch",
      "type": "go",
      "request": "launch",
      "mode": "exec",
      "trace": "verbose",
      "remotePath": "$workspaceRoot",
      "port": 2345,
      "host": "127.0.0.1",
      "program": "$workspaceRoot/build/bin/geth",
      "sources": "$workspaceRoot",
      "args": [

      ],
      "showLog": true
      ,


      I am able to run the project inside the Visual Studio Code but all breakpoints are ignored.



      Creating on: /Users/work/go/efsn/core/blockchain.go (/Users/work/go/efsn/core/blockchain.go) :256
      Error on CreateBreakpoint: could not find /Users/work/go/efsn/core/blockchain.go:256


      This is printout from my debug console:



      Verbose logs are written to:
      /var/folders/f0/8kqy01l55s3f5b642wc2w47w0000gp/T/vscode-go-debug.txt
      10:18:57 AM, 11/14/2018
      InitializeRequest
      InitializeResponse
      Using GOPATH: /Users/work/go
      Current working directory: /Users/work/go/efsn/build/bin
      Running: /Users/work/go/bin/dlv exec /Users/work/go/efsn/build/bin/geth --headless=true --listen=127.0.0.1:2345 --api-version=2 --log=true --
      API server listening at: 127.0.0.1:2345
      time="2018-11-14T10:18:57-05:00" level=info msg="launching process with args: [/Users/work/go/efsn/build/bin/geth]" layer=debugger
      InitializeEvent
      SetBreakPointsRequest
      All cleared
      Creating on: /Users/work/go/efsn/core/blockchain.go (/Users/work/go/efsn/core/blockchain.go) :256
      Error on CreateBreakpoint: could not find /Users/work/go/efsn/core/blockchain.go:256
      All set:[null]
      SetBreakPointsResponse
      ConfigurationDoneRequest
      ContinueRequest
      ContinueResponse
      time="2018-11-14T10:18:58-05:00" level=debug msg=continuing layer=debugger
      INFO [11-14|10:18:59.171] Maximum peer count ETH=25 LES=0 total=25
      INFO [11-14|10:18:59.184] Starting peer-to-peer node instance=Geth/v1.8.16-unstable/darwin-amd64/go1.11.2


      I have installed following packages needed by Rich Go extension:



      go get -u github.com/derekparker/delve/cmd/dlv
      go get -u -v github.com/nsf/gocode
      go get -u -v github.com/rogpeppe/godef
      go get -u -v github.com/golang/lint/golint
      go get -u -v github.com/lukehoban/go-outline
      go get -u -v sourcegraph.com/sqs/goreturns
      go get -u -v golang.org/x/tools/cmd/gorename
      go get -u -v github.com/tpng/gopkgs
      go get -u -v github.com/newhook/go-symbols
      go get -u -v golang.org/x/tools/cmd/guru


      Any help would be greatly appreciated.
      Thanks










      share|improve this question














      I am trying to debug go-ethereum code inside the Visual Studio Code. So far I was able to build debug version of binaries by modifying the Makefile and run the project inside the VS Code with "Rich Go" extension installed.



      Entry to the MakeFile:



      debug:
      # https://ethereum.stackexchange.com/questions/41489/how-to-debug-geth-with-delve?rq=1
      @echo building debug version
      build/env.sh go build -o ./build/bin/geth -gcflags=all='-N -l' -v ./cmd/geth
      @echo end building debug version
      @echo "Run "$(GOBIN)/geth" to launch geth."


      My launch.json file is:



       
      "name": "Launch",
      "type": "go",
      "request": "launch",
      "mode": "exec",
      "trace": "verbose",
      "remotePath": "$workspaceRoot",
      "port": 2345,
      "host": "127.0.0.1",
      "program": "$workspaceRoot/build/bin/geth",
      "sources": "$workspaceRoot",
      "args": [

      ],
      "showLog": true
      ,


      I am able to run the project inside the Visual Studio Code but all breakpoints are ignored.



      Creating on: /Users/work/go/efsn/core/blockchain.go (/Users/work/go/efsn/core/blockchain.go) :256
      Error on CreateBreakpoint: could not find /Users/work/go/efsn/core/blockchain.go:256


      This is printout from my debug console:



      Verbose logs are written to:
      /var/folders/f0/8kqy01l55s3f5b642wc2w47w0000gp/T/vscode-go-debug.txt
      10:18:57 AM, 11/14/2018
      InitializeRequest
      InitializeResponse
      Using GOPATH: /Users/work/go
      Current working directory: /Users/work/go/efsn/build/bin
      Running: /Users/work/go/bin/dlv exec /Users/work/go/efsn/build/bin/geth --headless=true --listen=127.0.0.1:2345 --api-version=2 --log=true --
      API server listening at: 127.0.0.1:2345
      time="2018-11-14T10:18:57-05:00" level=info msg="launching process with args: [/Users/work/go/efsn/build/bin/geth]" layer=debugger
      InitializeEvent
      SetBreakPointsRequest
      All cleared
      Creating on: /Users/work/go/efsn/core/blockchain.go (/Users/work/go/efsn/core/blockchain.go) :256
      Error on CreateBreakpoint: could not find /Users/work/go/efsn/core/blockchain.go:256
      All set:[null]
      SetBreakPointsResponse
      ConfigurationDoneRequest
      ContinueRequest
      ContinueResponse
      time="2018-11-14T10:18:58-05:00" level=debug msg=continuing layer=debugger
      INFO [11-14|10:18:59.171] Maximum peer count ETH=25 LES=0 total=25
      INFO [11-14|10:18:59.184] Starting peer-to-peer node instance=Geth/v1.8.16-unstable/darwin-amd64/go1.11.2


      I have installed following packages needed by Rich Go extension:



      go get -u github.com/derekparker/delve/cmd/dlv
      go get -u -v github.com/nsf/gocode
      go get -u -v github.com/rogpeppe/godef
      go get -u -v github.com/golang/lint/golint
      go get -u -v github.com/lukehoban/go-outline
      go get -u -v sourcegraph.com/sqs/goreturns
      go get -u -v golang.org/x/tools/cmd/gorename
      go get -u -v github.com/tpng/gopkgs
      go get -u -v github.com/newhook/go-symbols
      go get -u -v golang.org/x/tools/cmd/guru


      Any help would be greatly appreciated.
      Thanks







      debugging visual-studio-code ethereum go-ethereum geth






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 14 '18 at 16:03









      user3795909user3795909

      11




      11






















          0






          active

          oldest

          votes











          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53304300%2fbreakpoints-ignored-when-debugging-ethereum-go-in-visual-studio-code-with-rich-g%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53304300%2fbreakpoints-ignored-when-debugging-ethereum-go-in-visual-studio-code-with-rich-g%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Darth Vader #20

          How to how show current date and time by default on contact form 7 in WordPress without taking input from user in datetimepicker

          Ondo