Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

if: Cscope database generation failed, exit code=127 #14

Open
c02y opened this issue Oct 10, 2018 · 8 comments
Open

if: Cscope database generation failed, exit code=127 #14

c02y opened this issue Oct 10, 2018 · 8 comments

Comments

@c02y
Copy link

c02y commented Oct 10, 2018

When I use rscope function such as rscope-find-global-definition or directly call rscope-regenerate-databse, it says:

if: Cscope database generation failed, exit code=127

The readme file says:

You can experiment by :
    1. Have a cscope database generated somewhere

You mean I have to manually generate database outside of Emacs?

OK, I tried to manually generate database, and I tried to call rscope-regenerate-databse to regenerate database, it says "Cscope database generation failed, exit code=127" too.

Is this a bug or defined like this?

@rjarzmik
Copy link
Owner

Euh no, it should be like that.
Could you tell me if cscope works in your Emacs, ie. do a :
M-:
(start-process "rscope-buf" "rscope-buf" "cscope")

Is a buffer named "rscope-buf" spawned ?

And no, the database can be automatically generated within emacs if one of the automatic hooks matches (ie. there is a .git directory, a configure.ac file or an existing cscope.out)

@c02y
Copy link
Author

c02y commented Oct 12, 2018

  1. Of course cscope works in my Emacs, I'm currently using xcscope

After I disabled xcscope, enabled rscope and tried

M-: (start-process "rscope-buf" "rscope-buf" "cscope")

a buffer named “rscope-buf” is spawned, but the buffer's size is 41k, the buffer contains a lot of blanks, and multiple repeated string like:

Cscope version: 15.8b
Press ? key for help

I don't think the content of this buffer is normal, containing a lot of blanks and it's size is too big.

  1. OK, function "rscope-find-global-definition" works now and it created cscope.out file automatically inside the current directory of the buffer, but if I delete or do not delete that cscope.out file and then call "rscope-regenerate-databse", it still says:

     Cscope database generation failed, exit code=127
    

But what if I want to create cscope* files based on it's parent directory, such as I'm editing a file, and this file belongs to a submoduleA, the submoduleA contains .git and it is inside its parent directory, and the buffer called interfaces inside another submoduleB:

  • Parent directory
    -- .git
    -- dirC
    -- submoduleA
    --- .git
    -- submoduleB
    --- .git

So I want to create cscope* files based on Parent directory, it seems rscope cannot do this.

==============
UPDATE:
I tried rscope for a file inside dirC, it won't create cscope* file, and it says:

Cscope database generation failed, exit code=127

@rjarzmik
Copy link
Owner

Point1: I have the same result, and it is normal. That was just to be sure your cscope was working, as in your previous message you couldn't even generate a database

Point2: I created your exact layout, but added one 'toto.c' file into sbumoduleA, and one 'titi.c'. I open a dired buffer in dirC, then call 'rscope-regenerate-database' (pressing C-c s R), and it works, both '*.c' files are included in the generated cscope database.

I'm a bit confused why it doesn't work in your case...

@c02y
Copy link
Author

c02y commented Oct 12, 2018

I don't know, sometimes it works, sometimes it doesn't work.

But all I need is to rscope-regenerate-database prompt the path to create cscope database, not based on the current directory.

@rjarzmik
Copy link
Owner

Event if I still don't get why it works sometimes and not other times, what you want seems to be :
(rscope-regenerate-cscope-database "my_path")

@c02y
Copy link
Author

c02y commented Oct 13, 2018

Why not make it prompt for path?

@rjarzmik
Copy link
Owner

Because I wanted rscope to "auto-generate" the path for the lambda user, ie. use the automatic hooks, or the keyboard binding C-c s R in the right directory. For advanced users, they can type lisp evaluation and therefore don't need an interactive function.

I'm still at a loss why C-c s R in the dired buffer doesn't work 100% of the time for you. Do you have a pattern, a message or something I could try to reproduce your issue ? Is it on a Linux box or a Windows ? Is there anything specific to your environment you think of ?

@c02y
Copy link
Author

c02y commented Oct 16, 2018

Ubuntu 16.04 64-bit
No other warning or error message, just

Cscope database generation failed, exit code=127

If I execute

(rscope-regenerate-cscope-database "my_path")

I already change "my_path" to an absolute path of my project. And if failed too:

Debugger entered--Lisp error: (error "Cscope database generation failed, exit code=127.")
signal(error ("Cscope database generation failed, exit code=127."))
error("Cscope database generation failed, exit code=%d." 127)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants