This is the mail archive of the insight@sources.redhat.com mailing list for the Insight project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: [INSIGHT] source code lines mismatch


Hugo Villeneuve wrote:
> 
> Hi,
> 
>         I don't know if it's a GDB or Insight issue, but when I do my

Try it with gdb -nw and see what happens.  But I bet it is gdb (or gcc) 
because the GUI rely on it (them) for the symbolic information.

See my comments below.


> debugging, in the main function, I'm calling two functions:
> 
>         int main( void)
>         {
>                 InitializeArmRegisters();
>                 InitializeArmPeriph();
>                 return EXIT_SUCCESS;
>         }
> 
> The two functions inside main are in a separate file
> (Source/hardware_initialization.c)
> 
> I set a breakpoint on each function inside main. When I step into the
> "InitializeArmRegisters()" function, I see on the console:
> 
>         InitializeArmRegisters () at Source/hardware_initialization.c:33
> 
> When I run into the second breakpoint, and I do a step, I see on the
> console:
> 
>         0x00102224 in InitializeArmPeriph () at
          ^^^^^^^^^^
gdb thinks you've stopped in the middle of a source line.


>         Source/hardware_initialization.c:33
> 
> I don't understand why the two functions have the same line number? (I
> can't trace because of that)
> 

Which version of gdb are you using?  Also, have you compiled your
program
with optimization?  

Things to try, in order:

Compile without optimization.
A recent version of gdb.
A different version of gcc (the compiler creates the line number info).


-- 
Fernando Nasser
Red Hat Canada Ltd.                     E-Mail:  fnasser@redhat.com
2323 Yonge Street, Suite #300
Toronto, Ontario   M4P 2C9


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]