Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Programming/Scripts

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Thread Tools Display Modes
Old 14th July 2008, 22:50
glok_twen glok_twen is offline
Junior Member
Join Date: Jun 2007
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default how do i find the source code line of a running program compiled with gcc -O5?

hi. i have a job that's been running in prod on an ubnutu box for a while. it's written in c++, compiled with gcc -O5.

then it froze up. so i attached gdb and did a bt. can i use any of these hex numbers to cross reference back to my source code in some way? even if i need to re-compile it with a different paramter that ties either the assembly or the address space to source code? way back in the day on a now extinct platform we could compile code with the assembly and line offsets, then use the hex address of a running program to determine in exactly which source line a process was executing at that momement. can i do such a thing with my linux gcc app?

#0  0xb7f6a410 in __kernel_vsyscall ()
#1  0xb7d992f3 in write () from /lib/tls/i686/cmov/libc.so.6
#2  0xb7d375a4 in _IO_file_write () from /lib/tls/i686/cmov/libc.so.6
#3  0xb7d37255 in ?? () from /lib/tls/i686/cmov/libc.so.6
#4  0xb7d3754f in _IO_do_write () from /lib/tls/i686/cmov/libc.so.6
#5  0xb7d37d36 in _IO_file_sync () from /lib/tls/i686/cmov/libc.so.6
#6  0xb7d2c860 in fflush () from /lib/tls/i686/cmov/libc.so.6
#7  0xb7ed8a10 in ?? () from /usr/lib/libstdc++.so.6
#8  0xb7eda1d2 in std::ostream::flush () from /usr/lib/libstdc++.so.6
#9  0xb7edc0a9 in std::endl<char, std::char_traits<char> > () from /usr/lib/libstdc++.so.6
#10 0x0806a289 in Ctest01::Cgonow ()
Reply With Quote
Sponsored Links


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
fastcgi and php on Debian etch walkthrough meemu Tips/Tricks/Mods 54 4th March 2008 14:40
web3_u1 not installing cruz Installation/Configuration 17 29th November 2007 21:23
reoback problems on debian 3.1 Ovidiu Server Operation 12 15th May 2007 23:25
ISPConfig 2.2.10 Beta, any bugs known? till Developers' Forum 29 26th February 2007 12:38
upgrade to 2.2.5 emptied my DB? robd Installation/Configuration 6 1st August 2006 09:47

All times are GMT +2. The time now is 02:55.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.