We would like to know how a managed C# executable running in the mono environment can step into an unmanaged C++ shared object's code using the Monodevelop debugger on a Ubuntu Linux 15.10 platform. The Monodevelop version is 5.5 and the mono version is Mono JIT compiler version 3.2.8 (Debian 3.2.8+dfsg-4ubuntu4) and the .NET version is 4.5. I have used gdb to step into an unmanaged C++ shared object's code. However, we would like to solely use the Monodevelop debugger on a Ubuntu Linux 15.10 platform for both managed C# code and unmanaged C# code. Thank you in advance.


I was just notified that basically this is not supported there was some attempt to make this work, but it's lacking time and interest to make it work..


PullRequests are always welcome

  • DavidKarlas 02:33 not sure in theory it somewhat works but it was never made user friendly and stuff... it would take more then 1 day just to get sense of state it’s in.. and start hacking you could probably have something useful in ~1 week... if you go down the path of trying to get it up and running ping me here I will give you all support I can + @Therzok authour of that prototype – Frank Feb 18 '16 at 8:20
  1. Load your C#/.NET solution into Monodevelop , build and run with debugging

  2. ps -ef Please note that mono itself doesn’t fork processes except if your code does... your managed C# xyz.exe is loaded inside mono process and executed as one with no forking

  3. Identify the process id(PID) of the mono process of interest" /usr/bin/mono --debug --debugger-agent which is 7575 in this actual example

  4. The Unmanaged C++ shared object should be compiled with -g for creating an symbol table.

    ~/InteroperabilityTest/MySQLVersion/Debug$ sudo gdb 7575 GNU gdb (Ubuntu 7.10-1ubuntu2) 7.10 Copyright (C) 2015 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-linux-gnu". Type "show configuration" for configuration details. For bug reporting instructions, please see: http://www.gnu.org/software/gdb/bugs/. Find the GDB manual and other documentation resources online at: http://www.gnu.org/software/gdb/documentation/. For help, type "help". Type "apropos word" to search for commands related to "word"... 7575: No such file or directory. (gdb) file BuildIPCameraListLinux.exe Reading symbols from BuildIPCameraListLinux.exe...(no debugging symbols found)...done. (gdb) break ClickItCameraList.cpp:176 No symbol table is loaded. Use the "file" command. Make breakpoint pending on future shared library load? (y or [n]) y Breakpoint 1 (ClickItCameraList.cpp:176) pending. (gdb) run Starting program: /home/venkat/InteroperabilityTest/MySQLVersion/Debug/BuildIPCameraListLinux.exe warning: Selected architecture i386 is not compatible with reported target architecture i386:x86-64 warning: Architecture rejected target-supplied description add-symbol-file-from-memory not supported for this target process 7592 is executing new program: /usr/bin/mono-sgen [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". [New Thread 0x7ffff471f700 (LWP 7597)] Breakpoint 1, CreateSupportedCameraList () at ./ClickItCameraList.cpp:176 176 { (gdb) step 180 std::map > vendorMap; (gdb) step std::map, std::allocator >, std::less, std::allocator, std::allocator > > > >::map ( this=0x7fffffffd160) at /usr/include/c++/5/bits/stl_map.h:166 166 : _M_t() { } (gdb) step std::_Rb_tree, std::allocator > >, std::_Select1st, std::allocator > > >, std::less, std::allocator, std::allocator > > > >::_Rb_tree (this=0x7fffffffd160) at /usr/include/c++/5/bits/stl_tree.h:807 807 _Rb_tree() { } (gdb) step std::_Rb_tree, std::allocator > >, std::_Select1st, std::allocator > > >, std::less, std::allocator, std::allocator > > > >::_Rb_tree_impl, false>::_Rb_tree_impl (this=0x7fffffffd160) at /usr/include/c++/5/bits/stl_tree.h:588 588 _M_node_count(0) (gdb) continue Continuing. I AM HERE Save OKAY Program received signal SIGPWR, Power fail/restart. [Switching to Thread 0x7ffff471f700 (LWP 7597)] 0x00007ffff74b60c9 in futex_abstimed_wait (cancel=true, private=, abstime=0x0, expected=0, futex=0x98a680 ) at sem_waitcommon.c:42 42 sem_waitcommon.c: No such file or directory. (gdb)

Please let me know if you have any questions.

  • @BinaryZebra, Please look at this answer and point out what it may be lacking? Thank you. – Frank Feb 20 '16 at 15:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.