0

I am using Eclipse gdb to debug c++ code.When step into yyparse() which is actually go thru flex and bison it happen

Can't find a source file at "eqv_yacc.tab.c" Locate the file or edit the source lookup path to include its location.

However thr is no longer the file eqv__yacc.tab.c there is only eqv_yacc.c.the name has been changed in my makefile.How can I solve this to point to eqv_yacc.c instead of need the debugger to find eqv_yacc.tab.c?anyone face the same problem before?

Makefile code:

eqv_yacc.C: 
eqv_yacc.y $(YACC) $(YFLAGS) eqv_yacc.y 
sed s/yy/eqvyy/g eqv_yacc.tab.c > eqv_yacc.C 
sed s/yy/eqvyy/g eqv_yacc.tab.h > eqvy.tab.H 
$(RM) eqv_yacc.tab.h 
$(RM) eqv_yacc.tab.c 
3
  • 1
    Is there a reason you rename the file in the Makefile? If you use e.g. bison then it have an option -o to name the output file (see the bison manual page), maybe you might want to use that instead. Commented Sep 24, 2013 at 7:37
  • You don't debug code with Eclipse (which is mostly an editor, with some graphical frontends to utilities like compilers, debuggers, ...). You debug code with gdb. And you should show your Makefile rule building eqv_yacc.c. Please edit your question to show that. Commented Sep 24, 2013 at 7:38
  • hi @BasileStarynkevitch This is what i found in the makefile.the makefile was written by others.I have no idea why they change name and remove the file. eqv_yacc.C: eqv_yacc.y $(YACC) $(YFLAGS) eqv_yacc.y sed s/yy/eqvyy/g eqv_yacc.tab.c > eqv_yacc.C sed s/yy/eqvyy/g eqv_yacc.tab.h > eqvy.tab.H $(RM) eqv_yacc.tab.h $(RM) eqv_yacc.tab.c Commented Sep 24, 2013 at 7:41

1 Answer 1

1

Those sed commands are for replacing all instances of yy with eqvyy. You could add on to that to replace names in the source file as well:

sed s/yy/eqvyy/g eqv_yacc.tab.c | sed s/eqv_yacc\.tab\.c/eqv_yacc.c/g > eqv_yacc.C
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.