Loading ...
Sorry, an error occurred while loading the content.

RE: remote debugging ideas for vimscripts

Expand Messages
  • Bram Moolenaar
    ... Thanks for figuring it out this far. It s really a problem of the event handling doing something unexpected. It is not obvious how this should be fixed.
    Message 1 of 5 , Jul 2, 2003
    • 0 Attachment
      Michael Geddes wrote:

      > This is getting a bit gnarly, so I'll let somebody who has had more
      > experience with this area have a go.
      >
      > I've found the basic reason for the problem, which is that within
      > do_debug, it is doing an 'inchar' passing a pointer indexing into the
      > global typebuf.tb_buf ... the problem is then that when you send a
      > message via remote_send, this calls 'server_to_input_buf' which calls
      > 'ins_typebuf' which frees the memory pointed to by typebuf.tb_buf.
      >
      > Then when the original gui_mch_wait_for_chars returns, the 'buf'
      > pointer passed in is pointing at freed memory.
      >
      > I believe this bug could happen in the normal remote_send (not in
      > debug), but in this case, it appears to always reach the 'simple' case
      > where there is enough room in the type-ahead buffer.
      >
      > (Steps to reproduce are still the same as the original mail in this
      > thread - the second case).

      Thanks for figuring it out this far. It's really a problem of the event
      handling doing something unexpected. It is not obvious how this should
      be fixed. I'll add a remark in the todo list.

      --
      Eight Megabytes And Continually Swapping.

      /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
      /// Creator of Vim - Vi IMproved -- http://www.Vim.org \\\
      \\\ Project leader for A-A-P -- http://www.A-A-P.org ///
      \\\ Help AIDS victims, buy here: http://ICCF-Holland.org/click1.html ///
    • Bram Moolenaar
      ... That makes sense in most situations, but what if the user really wants to debug the commands being send remotely? -- The psychic said, God bless you. I
      Message 2 of 5 , Jul 2, 2003
      • 0 Attachment
        Michael Geddes wrote:

        > I think the remote debugging idea is quite kool.. so I've done a bit of
        > digging.
        >
        > As a start, I suggest that we turn off debug mode and redir_off at
        > the start of the message handler for remote_expr() on the server and
        > restore them at the end.

        That makes sense in most situations, but what if the user really wants
        to debug the commands being send remotely?

        --
        The psychic said, "God bless you." I said, "I didn't sneeze." She
        looked deep into my eyes and said, "You will, eventually." And, damn
        if she wasn't right. Two days later, I sneezed. --Ellen Degeneres

        /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
        /// Creator of Vim - Vi IMproved -- http://www.Vim.org \\\
        \\\ Project leader for A-A-P -- http://www.A-A-P.org ///
        \\\ Help AIDS victims, buy here: http://ICCF-Holland.org/click1.html ///
      • Michael Geddes
        That works. Even with this patch, if you :breakadd the function being called, then it will break back into the debugger as expected (very nice, I thought)! We
        Message 3 of 5 , Jul 2, 2003
        • 0 Attachment
          That works.

          Even with this patch, if you :breakadd the function being called, then
          it will break back into the debugger as expected (very nice, I thought)!

          We could always add support for doing
          :breakadd func remote_expr
          that would cause the debugger to run on any remote_expr, which would
          then go into debug mode whether we were in debug mode originally or not!
          This, I believe, would be MUCH prefereable.

          //.ichael G.

          -----Original Message-----
          From: Bram Moolenaar [mailto:Bram@...]
          Sent: Thursday, 3 July 2003 6:15 AM
          To: Michael Geddes
          Cc: Hari Krishna Dara; Vim-dev@...
          Subject: RE: remote debugging ideas for vimscripts



          Michael Geddes wrote:

          > I think the remote debugging idea is quite kool.. so I've done a bit
          > of digging.
          >
          > As a start, I suggest that we turn off debug mode and redir_off at
          > the start of the message handler for remote_expr() on the server and
          > restore them at the end.

          That makes sense in most situations, but what if the user really wants
          to debug the commands being send remotely?

          --
          The psychic said, "God bless you." I said, "I didn't sneeze." She
          looked deep into my eyes and said, "You will, eventually." And, damn if
          she wasn't right. Two days later, I sneezed. --Ellen Degeneres

          /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net
          \\\
          /// Creator of Vim - Vi IMproved -- http://www.Vim.org
          \\\
          \\\ Project leader for A-A-P -- http://www.A-A-P.org
          ///
          \\\ Help AIDS victims, buy here: http://ICCF-Holland.org/click1.html
          ///
        Your message has been successfully submitted and would be delivered to recipients shortly.