Which IDE for debugging wireshark? - linux

I would like to step through some code in wireshark to see how a few things work. I've read some of the Wireshark Build Environment guide but it seems a lot of info is missing. I've never done any programming in linux before so bear with me here.
What is the best IDE to use for debugging Wireshark in Linux? If there isn't one, then how do you debug without an IDE? I've really only developed in Visual Studio so I've been spoiled by it's ease of use.

You can use Eclipse as a full-fledged IDE with debugging capabilities. Or you can debug from command line using gdb. Or you can use DDD, which is a GUI front end for gdb.

Related

Can I debug a program with LLDB-MI via Eclipse?

It seems that LLDB plugin for Eclipse is still not developed yet, but this article claims that one can debug a program with LLDB-MI driver in Linux. However described way of integrating Eclipse and LLDB doesn't work for me (I always get "command --exec-continue not recognized" error message) and it looks suspicious that embedding LLDB-MI to Eclipse may be so easy.
Could anyone point me to curren materials on this topic? Google shows me only old Eclipse-bug-tracking threads.
There is a project called lldbmi2 that provides most of the functionality one would need. I know it's been developed primarily for the Mac and I don't know if it's been tested on Linux. It's not perfect, but I've been using it on the Mac for months and I'm pleased with its functionality.
See https://github.com/freedib/lldbmi2

Is it possible to debug mex code with Eclipse?

I am trying to write some mex code but it is painful to debug it on the console with gbd. Is it possible to use Eclipse or the GUI of Matlab? If these are not feasible methods, what is the best way of writing mex code that provides good debug capabilities?
Debugging C/C++ MEX files in gdb is already comprehensively covered in the official documentation, so my suggestion is to try and integrate gdb with Eclipse CDT.
There's plenty of information out there about how to do it properly, so I'm not going to repeat everything here. The best tutorial I know is IBM's two-part guide, "Interfacing with the CDT debugger":
Part 1: Understand the C/C++ debugger interface - covers the high-level basics.
Part 2: Accessing gdb with the Eclipse CDT and MI - explains how to make Eclipse work with gdb.
I think part 2 is what you really need. Basically, you have to install a plug-in and configure it in Eclipse.
There are also quite a few related questions about this even here on StackOverflow:
How do I use GDB in Eclipse for C/C++ Debugging?
How to install GDB debugger to Eclipse CDT
Debugging with Eclipse CDT and GDB
How can I enter commands to a gdb prompt while debugging with Eclipse CDT?
I haven't tried it out yet, so I hope this works.
On Windows platform:
The best way (to my experience) to debug a mex code is to use Visual studio.
Here's a link on how to do it.
Other platforms (Linux/Mac):
I'm afraid I haven't find any good way to do so apart from gdb (which is not fun at all).
Update (2018):
Recently, Mathworks released a blog post describing how to use Visual Studio Code to debug mex code.
I haven't tried it myself, but it seems like a nice cross-platform solution for debugging mex files.
Here is my solution which works in Ubuntu 12.04, Matlab R2012b, and Eclipse IDE for C/C++ Developers Kepler Release.
In Eclipse open "Debug Configurations" from the run tab. Then make a new "C/C++ Application".
In the "Main"-tab write the correct path to the matlab executable in the "C/C++ Application" (mine is "/usr/local/MATLAB/R2012b/bin/glnxa64/MATLAB" NOTE: not MATLABPATH/bin/matlab).
In the "Arguments"-tab add "-nojvm" as program arguments.
In the "Environment"-tab add variable "MATLAB_DEBUG" with value "gdb"
Press "Apply" and "Debug"
A "Matlab console" will open in the "Console" view.
Write "dbmex on" in this console. This enables debugging.
Run the mex file! (Matlab will stop at loading of each new mex file)
Have fun debugging! :-)

How to debug F#/Nemerle mono application under Linux?

I recently discovered Nemerle and F#, but I can't find any way to debug my applications.
MonoDevelop 2.6 lacks support of Nemerle and F#, 2.4.2 and earlier crashes because of newer gnome-sharp lib is installed (I'm running up-to-date Arch Linux kernel-3.0 64-bit). Command-line mono debugger refuses to start saying "platform not supported". So few questions about this situation:
It is possible to debug mono applications using gdb without going on low-level (inside vm or so) ?
How comfortable to use F# REPL for interactive development without debugger (compared to Common Lisp or Haskell's GHCi)?
I use the F# Interactive environment to write F# code most of the time. Even with Visual Studio, the F# Interactive environment doesn't (reasonably) support debugger, so I mainly rely on the ability to easily run something interactively and see if it works - if it doesn't, it is usually easy to split into sub-components that can be tried interactively too. The great thing about F# Interactive, compared to for example GHCi, is that you can use it to evaluate pretty much anything - including type declarations.
The F# plugin for MonoDevelop 2.4 doesn't currently support debugging of compiled F# applications. I was able to use command line Mono debugger (mdb, I think), but that was on 32bit system.
I'm not sure why MonoDevelop doesn't correctly pick F# debug symbols, so this is most likely some basic bug. There are a few poeple working on F# plugin for MD 2.6, so that should hopefully be available soon. If anybody wanted to investigate why the debugging doesn't work, that would be great...
Nemerle has great IDE support under Windows with Visual Studio and #Develop, better than F#, but there is nothing for Linux, as far as I know.
You can easily debug Nemerle in MonoDevelop.
Just convert pdb to mono format using pdb2mdb tool: http://www.mono-project.com/Guide:Debugger
Than just debug your application, and you get correct locations.
I even managed to debug Nemerle compiler using this trick.
About Linux and Nemerle :
Nemerle got Vim bindings, Kwrite/Kate and some other editors got ntive Nemerle support. You can also add compiler option to any editors in Linux. Nemerle compiler is just works !
Nemerle MonoDevelop support in developing but really slow. F# got outdated MonodeVelop support as #Tomas said but what about new MonoDevelop ? PowerPack ? F# 3 ? That is complex task I think so.
Nemerle is OpenSource project. And I'm not sure about F# 3. I like F# but it's always behind the Microsoft hand. You are free to try both.

