Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8919769
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T06:06:28+00:00 2026-06-15T06:06:28+00:00

I have created a lex file test.l and create lex.yy.c from it, which I

  • 0

I have created a lex file test.l and create lex.yy.c from it, which I then compile with gcc -g flags

I am linking it and I dont have a problem compiling the rest of my code which makes the call to yylex(), however, in GDB i dont seem to be able to dive on the call to yylex().

What am I doing wrong? I put breakpoints in the yylex() method itself, and this causes gdb to stop on my call to yylex() but never inside the function.

Do I need to compile the -l library with debug symbols or something?

I know it is running because i created my lex.yy.c file with -d, so I see the output of accepting tokens and whatnot.

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T06:06:30+00:00Added an answer on June 15, 2026 at 6:06 am

    I think you are falling foul of the fact that lex, or at least flex, uses the #line directive to set the file that is used for errors, and symbolic debugging, to the .l file that the .c file was created from. You’ll need to set the breakpoints in the .l file or use the -L option to instruct flex not to use the #line directive.

    GDB requires the file name that appeared in the #line directive when setting breakpoints. If you manually converted the .l file to a .c file then this is probably what you used on the command line. If the conversion was done implicitly by make then it’s just the basename of the .l file (without the folders).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created 3 classes as following Ext.mine.TextParent - Inherting from Textfield Ext.mine.child.TextChildA -
I have created a dialog and got a problem that only part of the
I have created a little program that reads in a Java file and feeds
I have created a Resource File as App.rrc(Root)and App_fr.rrc under App.rrh(header file) and have
We have created a .NET 4 web service, which runs fine on a Windows
Have created a ATL COM project through which I am inserting Menu Items to
I have a C header file that I have precompiled using the gcc -E
I am using Lex/Bison to create a simple scripting language which translates into C.
I have created a bar chart which is a improvement of bar graph on
I have an experimental flex source file(lex.l): %option noyywrap %{ int chars = 0;

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.