Flex generated code debugging problem
Flex generated code debugging problem
- Subject: Flex generated code debugging problem
- From: "Karan, Cem (Civ, ARL/CISD)" <email@hidden>
- Date: Sat, 26 Mar 2005 12:08:42 -0500
- Thread-topic: Flex generated code debugging problem
I've been teaching myself how to use Flex, and have run into a small
problem; I can't get gdb to set a breakpoint within the generated code
(Note that the code links and executes correctly from the terminal; gdb
just isn't happy about it)
I double checked my input file and flag options, but they all seem to be
in order. Below is what gets passed to flex and gcc.
For flex:
>>>>> file: flexDummy
%{
int numLines = 0, int numChars = 0;
%}
%%
\n ++numLines; ++numChars;
. ++numChars;
%%
int main(int argc, char *argv[])
{
yylex();
printf("# of lines = %d, # of chars = %d\n", numLines,
numChars);
}
<<<<<
$> flex flexDummy
I then copy the output of lex.yy.c into my main.c file in my XCode
project. I've set the debug symbols to all and set the extra linker
flags to -ll. So everything compiles, links, and runs fine from the
terminal, but if I try to set a breakpoint, the gdb console comes up and
complains that it can't set the breakpoint. XCode's debug window claims
that it is running the program, but of course, I can't see anything.
Any ideas on what I need to do to be able to use XCode to walk through
this?
Thanks,
Cem Karan
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden