-
Notifications
You must be signed in to change notification settings - Fork 48
Description
Hi,
My avdecccmdline executable is crashing when built in Linux, due to no apparent
fault of the original code, I hasten to add; it was modified here to add a
startAVDECCController() function to use it as a DLL. When I build it in Linux,
it also crashes the same way when I build it as an SO, so I'm looking at it as
an executable using gdb. However, I haven't been able to get the debug flags
added when building, apparently.
I tried adding this line
add_compile_options(${CMAKE_CXX_FLAGS_DEBUG})
in \controller\app\cmdline\CMakeLists.txt
so that my UNIX elseif looked like this:
elseif(UNIX)
add_executable (avdecccmdline ${CMDLINE_INCLUDES} ${CMDLINE_SRC})
add_compile_options(${CMAKE_CXX_FLAGS_DEBUG})
set(PCAP_NAME pcap)
set(READLINE_NAME readline)
target_link_libraries(avdecccmdline rt)
I did: cmake .
and got
-- Configuring done
-- Generating done
-- Build files have been written to:
So the ${CMAKE_CXX_FLAGS_DEBUG} syntax seemed to work.
I built, using make -f Makefile.
I tried to gdb it:
/controller/app/cmdline# gdb ./avdecccmdline.exe
Reading symbols from ./avdecccmdline.exe...(no debugging symbols found)...done.
(gdb) start
Temporary breakpoint 1 at 0x694e2
Starting program: /controller/app/cmdline/avdecccmdline.exe
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7ffff6513700 (LWP 3493)]
[New Thread 0x7ffff5d12700 (LWP 3494)]
Thread 1 "avdecccmdline.e" hit Temporary breakpoint 1, 0x00005555555bd4e2 in main ()
(gdb) step
Single stepping until exit from function main,
which has no line number information.
Thread 1 "avdecccmdline.e" received signal SIGSEGV, Segmentation fault.
_IO_new_fclose (fp=0x0) at iofclose.c:48
48 iofclose.c: No such file or directory.
(gdb)
The second line above says no debugging symbols found.
How can I add debug flags to the avdecccmdline executable in Linux?
Also if you have any idea what the problem is in the code, I sure would like to
know that. It works when built for Windows, but in Linux here, it gets this
SIGSEGV before reaching main().
I also tried making the add_compile_options() line like this:
add_compile_options(${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_DEBUG})
Redoing the above, I still got in the first line of gdb output:
Reading symbols from ./avdecccmdline.exe...(no debugging symbols found)...done.
Best regards,
-James