#41 No way to interrupt search

closed
nobody
None
5
2012-11-30
2012-05-17
Bill Lash
No

Now that control-c is used to switch between caseless mode and non-caseless mode, it seems that there is no way to interrupt a search. Sometimes when working on a large codebase I'll do an ill-advised search only to have to wait for about 5 minutes for the search to complete, or killing off the terminal that I am running it in and starting another.

I am including a patch that exits raw mode for the duration of the search, and re-enters raw mode at the end of the search. This allows control-c to intterupt the search, but if control-c is pressed at other times, it still toggles caseless mode.

Discussion

  • Bill Lash
    Bill Lash
    2012-05-17

    patch to allow interrupt of search

     
    Attachments
  • I don't particularly like that idea. Having the same key mean different things at different times, particularly when those times can be very hard to tell apart, seems like the wrong solution to this problem.

    Anyway, I wonder how you would manage for any cscope search to take 5 minutes on a current-day machine. Even a full-text search on a rather big source tree with a rididulously large result set didn't take this long here.

     
  • Bill Lash
    Bill Lash
    2012-05-21

    I understand the concern about "overloading" ctrl-c. Personally I would prefer some other key to change the case sensitivity, and ctrl-c to interrupt the current action, but I'm sure that some others prefer the caseless mode switch behavior.

    After reading your response I think that the issue with the very lon search time (possibly infinite) is because I use the -q option to build the database to speed up searches. However, it seems that if the database is large enough, searching for something like ".*" keeps getting slower and slower.

    Do you see long search times when using -q. For an open source project that shows the long search times, I can see lonng search times with mame version 0.145, however it does have C++ code, and searches seem to crash when not using the inverted database. (I tracked down one of the crashse to the file dc.h, and it seems to put a spurious "}" in the database, and then the search will crash. I'm not a lex expert, but I think there is something that gets confused by the class definition in that file.

     
  • -q mode by itself should never make any search take _longer_.

    A '.*' search on a big database, OTOH, will always take quite a while --- you are, after all, (using a rather overly complicated way of) producing a full copy of the entire database into the result temp file. That cannot be good.

    But yes, something does seem to be wrong with

    cscope -qR -L1 '.*'

    , particularly on databases that have some internal problems. But that's really a story for a new bug entry.

     
  • Bill Lash
    Bill Lash
    2012-05-23

    I agree that the long search time is a different issue. I will say that I not only see it with .* searches, but also things like ".*i.*"

    I've tried to track the issue down. but haven't been able to figure it out. I thought it might be the large number of reallocs in boolfile, but I don't think that is it.

     
    • status: open --> closed