Re: cscope & gvim
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix Programming > Re: cscope & gvim




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Re: cscope & gvim  
Hans-Bernhard Broeker


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-30-04 05:34 AM

Fred Ma <fma@doe.carleton.ca> wrote:
quote:
> Yes, actually I mentioned that cscope worked fine when used outside > of gvim.
That's not quite the same thing --- cscope works with an internal representation of its query results, which is quite unlikely to be broken in the way indicated here. The vim interface, OTOH, relies on the _printed_ representation of those results, which you only get to see for yourself if you run cscope in -l or -L mode. Possible gotchas here would include line breaks or blanks in the wrong places, or anything else that screws up the vim interface's parser of cscope line-mode output. Since you seemed to imply that the problem only happend sometimes, but not reliably, that's why I suggested cscope -ld output as the next thing to test. If you're worried about too public an exposure, you can still send samples to me by email. BTW: There is an open bug report from last week, posted anonymously to the cscope bug tracker about this, too. Was that you, or somebody else? That report mentioned an important additional detail: the problem only happened with vim 6.2, but not with 6.0. -- Hans-Bernhard Broeker (broeker@physik.rwth-aachen.de) Even if all the snow were burnt, ashes would remain.




[ Post a follow-up to this message ]



    Re: cscope & gvim  
Mohun Biswas


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-30-04 05:35 AM

I'm not a user of either package so this is strictly a guess, but it
sure smells like a problem caused by not handling whitespace in
pathnames correctly (a very common problem). Fred might want to take a
quick look and see if any of his files have whitespace or other special
characters.

MB






[ Post a follow-up to this message ]



    Re: cscope & gvim  
Fred Ma


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-30-04 07:36 AM

Hans-Bernhard Broeker wrote:
quote:
> > Fred Ma <fma@doe.carleton.ca> wrote: > > > That's not quite the same thing --- cscope works with an internal > representation of its query results, which is quite unlikely to be > broken in the way indicated here. > > The vim interface, OTOH, relies on the _printed_ representation of > those results, which you only get to see for yourself if you run > cscope in -l or -L mode. Possible gotchas here would include line > breaks or blanks in the wrong places, or anything else that screws up > the vim interface's parser of cscope line-mode output. Since you > seemed to imply that the problem only happend sometimes, but not > reliably, that's why I suggested cscope -ld output as the next thing > to test. If you're worried about too public an exposure, you can > still send samples to me by email. > > BTW: There is an open bug report from last week, posted anonymously to > the cscope bug tracker about this, too. Was that you, or somebody > else? That report mentioned an important additional detail: the > problem only happened with vim 6.2, but not with 6.0.
There's been alot of installation, reinstallation, upgrades, and troubleshooting lately that I really didn't remember whether I might have submitted a bug. But I found the bug report and can say with certainty that it wasn't me. I looked at the man page for -l. I'll spend a bit of time playing with it. It's probably as you say, some parsing problem with the gvim plugin. The matching list shows, but selection of a particular match causes gvim to jump to the wrong place. I will look at it tomorrow, as I have been up for a long time right now. If it comes down to it, would you mind receiving 3 longish files, as well as a description of what gvim queries give the wrong jumps? Or would you prefer not to delve into the gvim side of things? After enough of a look at it, I can submit a bug report to vim, as you suggested. Fred -- Fred Ma Dept. of Electronics, Carleton University 1125 Colonel By Drive, Ottawa, Ontario Canada, K1S 5B6




[ Post a follow-up to this message ]



    Re: cscope & gvim  
Hans-Bernhard Broeker


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-30-04 08:36 AM

Fred Ma <fma@doe.carleton.ca> wrote:
quote:
> I looked at the man page for -l. I'll spend a bit of time playing > with it. It's probably as you say, some parsing problem with the > gvim plugin. The matching list shows, but selection of a particular > match causes gvim to jump to the wrong place. I will look at it > tomorrow, as I have been up for a long time right now. If it comes > down to it, would you mind receiving 3 longish files, as well as a > description of what gvim queries give the wrong jumps?
Turns out not to be necessary --- I could reproduce a problem like that using cscope's own C source code and VIM 6.1 I found on some RedHat box. A little digging in VIM's CVS repository shows what looks like a patch exactly for this problem having been applied to VIM, recently. It's revision 1.29 of src/if_cscope.c, checked in September 2003. Indeed, plugging that version of this source file into the distributed vim62 source tarball fixes the problem for me. The problem is caused by vim trying to move tags in the currently viewed file to the top of the list, but forgetting to update the internal counts. It's a genuine internal VIM bug, unrelated to the cscope output format and VIM's parsing of it. They solved it by removing that sorting step entirely. -- Hans-Bernhard Broeker (broeker@physik.rwth-aachen.de) Even if all the snow were burnt, ashes would remain.




