No source available for "__libc_start_main() " [message #762247] |
Wed, 07 December 2011 18:57 |
Lk Messages: 4 Registered: December 2011 |
Junior Member |
|
|
Well, title and description say the most... i'm an ubuntu 11.10 user, i installed eclipse 3.7.0 through the Ubuntu Software Center (but i tried "manually" directly downloading from the official site before). Everything just goes fine (i guess), and i can even almost debug the code: at the end of the debugging, right after the closing "}", i receive the error 'No source available for "__libc_start_main() "', here are some rows showed if i click on "show disassembly":
0x0014a113 <__libc_start_main+243>: mov %eax,(%esp)
0x0014a116 <__libc_start_main+246>: call 0x1639e0 <exit>
0x0014a11b <__libc_start_main+251>: xor %ecx,%ecx
0x0014a11d <__libc_start_main+253>: jmp 0x14a054 <__libc_start_main+52>
0x0014a122 <__libc_start_main+258>: mov 0x3894(%ebx),%eax
0x0014a128 <__libc_start_main+264>: ror $0x9,%eax
0x0014a12b <__libc_start_main+267>: xor %gs:0x18,%eax
I'm not expert in assembly but it seems to me that he indeed can access to the libc_start_main (whatever that is), so what is the problem??
At least a few times this didn't happened, but i couldn't find any pattern.
After the debugging is terminated the console shows the following message:
Stopped due to shared library event
Stopped due to shared library event
Single stepping until exit from function __libc_start_main,
which has no line number information.
Now, the program is indeed debugged as the error is only at the end of the debugging, but this is nonetheless very annoying...
I hope i included enough informations, and if not just tell me what do you need to know!
Thanks in advance (and sorry for any grammar mistakes )
|
|
|
|
|
|
|
Re: No source available for "__libc_start_main() " [message #762560 is a reply to message #762247] |
Thu, 08 December 2011 09:54 |
Hagen Messages: 90 Registered: April 2010 |
Member |
|
|
When you start executing a C program, some application startup code - to
setup the application stack and to initialize your static variables - is
executed before the "main" routine.
This application startup code is part of the "C runtime".
Often the name of the precompiled module doing the initial setup is
"crt0.o" (C RunTime 0 [Zero] objectfile) or something.
When you have standard libraries enables, the linker will add it
automatically before the start of the actual application code.
You likely have the source code for the pre-"main" initialization module.
But (a) very likely it is written in assembly language anyway (stack and
variable setup are not easily done in C), and (b) because the
application startup code is part of the C runtime library source that
came with your C compiler toolchain, it is not part of your Eclipse
project, and so Eclipse does not know about it.
If you really want to look at this code whilst debugging, you need to
change the build options to omit the standard libraries (and setup
code), and compile your own crt0.o module.
This then needs to be the very first linked module, otherwise your
application will not properly start.
In daily practice, I'd just set a breakpoint at "main" and would not
worry about the setup code.
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02130 seconds