How to circumvent VC++2008EE JIT debugging restriction?

Is there some smart registry hack or so available to get Visual C++ 2008 Express Edition running Just In Time Debugging? Or is there some other (legal) way to circumvent this restriction?
A possible decent (and still free) alternative would be to install the Debugging Tools for Windows which will do just in time debugging quite nicely.
WinDbg isn't quite as nice as the VS debugger for a lot of things, but it's pretty close. And it has a lot of functionality that simply isn't in the VS debugger at all (being able to dump important Windows structures for example).

Linux Development C/C++/bash/python on windows-7

Before resorting to stackoverflow, i have spend a lot of times looking for the solutions. I have been a linux-user/developer for few years, now shifting to windows-7.
I am looking for seting-up a development environment (mainly c/c++/bash/python) on my windows machine. Solutions i tired -
VirtuaBox latest, with grml-medium (very light debian-based distro)
some how managed to install it in VBox, but lots of issues still regarding Guest-Additions, sharing files, screen-resolutions. Tired with it, now.
MinGW
installed it, added to %PATH%, along with GVIM. Now i can use powershell, run gvim, vim, and mingw from the shell as bash. But no manpages, its a lot of convenience to have them availble, locally and offline. But i think it gives me a gcc development
Do i need mySys now. i can installed it if it provides me with manpages and ssh.
Cygwin
Has avoided till now. But i think it will give me manpages, gcc-utils, python-latest.
Something called Interix.
any taker for that. is it recommened.
What are the best practices? What are you guys following, i dont have a linux-box to ssh to, well if Vbox things works fine at some point of it, i can then ssh to my VBox. I have lost of time setting it up, so abandoning it for a while.
I think only VirtualBox solution will let try things like IPtables, or other linux-system-frameworks.
I checked this
Best setup for Linux development from Windows?
do you recommend coLinux or its derivatives. If yes advices or consideration before i try that.
I recommend VirtualBox+Ubuntu. Cygwin just doesn't cut it for certain tasks and is in beta for Win7.
Here is what I do for Python development on Windows:
EasyEclipse for Python (includes eclipse, subclipse, pydev)
GNU Win32 Native Windows ports for GNU tools
Vim and Emacs (for non-IDE editing work)
I would see if MSysGit can provide what you want first. also since man pages aren't really anything hugely impressive... it might just be possible to just copy them. I've had problems with cygwin, although to be honest I'm not happy with MSys, MSysGit, or Cygwin. I wish someone would build one that was more... linux like. I would if I had to use windows every day, fortunately I only have to use windows sparingly.
IMO I'd say VirtualBox + Gentoo Linux + KDevelop4, Gentoo will give you the control you need over your environment.
I'm doing exactly the opposite of you, I have gcc/qt4 installed on wine to compile for windows and using Linux primarily.
If you want to do development of POSIX applications (mostly command line), with all the familiar Linux tools, then cygwin is your best bet.
It probably include everything you are used to.
But if you will try to do Windows development (anything with UI, drivers, services), then Visual Studio is really gold.
And in general Visual Studio is just great for anything, if you want to spend the time and money. Good IDE, great debugger. I highly recommend it. And if you are in Rome, do what the Romans do :-)
I would recommend Bloodshed DevC++ as a good basic non-microsoft specific Windows solution for developing ANSI C/C++ code. Personally I just use Visual Studio 2008 and ignore all the Microsoft specific extensions.
For Python there is the wonderful Komodo Edit software that is free, personally the IDE version is what I prefer, but I use an old 3.5.3 version that works for me. And they have a very popular Python package called ActivePython as well, that has a bunch of Windows specific extension modules.
Personally cygwin just feels and acts like a hack to me and is painful to setup and maintain. I think running Linux/Unix in a Virtual Machine is much less hassle if you are looking for a *nix environment. Getting a really genuine *nix environment feel is going to be very hard under Windows.
The following suggestions hold if you are not going to do complex template programming as the c++ IDE's other than visual studio SUCK, they cannot efficiently index modern C++ code (the boost library).
I would suggest using Netbeans (it has far better support for C++ than eclipse/CDT) with the following two build environments. Both are important if you want to cross-compile and test against POSIX and win32. This is not a silver-bullet, you should test on different variants of UNIX once in a while:
I would suggest installing Mingw and Msys for windows development, its nice when you can use awk, grep, sed etc on your code :D generative programming is easier with shell tools as well -- writing generative build scripts is a bitch to do effectively of the command line in windows (powershell might have changed this).
I would ALSO suggest installing Cygwin and using that on the side. Mingw is for programming against the win32 low-level API, Cygwin is for programming against the POSIX standard. Cygwin also compiles a lot of software that you would otherwise have to port.
Also once you get your project up and running you can use CMAKE as build environment, its the best thing since sliced bread :P You can get it to spit out build definition for anything and everything -- including visual studio.

Resources