Beginners' guide for setting up Emacs with gcc/gdb? [closed] - c

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
I looked around the GNU emacs material and didn't find anything helpful.
Does anyone know of a good tutorial for setting up emacs, to basically turn it into an IDE? I'm looking for interfacing with gcc/gdb/make, etc...

Like other answers mentioned, M-x compile, M-x gdb will get you going. While debugging, I'd also suggest gdb-many-windows-mode, which makes Emacs look a bit closer to IDE when debugging.
Besides that and to get closer to "IDE-like features", you can look at:
CEDET http://cedet.sourceforge.net/ for code completion and project support. Excellent tutorial at http://xtalk.msk.su/~ott/en/writings/emacs-devenv/EmacsCedet.html .
If you don't mind using non-free software, Xrefactory (http://www.xref.sk/xrefactory/main.html) is probably the best (well, the only) refactoring tool. The C version is free, the C++ is not.

Yuval, you're probably being misled by looking for something about IDEs. All that stuff is automagically built into EMACS except for the CScope-like searching stuff.
M-x compile runs make by default, although I reset it to run Ant in java mode.
M-x gdb runs gdb
C-x ` (Ctrl-X backquote) goes to the next compile error
and so on.
Go dig about in the EMACS Wiki. Lots of good stuff. The Programming Category is where you should look.

Good Article
Look at CScope too... you just have to add two lines to your .emacs to be able to navigate through definitions and references

Even though not directly related to C/C++ i find that using a good color scheme is important. Try:
M-x color-theme-select
and you can browse around a lot of different setups if you do not want to create your own.

If you're working with version control system, you can find useful information in another my article about work with version control systems from emacs

Related

Usable Software Reverse Engineering tools needed! [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
Hey guys, Myself and 2 fellow software engineer students are tasked to reverse engineer the gawk program. We need to create diagrams representing the structure, and answer questions about the program.
http://directory.fsf.org/project/gawk/
We are looking for simple to use reverse engineering tools for C programs. Our instructor has given us the following three tools as examples of what we should use, but we simply are having a huge problem getting them to work. Do you have any alternative solutions, or perhaps some good documentation on one of the following tools to help us out? Thanks!
PBS: http://www.swag.uwaterloo.ca/pbs/
RIGI: http://www.rigi.csc.uvic.ca/Pages/download.html
Shrimp: http://www.thechiselgroup.org/shrimp
This graphic is supposed to help understand a simple C list? http://www.rigi.cs.uvic.ca/downloads/demos/list-d/ls7.html
I strongly suggest ignoring those programs and start reading the code.
Reading the code can be vastly simplified if you have good tools to help; vim with etags and cscope is my preferred tool, with the GNU id utils tools coming in as occasionally handy.
Emacs users will probably stick closely with just etags.
The Eclipse IDE can probably help you navigate through code too. I've never tried it, but enough people love it so I hope it has some nice functionality.
People often find it easy to give exact URLs to locations in Linux source code using the lxr tool, e.g.: http://lxr.linux.no/#linux+v2.6.37.1/security/apparmor/lsm.c#L294 -- this system requires very little on individual client machines, which means you only need to configure it once as a server and all your classmates can benefit from it.
As first, you can use IDA Pro under linux. For more information of reversing tools, see https://www.apriorit.com/dev-blog/366-software-reverse-engineering-tools.
Binutils includes next reversing tools:
file;
nm;
size;
strings;
ldd;
readelf.
Objdump – disassembler. It shows header of a program, sections of file (flag -х). Disassemble file (flag -D). It shows body of sections in hex view (flag -s).
EDB. It is like OllyDbg, but under Linux.
HTE. Сonsole editor with more functions. It can disassemble files, supports cross-reference links, set functions’ name.

Learn C for programmers [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this question
I would like to learn how to work with C,
The things I have problems with are compilation and makefiles, not so much the C syntax. Most books deal mostly with the language, but what I'm looking for is more the other parts. What IDE and compiler do I use, and how do I use these.
Thank you very much!
I would recommend gcc for the compiler and just a normal text editor for the ide. Compilation and working with makefiles is relatively simple, you could learn all you want by just googling it. I started out with vi and gcc. Now I use eclipse, netbeans, and gedit for when I am using c/c++.
If you are looking at strictly C, than there is nothing probably better on a nix system than Vim and Make.
Programming isn't always easy. Struggle with it and learn.
If you don't mind more C++ than I would recommend the following:
I have also used Code::Blocks which is a free open source IDE available for *nix systems.
On Windows just use Visual C++ Express which is also free.
Both Eclipse and Netbeans have functionality to develop and build C programs.
There's lots of tutorials e.g. Getting Started With the NetBeans C/C++
Much depends of the OS you actually use to compile. Really IDE and Makefiles are not C related and there is books about them. I would suggest to try a minimalist environment (any text editor and compiling from command line) to understand what is under the hood, then go for a full featured IDE.
Use gcc, write a Makefile for every project you make (even a small hello world program), and use gdb to debug. As for editing code, use whatever you enjoy typing in.

Good C IDE for Mac? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
The community reviewed whether to reopen this question last year and left it closed:
Not suitable for this site We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Improve this question
I've just started a job where I'm programming in C on a Mac, which is my first experience using a Mac for development. For now I'm using Xcode as my editor, then using make/gcc/svn at the command line for compiling and source control.
Is there a good, full featured IDE out there for Macs that will compile C code (something comparable to VS would be ideal), or should I stick with these low level tools?
EDIT: so I called Xcode a "low level tool" because I was under the impression that it was just a text editor for code, like gvim. I will definitely look into it's compiling/source control features.
You can also try Eclipse with the CDT plugin.
Good ide: Xcode
Good non-ide option: vim/make/gcc
textmate - Download from Macromates website.
The latest version is textmate2 but some people choose to keep using textmate-1.5 because there are significant differences between the two versions and they're both awesome.
I just stumbled over Qt Creator. It seems to hold up really nice where every other IDE failed me when working with a plain Makefile project.
XCode, Eclipse, IntelliJ or Netbeans wouldn't resolve dependencies, or load my project in a good way. In Qt Creator I could just point to New Project » Import Project » Import Existing Project and voila!
Remember that Objective-C is a superset of C (a pretty pure one, if I recall correctly). You should be able to use XCode for editing, compiling, and debugging.
Here's one solution (which tells you to create a C++ project, then rename main.cpp to main.c)... http://www.cs.nyu.edu/~s70201/C_In_Xcode/Xcode_Tutorial.html
Xcode can manage project and compile for you as any IDE. But if you're familiar with CLI, I would recommand you to use a good editor and your usual build tools. Emacs and vim are available on os x (using xcode just for its editor is not ideal). Many mac dev love the excellent TextMate editor, but it is not a free (as in freedom) software.
Obviously 'good' is a subjective decision, but Xcode 3.2 is certainly up to par with what you can do in VisualStudio (if one considers VS good, is another thing of course).
I have a project with 250000+ lines of codes, 10 dylibs, helpfile, all in an SVN (Perforce) etc. and hardly ever go outside Xcode.
Xcode has a few peculiar ways to do some things and the debugger is not quite as powerful as the current one in VisualStudio, but overall there's hardly anything you can not do from within the IDE (and the options to adjust the shortcuts within the IDE, Debugger and Editor to your needs are really awesome).

Tools for C code refactoring [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
What tools are there that supports refactoring C code (renaming variables, extracting methods, finding method references, ...)
Preferably for a Linux environment, but Windows tools are ok too.
If there's something available for emacs, even better!
Netbeans 6.7 and above have reasonably decent basic C (and possibly C++, but haven't tried it) refactoring. I use it when doing the JNI part of one of my projects, and stuff like renaming vars, macros, functions, finding usages of a function all work well. Definitely worth a try, to see if it does the rest of what you want, if you're not wedded to emacs yet.
For emacs, there is xrefactory but I haven't tried it myself.
I use Eclipse with CDT as an IDE and find that it works well for refactoring and searching code.
Old, but not bad is cscope and the GUI frontend kscope.
Qt Creator is very fast and useful IDE. It's not only for Qt Framework. You can use it for C and pure C++ projects too. Also it have many refactoring features. It's cross-platform and have vi emulation too. For refactoring features please refer it's documentation.
Slickedit is good at refactoring.
Maybe this previous question could help, at least in speeding up the compile-run cycle.
Fast compiling (or maybe more apt, fast lexical analysis) is one of the things needed to create a system supportive of refactoring.
This article discusses some C++ refactoring tools for Visual Studio.

Is there a Windows IDE that can handle both C and Perl? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I'm using Strawberry Perl which includes MinGW's GCC, I'm also making use of the GNU debugger GDB and Subversion. How can I have a single development environment that would suit this (other than just UltraEdit, the command shell and IE), and how can I further enhance its features?
I'd have a good look at Eclipse if I were you! Then have a look at the EPIC IDE Plug-in.
Subversion integrates quite nicely with that IDE via Tortoise SVN or even better as mentioned in one of the comments by Davide Gualano, Subversive.
Personally i'm using Komodo IDE from ActiveState. Komodo Edit might suit your needs and is its free alternative.
You can use emacs for windows.
http://www.gnu.org/software/emacs/windows/ntemacs.html
Have you tried Notepad++? It's mostly an "all stops pulled out" text editor with code highlighting for every language you can think of. But, it does have a pretty amazing macro / external command / extension thing, so hooking it up to a compiler is pretty easy.
I'm currently using it for C, Inform, Python, Perl, HTML, and VB.Net, with surprisingly few issues when shifting gears.
Also, FOSS.
(and, I've just discovered that it has code completion as well. Excellent!)
msvc 6 will do the job quite nicely.
my perl is installed at c:\perl\bin so...
under the custom menu, create a new tool.
command c:\perl\bin\perl.exe
arguments -w $(FileName)$(FileExt)
initial directory $(FileDir)
check the Use Output Window.
create a button on your tool bar, to run the tool.
The perl output will come out in the output window.
I'm no Windows developer or IDE user by a long shot, but the combination of Cygwin (for all the handy Unix tools and a better shell) and emacs does the job when I have to work on Windows.
Personally, I'm happily using SciTE for C, C++, Perl and Python development on Windows. Using a single tool has a lot of advantages for me - as becoming expert in it improves my productivity in all languages. SciTE has a built-in scripting language, and is also quite easy to combine it with external scripting, so it's extensible beyond imagination - and that using quite standard tools.

Resources