Mohit
Mohit

Reputation: 2100

modifying the cscope DB so that file path can be relative to new sandbox

How can I change the paths stored in cscope.out to point to another sandbox. It has absolute path and text based replace doesn't work as cscope has some compressing logic for the DB. I cannot change the generation process of the cscope DB as it is done by someone else. I can copy it and modify the copy.

I want to use cscope for my large project. My development setup is such that I sync some of the desired code modules from p4 central depo on my local machine and work only on those modules. There will always be a cscope.out pre-generated kept in the central depo that I can use to search for the symbol/files in that central depo. I use that central cscope.out and I don't have any problem in using that. To navigate to a particular file I have to change the initial path from the central depot to my local sandbox

But, now I want that cscope.out to have paths of my local sandbox so that I can navigate to my sandbox files directly.

I have tried reading cscope.out line by line. If the line has old central depot address I will replace it with my new sandbox. If the file exists in my new sandbox then I will update the file path otherwise I will keep the old one. This logic didn't work as cscope.out is compressed and encoding is unknown.

Upvotes: 0

Views: 18

Answers (0)

Related Questions