help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Exploring a code base?


From: Eli Zaretskii
Subject: Re: Exploring a code base?
Date: Sat, 07 Nov 2020 16:47:46 +0200

> Date: Sat, 07 Nov 2020 14:33:25 +0000
> From: Gregory Heytings <ghe@sdf.org>
> cc: help-gnu-emacs@gnu.org
> 
> > Basically, I'm asking why having a flat list of all the users of a data 
> > type, and reading the code of all of them, is not enough for this kind 
> > of job?  What am I missing?
> 
> IIUC, Yuri, Stefan and Dmitry all described the same problem, each with 
> their own words

I've read the entire thread, thank you.

>                 using M-. and M-? works fine for simple tasks (say, 
> change the name of a given function or struct field in a codebase, or see 
> where a given type is used), but when you are tackling a more complex task 
> you often have to put searches on a kind of "stack", on which you can save 
> your current search state, and from which you can resume your current 
> search at a later stage. Say, you are making changes to the occurrences of 
> "foo", and at some point during that work you see that you need to change 
> something around the occurrences of "bar", and at some point during that 
> work you see that you need to change the occurrences of "baz", and so 
> forth.

When that happens, it means you should change the search criteria.
For example, if you looked for a variable, but found that more than
one variable is involved, you need to search for the data type (if all
the variables use the same data type), or search for several
identifiers instead of just one.  the tools mentioned all support such
multiple searches, so I still don't think I understand the problem.

I used this technique in some pretty complex projects (as in: about 1
million code lines of sophisticated C++), and it scaled well.

As for discovering that a problem includes more places and symbols
than one originally envisioned: one can maintain a flat list of
functions/modules/whatever to look into, and add to that as more stuff
is being found.  You can do it in Org or even in a simple text buffer.
If there's really a need to maintain some structure, one can use Org's
level headings to that end.

Bottom line: I still don't see the problem, and my question above
still stands.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]