rjarzmik / rscope

Reborn cscope extension for emacs
GNU General Public License v2.0
9 stars 7 forks source link

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

Open c02y opened 6 years ago

c02y commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago
  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:

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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

Why not make it prompt for path?

rjarzmik commented 6 years ago

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 commented 6 years ago

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)