[ Post a follow-up to this message ]



    Re: cscope & gvim  
Fred Ma


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-31-04 12:33 AM

Hans-Bernhard Broeker wrote:
quote:
> > Fred Ma <fma@doe.carleton.ca> wrote: > > > I could reproduce a problem like > that using cscope's own C source code and VIM 6.1 I found on some > RedHat box. > > A little digging in VIM's CVS repository shows what looks like a patch > exactly for this problem having been applied to VIM, recently. It's > revision 1.29 of src/if_cscope.c, checked in September 2003. Indeed, > plugging that version of this source file into the distributed vim62 > source tarball fixes the problem for me. > > The problem is caused by vim trying to move tags in the currently > viewed file to the top of the list, but forgetting to update the > internal counts. It's a genuine internal VIM bug, unrelated to the > cscope output format and VIM's parsing of it. They solved it by > removing that sorting step entirely.
I checked the vim 6.2 patches (and installed gnu patch utility, since the solaris patch seems to be unable to process the vim patches). I applied the patches in the specified vim build directory. The "make" step stops with fatal errors, so I untarred the entire vim source from the originally downloaded tarball. Then I ran configure, applied the patches, and reran "make". Same errors. I'll search the vim mailing list before either posting to comp.editors or the vim list. Thanks for pointing out the patches. Fred -- Fred Ma Dept. of Electronics, Carleton University 1125 Colonel By Drive, Ottawa, Ontario Canada, K1S 5B6




[ Post a follow-up to this message ]



    Re: cscope & gvim  
Fred Ma


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-31-04 03:34 AM

Fred Ma wrote:
quote:
> > I checked the vim 6.2 patches (and installed gnu patch > utility, since the solaris patch seems to be unable to > process the vim patches). I applied the patches in the > specified vim build directory. The "make" step stops > with fatal errors, so I untarred the entire vim source > from the originally downloaded tarball. Then I ran > configure, applied the patches, and reran "make". Same > errors. I'll search the vim mailing list before either > posting to comp.editors or the vim list. Thanks for > pointing out the patches.
Hans-Bernhard, It worked. I had to remove the build directory, unpack the tarball, run configure, and then run only the patches related to cscope. These I picked from the patches README file. Thanks alot for your help. Now it's time to follow up on my posts at comp.editors and vim user mailing list (can't remember if cscope had a list, but I'll check). Fred -- Fred Ma Dept. of Electronics, Carleton University 1125 Colonel By Drive, Ottawa, Ontario Canada, K1S 5B6




[ Post a follow-up to this message ]



    Re: cscope & gvim  
Fred Ma


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-31-04 04:34 AM

Mohun Biswas wrote:
quote:
> > I'm not a user of either package so this is strictly a guess, but it > sure smells like a problem caused by not handling whitespace in > pathnames correctly (a very common problem). Fred might want to take a > quick look and see if any of his files have whitespace or other special > characters. > > MB
Mohun, Thanks for the suggestion. Hans-Bernhard found a vim patch that fixed the problem. I installed all vim6.2 patches that had anything to do with cscope, then rebuilt gvim. Just as a note, it took several tries. In the end, build errors were avoided by not running all 6.2 patches (just the ones related to cscope), as well as erasing the build directory and unpacking it anew. The patches were applied after running "configure" (with --enable-cscope, of course). I haven't run into the problem since (recall that the problem was that I was warped to the wrong occurance of the matching list for a cscope query). Fred -- Fred Ma Dept. of Electronics, Carleton University 1125 Colonel By Drive, Ottawa, Ontario Canada, K1S 5B6




[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 09:49 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register