Forum Replies Created
-
AuthorPosts
-
ketParticipant
Hi,
Try running the sharedlibrary command in the GDB Session window manually after dynamically loading the library. Some older gdb versions will not load the symbols automatically after the dlopen call. Make also sure that the included libraries are all built in the debug mode.
It makes sense that using dlopen just with the library name won’t work – the working directory of the app process is not inside the apk. The working directory can be root, meaning that no relative path is going to work. To confirm this, you can probably call some function in the c code to find out what the current working directory is.
ketParticipantHi,
In that case try understanding what causes the problem.
You say that you can set breakpoints and see the source of other functions in the same file, stop the execution at some breakpoint and try the info line command on all the other functions in the file DetectEdgesFast is declared. Is source for all the other functions found, is there a pattern?
Secondly, try renaming the DetectEdgesFast function to something else.
Last but not least, is your gdb and gcc compatible i.e. is gcc adding symbols that gdb can understand? Make sure that your gcc and gdb are meant for the same target and that their versions are roughly the same age i.e. not that the gdb is newest and gcc is ancient.
ketParticipantHi,
Starting from VisualGDB version 4.0, setting project dependencies will set the library usage lines in Android.mk. Always check the Android.mk file changes after setting the project dependencies and building the solution for the first time. If the library project builds both static and dynamic versions of the library, then VisualGDB will try to guess which dependency to actually make.
If you want to include a native library not built with VisualGDB inside the same solution in Visual Studio, then look into your Android NDK install directory’s docs folder and read PREBUILTS.html, that will tell you how to include the library in the Android.mk file.
In VisualGDB Project Properties you can turn off the option to delete the libs folder on clean.
Getting an error that GDB for armv7-a does not exist is strange, please post the full error message and logs given here. Debugging on devices and emulators is both supported. Please note that if you are using a armv7-a device, then you also need to build your libraries and app for this armv7-a abi.
ketParticipantHi,
Simply extract those libraries to the respective GMP, MPFR and MPC directories under the built gcc directory. GCC will then configure and build them automatically as a part of its own build process.
ketParticipantHi,
We are considering adding support for Debug->Exceptions, currently that is however not supported.
Use catchpoints to break on exception throws, you can find the relevant gdb documentation here: http://sourceware.org/gdb/onlinedocs/gdb/Set-Catchpoints.html
ketParticipantHi,
Try updating your gdb to a newer version, if there is no built newer version available, then build one from the latest sources (version 7.6 is latest currently).
ketParticipantHi,
Based on the info line command, gdb cannot find the function source file. However, based on the o file, the symbols of the function are there. Now run the objdump command on your executable, not the o file, look if symbols for CApplication_WidthMonitor::DetectEdgesFast are present:
objdump -d -S
If yes, this could be a GDB bug. If no, the symbols are discarded during your build process and analyzing the exact commands ran to build the executable from the .o files should provide enough clues.
ketParticipantHi,
Check that there are no other GNU toolchain directories defined on the PATH variable. Make sure to build the toolchain from within MinGW shell.
ketParticipantHi,
Breaking for breakpoints, any kind of pausing the execution or even internal thread creation and destruction will cause the semaphore to return.
Read more about the good style of programming for gdb here: http://sourceware.org/gdb/onlinedocs/gdb/Interrupted-System-Calls.htmlketParticipantHi,
When VisualGDB sets a breakpoint while your program is running, it tells GDB to stop the program, sets the breakpoint and resumes it (GDB cannot set breakpoints asynchronously).
GDB stops the program by sending a SIGINT to it and handling it. As a side effect, any pending semaphore waits are ended with the EINTR code. As a workaround you can simply make a wrapper for sem_wait() that will check whether the return code is -1 and errno is EINTR and retry the call to sem_wait() in that case.
August 16, 2013 at 18:00 in reply to: ld warning: lib-xyz, needed by lib-abc – Cross Comp Rasp Pi #2441ketParticipantHi,
Thanks for reporting this. We are planning on adding at least an ignore option to the settings toolchain testing in 4.1.
ketParticipantHi,
The problem lies here:
COLLECT_GCC=c:SysGCCpowerpc-eabipowerpc-eabibing++.exe
You should be using the MinGW’s gcc to build the cross-toolchain as you are trying to build a cross-toolchain that will be run on Windows not on PowerPC. Furthermore, make sure that there are no other gnu toolchains on the PATH that could confuse the build process. Do not forget to set the target to powerpc-wrs-vxworks instead of arm-eabi as in the example.
ketParticipantHi,
When using info line, please use the full name including the namespace and class, otherwise the function cannot be found. If you changed the location to the CApplication_WidthMonitor class, then you probably need to use the following command:
info line Application::WidthMonitor::CApplication_WidthMonitor::DetectEdgesFast
The objdump you have included shows that there are symbols for the CApplication_WidthMonitor::ProcessImage(TImageInfo* apImageInfo) function, but it does not show the symbols for the DetectEdgesFast function. Having a call to DetectEdgesFast inside another function does not mean that there are symbols for DetectEdgesFast. Please find where the DetectEdgesFast function is defined inside the objdump of the o file.
ketParticipantHi,
The flags look to be set correctly. Firstly, are you building and debugging on different machines or using a cross-compiler?
Try the following:
1. Start debugging, pause the debugging or stop at a breakpoint.
2. Enter into the GDB Session window for each of the function names:info line
Copy the responses here.
3. Enter into the GDB Session window:info sources
Are the source files for these functions listed there?
If the functions cannot be found or the source files are not listed, then gdb cannot find debugging symbols for these functions/files. Then run objdump for your project executable on the Linux machine to see if the debugging symbols are there (source code lines for the functions). Use the following command, and then look into the result to see whether these functions have symbols:
objdump -d -S
You can also run the same command on individual o files, the symbols should be present in both the o files and the executable.
August 13, 2013 at 22:04 in reply to: ld warning: lib-xyz, needed by lib-abc – Cross Comp Rasp Pi #2438ketParticipantHi,
Others have reported similar issues (viewtopic.php?f=5&t=2648), you do need to specify the second-level libraries as well. The cross-toolchain linker has issues locating the libraries with the usual root folder not being there and some libraries having absolute path dependencies within them.
In the past with OpenCV the following library names list was successful:
LIBRARY_NAMES := pthread rt z jpeg png12 tiff jasper gtk-x11-2.0 gobject-2.0 glib-2.0 avcodec avformat avutil swscale dc1394 opencv_core opencv_imgproc opencv_highgui opencv_ml opencv_video opencv_features2d opencv_calib3d opencv_objdetect opencv_contrib opencv_legacy opencv_flann
Then we also needed to specify some libraries with absolute paths:
SYSROOT := C:/sysgcc/raspberry/arm-linux-gnueabihf/sysroot LDFLAGS := -Wl,-gc-sections $(SYSROOT)/lib/arm-linux-gnueabihf/librt.so.1 $(SYSROOT)/lib/arm-linux-gnueabihf/libpng12.so.0 $(SYSROOT)/usr/lib/arm-linux-gnueabihf/libgdk-x11-2.0.so.0 $(SYSROOT)/lib/arm-linux-gnueabihf/libglib-2.0.so.0 $(SYSROOT)/usr/lib/arm-linux-gnueabihf/libv4l1.so.0 $(SYSROOT)/usr/lib/arm-linux-gnueabihf/libjbig.so.0 $(SYSROOT)/usr/lib/arm-linux-gnueabihf/libpangocairo-1.0.so.0 $(SYSROOT)/usr/lib/arm-linux-gnueabihf/libX11.so.6 $(SYSROOT)/usr/lib/arm-linux-gnueabihf/libXcomposite.so.1 $(SYSROOT)/usr/lib/arm-linux-gnueabihf/libXdamage.so.1 $(SYSROOT)/usr/lib/arm-linux-gnueabihf/libXfixes.so.3 $(SYSROOT)/usr/lib/arm-linux-gnueabihf/libatk-1.0.so.0 $(SYSROOT)/usr/lib/arm-linux-gnueabihf/libcairo.so.2 $(SYSROOT)/usr/lib/arm-linux-gnueabihf/libgdk_pixbuf-2.0.so.0 $(SYSROOT)/usr/lib/arm-linux-gnueabihf/libgio-2.0.so.0 $(SYSROOT)/usr/lib/arm-linux-gnueabihf/libpangoft2-1.0.so.0 $(SYSROOT)/usr/lib/arm-linux-gnueabihf/libpango-1.0.so.0 $(SYSROOT)/usr/lib/arm-linux-gnueabihf/libfreetype.so.6 $(SYSROOT)/usr/lib/arm-linux-gnueabihf/libfontconfig.so.1 $(SYSROOT)/usr/lib/arm-linux-gnueabihf/libgthread-2.0.so.0 $(SYSROOT)/usr/lib/arm-linux-gnueabihf/libffi.so.5 $(SYSROOT)/usr/lib/arm-linux-gnueabihf/libxvidcore.so.4 $(SYSROOT)/usr/lib/arm-linux-gnueabihf/libx264.so.123 $(SYSROOT)/usr/lib/arm-linux-gnueabihf/libvpx.so.1 $(SYSROOT)/usr/lib/arm-linux-gnueabihf/libvorbisenc.so.2 $(SYSROOT)/usr/lib/arm-linux-gnueabihf/libvorbis.so.0 $(SYSROOT)/usr/lib/arm-linux-gnueabihf/libtheoraenc.so.1 $(SYSROOT)/usr/lib/arm-linux-gnueabihf/libtheoradec.so.1 $(SYSROOT)/usr/lib/arm-linux-gnueabihf/libspeex.so.1 $(SYSROOT)/usr/lib/arm-linux-gnueabihf/libschroedinger-1.0.so.0 $(SYSROOT)/usr/lib/arm-linux-gnueabihf/libmp3lame.so.0 $(SYSROOT)/usr/lib/arm-linux-gnueabihf/libgsm.so.1 $(SYSROOT)/usr/lib/arm-linux-gnueabihf/libdirac_encoder.so.0 $(SYSROOT)/usr/lib/arm-linux-gnueabihf/libva.so.1 $(SYSROOT)/usr/lib/arm-linux-gnueabihf/librtmp.so.0 $(SYSROOT)/usr/lib/arm-linux-gnueabihf/libgnutls.so.26 $(SYSROOT)/lib/arm-linux-gnueabihf/libbz2.so.1.0 $(SYSROOT)/usr/lib/arm-linux-gnueabihf/libraw1394.so.11 $(SYSROOT)/lib/arm-linux-gnueabihf/libusb-1.0.so.0 $(SYSROOT)/usr/lib/arm-linux-gnueabihf/libXext.so.6 $(SYSROOT)/usr/lib/arm-linux-gnueabihf/libXrender.so.1 $(SYSROOT)/usr/lib/arm-linux-gnueabihf/libXinerama.so.1 $(SYSROOT)/usr/lib/arm-linux-gnueabihf/libXi.so.6 $(SYSROOT)/usr/lib/arm-linux-gnueabihf/libXrandr.so.2 $(SYSROOT)/usr/lib/arm-linux-gnueabihf/libXcursor.so.1 $(SYSROOT)/usr/lib/arm-linux-gnueabihf/libv4l2.so.0 $(SYSROOT)/usr/lib/arm-linux-gnueabihf/libgmodule-2.0.so.0 $(SYSROOT)/usr/lib/arm-linux-gnueabihf/libxcb.so.1 $(SYSROOT)/usr/lib/arm-linux-gnueabihf/libpixman-1.so.0 $(SYSROOT)/usr/lib/arm-linux-gnueabihf/libxcb-shm.so.0 $(SYSROOT)/usr/lib/arm-linux-gnueabihf/libxcb-render.so.0 $(SYSROOT)/lib/arm-linux-gnueabihf/libselinux.so.1 $(SYSROOT)/usr/lib/arm-linux-gnueabihf/libogg.so.0 $(SYSROOT)/usr/lib/arm-linux-gnueabihf/liborc-0.4.so.0 $(SYSROOT)/usr/lib/arm-linux-gnueabihf/libtasn1.so.3 $(SYSROOT)/usr/lib/arm-linux-gnueabihf/libp11-kit.so.0 $(SYSROOT)/lib/arm-linux-gnueabihf/libdl.so.2 $(SYSROOT)/lib/arm-linux-gnueabihf/libexpat.so.1 $(SYSROOT)/lib/arm-linux-gnueabihf/libgcrypt.so.11 $(SYSROOT)/lib/arm-linux-gnueabihf/libresolv.so.2 $(SYSROOT)/lib/arm-linux-gnueabihf/libpcre.so.3 $(SYSROOT)/usr/lib/arm-linux-gnueabihf/libv4lconvert.so.0 $(SYSROOT)/usr/lib/arm-linux-gnueabihf/libXau.so.6 $(SYSROOT)/usr/lib/arm-linux-gnueabihf/libXdmcp.so.6 $(SYSROOT)/lib/arm-linux-gnueabihf/libgpg-error.so.0
Try the above settings with your project.
-
AuthorPosts