public inbox for sourcenav@sourceware.org
 help / color / mirror / Atom feed
* No grep module?
@ 2002-02-22 16:16 Mo DeJong
  2002-02-23 15:35 ` Tom Tromey
  0 siblings, 1 reply; 3+ messages in thread
From: Mo DeJong @ 2002-02-22 16:16 UTC (permalink / raw)
  To: sourcenav

I was just poking around in the Windows build and I noticed that it is breaking
because there is no grep module. As far as I can tell, there is no grep module
in the gdb CVSROOT or the snavigator CVSROOT on sources.redhat.com.

The src/snavigator/configure.in file assumes that grep will always need to
be built under Windows. I think this is correct since we would want a
grep.exe that does not depend on Cygwin in the snavigator/bin directoy.
After all, we want SN to work on systems that don't have Cygwin installed.

If we do want to add a grep module to support building under Windows, then
perhaps we need to upgrade to a more recent version of GNU grep. I think
we removed all the old custom grep hacks that we were using, so we should
be able to upgrade.

cheers
Mo

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: No grep module?
  2002-02-22 16:16 No grep module? Mo DeJong
@ 2002-02-23 15:35 ` Tom Tromey
  2002-02-26  0:55   ` Mo DeJong
  0 siblings, 1 reply; 3+ messages in thread
From: Tom Tromey @ 2002-02-23 15:35 UTC (permalink / raw)
  To: Mo DeJong; +Cc: sourcenav

>>>>> "Mo" == Mo DeJong <supermo@bayarea.net> writes:

Mo> If we do want to add a grep module to support building under
Mo> Windows, then perhaps we need to upgrade to a more recent version
Mo> of GNU grep. I think we removed all the old custom grep hacks that
Mo> we were using, so we should be able to upgrade.

What about hacking S-N to load files and do its own regexp matching,
thus avoiding the need for a separate grep executable?  I think in the
past grep was used for better performance.  Is it really that
significant?

Tom

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: No grep module?
  2002-02-23 15:35 ` Tom Tromey
@ 2002-02-26  0:55   ` Mo DeJong
  0 siblings, 0 replies; 3+ messages in thread
From: Mo DeJong @ 2002-02-26  0:55 UTC (permalink / raw)
  To: sourcenav

On 22 Feb 2002 17:41:54 -0700
Tom Tromey <tromey@redhat.com> wrote:

> >>>>> "Mo" == Mo DeJong <supermo@bayarea.net> writes:
> 
> Mo> If we do want to add a grep module to support building under
> Mo> Windows, then perhaps we need to upgrade to a more recent version
> Mo> of GNU grep. I think we removed all the old custom grep hacks that
> Mo> we were using, so we should be able to upgrade.
> 
> What about hacking S-N to load files and do its own regexp matching,
> thus avoiding the need for a separate grep executable?  I think in the
> past grep was used for better performance.  Is it really that
> significant?
> 
> Tom

We looked into doing that for the last release but it just was not going
to work. This time around, we are using Tcl 8.3 so we have access to
the new regexp impl that supports the following:

% regexp -all -inline -indices {oy} {
a toy is not a boy
soy is a joy
}
{4 5} {17 18} {21 22} {30 31}

We can build up a buffer the size of the file and then run regexp to find all
the match indexes. The tricky part will be how we will count newlines so
that a match index can be mapped back to the file line number.

Then there is the code in greppane.tcl to worry about. It is kind of scary the
way we run multiple greps to get around OS command line limits. Also,
we currently run another regexp over each result line so that we can
highlight the match text. This all adds up to lots of time we could save
with a Tcl based grep impl. Then there is the really nasty hack that we
use to map the file names returned from grep back to files in the project.
Then there are the PATH problems that can cause the wrong version of
grep to be run. We could really fix a lot of problems with a Tcl only version
of grep.

That said, actually getting this code written and added might not be something
that is doable for the 5.1 release. Perhaps we should just punt on a grep module
and include a grep.exe in the Windows zip file for the binaries.

Mo




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2002-02-26  8:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-02-22 16:16 No grep module? Mo DeJong
2002-02-23 15:35 ` Tom Tromey
2002-02-26  0:55   ` Mo DeJong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).