Results 1 to 3 of 3
Hi All,
I'm trying to debug a program that I crosscompiled on a arm9.
The crosscompiler uses . spec files to create RPM packages for the target system.
The program ...
- 06-10-2010 #1Just Joined!
- Join Date
- Jun 2010
- Posts
- 2
Strange debug problem
Hi All,
I'm trying to debug a program that I crosscompiled on a arm9.
The crosscompiler uses . spec files to create RPM packages for the target system.
The program compiles and runs correctly except when i run the program with gdb and then type list I get this message:
I made sure I compiled the program with CFLAGS=-g by putting this in the .spec file.Code:1 main.c: No such file or directory. in main.c
when the application crosscompiles (I believe) it shows it compiled succesfully with the -g flags:
However when i run the program with gdb, i can't debug because there is no source code available..Code:checking whether gcc accepts -g... (cached) yes ... ... + make CFLAGS=-g make all-recursive make[1]: Entering directory `/home/notroot/ltib/rpm/BUILD/rtsp_imp-0.1' Making all in src make[2]: Entering directory `/home/notroot/ltib/rpm/BUILD/rtsp_imp-0.1/src' CC main.o CCLD rtsp_imp make[2]: Leaving directory `/home/notroot/ltib/rpm/BUILD/rtsp_imp-0.1/src' Making all in po make[2]: Entering directory `/home/notroot/ltib/rpm/BUILD/rtsp_imp-0.1/po' make[2]: Nothing to be done for `all'. make[2]: Leaving directory `/home/notroot/ltib/rpm/BUILD/rtsp_imp-0.1/po' make[2]: Entering directory `/home/notroot/ltib/rpm/BUILD/rtsp_imp-0.1' make[2]: Leaving directory `/home/notroot/ltib/rpm/BUILD/rtsp_imp-0.1' make[1]: Leaving directory `/home/notroot/ltib/rpm/BUILD/rtsp_imp-0.1'
I am really wondering if I am doing something basic wrong?
- 06-10-2010 #2Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 8,974
Are you using the arm-compatible gdb, or are you trying to use your host debugger?
Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!
- 06-11-2010 #3Just Joined!
- Join Date
- Jun 2010
- Posts
- 2
I am using ARM-compatible gdb, and LTIB (linux target image builder) as my cross compiler/toolchain.
I researched a little bit about debugging and then looked over the stackinformation again. It seems that the code is being optimized, so I must have some wrong information in my .spec file I guess
.spec file:Code:#1 0x403bc124 in _g_gnulib_vasnprintf (resultbuf=0x0, lengthp=0xbe9c75cc, format=<value optimized out>, args=<value optimized out>)
Code:%define pfx /opt/freescale/rootfs/%{_target_cpu} Name : rtsp_imp Version : 0.1 Release : 1 Summary : RTSP Server Implementatie License : LGPL Vendor : Dealogic Packager : Ferdinand Jacobs Group : Applications/System Source : %{name}-%{version}.tar.gz BuildRoot : %{_tmppath}/%{name} Prefix : %{pfx} %Description %{summary} %Prep %setup -n rtsp_imp-%{version} %Build ./configure --prefix=%{_prefix} --build=%{_build} --host=arm-none-linux-gnueabi \ --disable-valgrind --without-check --enable-maintainer-mode make 'CFLAGS=-g' 'CXXFLAGS=-g' 'JFLAGS=-g' 'FFLAGS=-g' %Install rm -rf $RPM_BUILD_ROOT make install DESTDIR=$RPM_BUILD_ROOT/%{pfx} find $RPM_BUILD_ROOT/%{pfx}/%{_prefix}/lib/ -name "*.la" | xargs rm -f rm -f $RPM_BUILD_ROOT%{_libdir}/*.a rm -f $RPM_BUILD_ROOT%{_libdir}/*.la %Clean rm -rf $RPM_BUILD_ROOT %Files %defattr(-,root,root) %{pfx}/*


Reply With Quote