help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: c/c++ project management and debugging


From: Andrea Crotti
Subject: Re: c/c++ project management and debugging
Date: Tue, 21 Dec 2010 13:30:36 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (darwin)

Rajinder Yadav <devguy.ca@gmail.com> writes:

> Andrea, thanks for your reply!
>
> My reply here is not a direct response to you, but what i feel in
> general (a windows IDE guy in a Linux command line world)
>
> I don't quite understand the rational against emacs + auto makefile
> generation, it kind of hinders progress imho? if someone doesn't like
> the way emacs or netbean does things (for them) with makefiles, they
> always have the choice of doing it by hand, that is the beauty of
> having more choices, so stop taking away my choices if I simply ask or
> enquire for feature y!
>
> guys like me from the visual IDE environment will have a smaller
> barrier to entry as a result, overtime we will pickup said skills of
> making a makefile by hand, using autoconf or cmake, etc.
>
> i've never had the need to create a makefile or edit one by hand when
> i code using visualstudio, all i care about is coding my project in
> C++ and getting on with life. people like me need a bridge when we
> come over to the open source world, when we start using linux or
> emacs, etc. most of the time we are met with ridicule about how absurd
> our needs and demands are, so opportunity is lost when some decide why
> bother with open source, etc. el
>
> i love ruby on rails hacking, i love doing everything from the command
> line, it's more faster and efficient coding a rails app when compared
> to doing it with netbeans + ide, or whatever IDE is out there!
>
> i can tell you i spent countless hours searching the net and reading
> stuff just to figure out how to use emacs and get it setup with stuffs
> like ido, ecb, cedet and yasnippet learning all the key binding and
> how to edit the .emacs files, the barrier to entry to become more
> efficient with "emacs" is high
>
> i like having ecb for file browsing, i don't always use it, sometimes
> i use the file searching power of ido, but i have a choice when to use
> which in emacs
>
> i am very grateful to the open source community that has made emacs a
> better tool for me and many more that help answer all my questions on
> mailing list or write blogs.

Sure I perfectly understand your point of view, I also agree that it's
better to proceed step by step with everything, or we'll only get
frustrated by the this overcomplicated world.

I just mean that for a software developer programming is not enough, you
must also know your compiler well enough, and your build system.
Otherwise you will:
1. miss many opportunities to write/test much better your code
2. feel like you're using a black box, and be stuck on some product to
   build code that maybe would be perfectly portable everywhere.

> clicking for me doesn't set the breakpoint when i have the source file
> open in the buffer, i am still in edit mode?
>
> i see many gdb windows, but where do I type, b File.cpp:#line ??
>
> here is what i do
>
> 1. open a simple .cpp source file in emacs, a hello world file in C++
> 2. m-x gdb
>
> source buffer disappears, replaced by gdb buffer
>
> 3 m-x gdb-many-windows
> i still don't see my source code window? now where do i click to set a
> break point?
>
> if i switch the gdb buffer to display my source code buffer, i can't
> type in the gdb command while still looking at my source buffer? how
> is one to work in this kind of setup
>
> can i not have a source buffer and a gdb buffer open at the same time,
> still where do i click to set the break point?
>
> Thanks

Sorry clicking doesn't work for me either, what you should do is the
following

evaluate this or set it in your .emacs:
(setq gdb-many-windows t)

g++ -ggdb hello.cpp
M-x gdb RET
And it will prompt you how to run gdb, for example:
gdb --annotate=3 a.out

the annotate is very important otherwise emacs will not be able to
follow the execution.

then you should have on top the gud/gdb buffer, where you can type very
normal gdb commands.
Otherwise you open any source file and with "C-x space" you should be
able to set your breakpoints.

To know more just look in the GUD menu on top or the info page.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]