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

RE: Can't add cscope connection

Expand Messages
  • Khorev Sergey
    Which of the cscopes flying around are you using? Operating system? Can you make repeatable test case? If not, use debugger to reveal stack trace on the call
    Message 1 of 11 , Feb 2, 2004
    • 0 Attachment
      Which of the cscopes flying around are you using?
      Operating system?
      Can you make repeatable test case?
      If not, use debugger to reveal stack trace on the call to cs_reading_emsg()

      --
      Sergey Khorev
      http://iamphet.nm.ru
      ROS: Return On Shield
      -- New Opcode
    • David Rennalls
      ... I did some quick stepping to find out where exactly it s failing. Basically it s in cs_read_prompt, in if_cscope.c line 1989. There s a while loop that
      Message 2 of 11 , Feb 6, 2004
      • 0 Attachment
        Khorev Sergey wrote:
        > Which of the cscopes flying around are you using?
        > Operating system?
        > Can you make repeatable test case?
        > If not, use debugger to reveal stack trace on the call to cs_reading_emsg()
        >
        I did some quick stepping to find out where exactly it's failing.
        Basically it's in cs_read_prompt, in if_cscope.c line 1989. There's a
        while loop that seems to be used to skip over the the ">> "
        cscope prompt.
        ....
        while ((ch = getc(csinfo[i].fr_fp)) != EOF && ch != CSCOPE_PROMPT[0])
        ....

        But it's getting EOF from the getc on the first iteration. So further
        down the check on line 2024 ...if (ch == EOF)... is failing. After the
        failing call to getc csinfo[i].fr_fp._flag is 0x19. I don't have time to
        debug further right now but hopefully that helps.
        The debug version I built is 6.2.238.

        cs_read_prompt(int 0x00000000) line 1989
        cs_add_common(char * 0x010de8c7, char * 0x00000000, char * 0x00000000)
        line 519 + 26 bytes
        cs_add(exarg * 0x0012f880) line 397 + 17 bytes
        do_cscope_general(exarg * 0x0012f880, int 0x00000000) line 131 + 10 bytes
        do_cscope(exarg * 0x0012f880) line 141 + 11 bytes
        do_one_cmd(unsigned char * * 0x0012f9b4, int 0x00000000, condstack *
        0x0012f9c0, unsigned char * (int, void *, int)* 0x004465b8
        getexline(int, void *, int), void * 0x00000000) line 2444 + 16 bytes
        do_cmdline(unsigned char * 0x00000000, unsigned char * (int, void *,
        int)* 0x004465b8 getexline(int, void *, int), void * 0x00000000, int
        0x00000000) line 977 + 40 bytes
        nv_colon(cmdarg * 0x0012fc54) line 4629 + 29 bytes
        normal_cmd(oparg * 0x0012fcb4, int 0x00000001) line 1108 + 16 bytes
        main_loop(int 0x00000000) line 2135 + 11 bytes
        VimMain() line 1953 + 7 bytes
        WinMain(HINSTANCE__ * 0x00400000, HINSTANCE__ * 0x00000000, char *
        0x00132f7f, int 0x00000001) line 125 + 14 bytes
        WinMainCRTStartup() line 198 + 54 bytes
        KERNEL32! 7c5987e7()
        z
        - David
      • Gary Johnson
        ... The :version output from your original post indicated that you were using Windows, and the stack trace below indicates that that s still the case. ...
        Message 3 of 11 , Feb 6, 2004
        • 0 Attachment
          On 2004-02-06, David Rennalls <drennalls@...> wrote:
          > Khorev Sergey wrote:
          > >Which of the cscopes flying around are you using?
          > >Operating system?

          The :version output from your original post indicated that you were
          using Windows, and the stack trace below indicates that that's still
          the case.

          > >Can you make repeatable test case?
          > >If not, use debugger to reveal stack trace on the call to cs_reading_emsg()
          > >
          > I did some quick stepping to find out where exactly it's failing.
          > Basically it's in cs_read_prompt, in if_cscope.c line 1989. There's a
          > while loop that seems to be used to skip over the the ">> "
          > cscope prompt.
          > ....
          > while ((ch = getc(csinfo[i].fr_fp)) != EOF && ch != CSCOPE_PROMPT[0])
          > ....
          >
          > But it's getting EOF from the getc on the first iteration. So further
          > down the check on line 2024 ...if (ch == EOF)... is failing. After the
          > failing call to getc csinfo[i].fr_fp._flag is 0x19. I don't have time to
          > debug further right now but hopefully that helps.
          > The debug version I built is 6.2.238.
          >
          > cs_read_prompt(int 0x00000000) line 1989
          > cs_add_common(char * 0x010de8c7, char * 0x00000000, char * 0x00000000)
          > line 519 + 26 bytes
          > cs_add(exarg * 0x0012f880) line 397 + 17 bytes
          > do_cscope_general(exarg * 0x0012f880, int 0x00000000) line 131 + 10 bytes
          > do_cscope(exarg * 0x0012f880) line 141 + 11 bytes
          > do_one_cmd(unsigned char * * 0x0012f9b4, int 0x00000000, condstack *
          > 0x0012f9c0, unsigned char * (int, void *, int)* 0x004465b8
          > getexline(int, void *, int), void * 0x00000000) line 2444 + 16 bytes
          > do_cmdline(unsigned char * 0x00000000, unsigned char * (int, void *,
          > int)* 0x004465b8 getexline(int, void *, int), void * 0x00000000, int
          > 0x00000000) line 977 + 40 bytes
          > nv_colon(cmdarg * 0x0012fc54) line 4629 + 29 bytes
          > normal_cmd(oparg * 0x0012fcb4, int 0x00000001) line 1108 + 16 bytes
          > main_loop(int 0x00000000) line 2135 + 11 bytes
          > VimMain() line 1953 + 7 bytes
          > WinMain(HINSTANCE__ * 0x00400000, HINSTANCE__ * 0x00000000, char *
          > 0x00132f7f, int 0x00000001) line 125 + 14 bytes
          > WinMainCRTStartup() line 198 + 54 bytes
          > KERNEL32! 7c5987e7()
          > z

          That's where I thought it was failing--it's good to have this
          confirmation. cs_add_common() calls cs_read_prompt() right after it
          calls cs_create_connection() at line 518 of if_cscope.c. It seems
          to me that the likely thing that's failing is the call to spawnlp()
          at either line 875 or 877. I say that because I think that's the
          part of cs_add_common() that's most sensitive to your environment.
          If the problem was in the cs_add_common() code itself, I would
          expect Sergey or another Windows user to have had problems before
          now. However, I don't have cscope on my Windows machine and I know
          zilch about Windows task management or interprocess communications,
          so I don't know how to figure out why launching cscope from
          spawnlp() seems to fail while launching it from the command line
          works. I'm sure Sergey can provide a lot more insight here.

          HTH,
          Gary

          --
          Gary Johnson | Agilent Technologies
          garyjohn@... | Wireless Division
          | Spokane, Washington, USA
        Your message has been successfully submitted and would be delivered to recipients shortly.