Technology Questions

Go Back   Technology Questions > Software Questions > Operating System Questions > Linux

Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old 09-29-2007, 09:20 AM
Outspan
Newsgroup Contributor
 
Posts: n/a
C programming from shell

Hi,

I'd like to give C programming from shell a try. I thought about
vim+gcc, so i added these lines to ~/.vimrc:

syntax on
set et
set sw=4
set smarttab
set nocp incsearch
set cinoptions=:0,p0,t0
set cinwords=if,else,while,do,for,switch,case
set formatoptions=tcqr
set cindent

but my question is: isn't there a way to integrate vim and gdb (watches,
breakpoints etc on the shell)? If I got it right, both GdbVim and Clewn
do what I'm looking for, but just on the GUI version of vim. How do you
program from shell? Suggestions?

thanks
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

 
Old 09-29-2007, 09:20 AM
  #2 (permalink)  
Old 09-30-2007, 07:10 PM
Joseph H. Rosevear
Newsgroup Contributor
 
Posts: n/a
Re: C programming from shell

Outspan <borghiborghi******.com> wrote:
> Hi,


> I'd like to give C programming from shell a try. I thought about
> vim+gcc, so i added these lines to ~/.vimrc:


> syntax on
> set et
> set sw=4
> set smarttab
> set nocp incsearch
> set cinoptions=:0,p0,t0
> set cinwords=if,else,while,do,for,switch,case
> set formatoptions=tcqr
> set cindent


> but my question is: isn't there a way to integrate vim and gdb (watches,
> breakpoints etc on the shell)? If I got it right, both GdbVim and Clewn
> do what I'm looking for, but just on the GUI version of vim. How do you
> program from shell? Suggestions?


> thanks


Programming from the shell isn't hard if you know how to use the
command line. Instead of trying to do what you said from inside vim,
just use vim to make changes to the source file.

Then use cc (or gcc) from the command line to compile. Compile with -g
to enable debugging.

Then run gdb from the command line to debug.

I wrote instructions on how to do do this. You can find them at

http://josephrosevear.com/link.html

Look for the Unixes section and click on the last link called

My notes on use of gdb

I hope this helps.

-Joe
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

  #3 (permalink)  
Old 10-21-2007, 03:40 PM
Jamie
Newsgroup Contributor
 
Posts: n/a
Re: C programming from shell

In <46fe7878$0$36451$4fafbaef@reader5.news.tin.it>,
Outspan <borghiborghi******.com> mentions:
>Hi,
>
>I'd like to give C programming from shell a try. I thought about
>vim+gcc, so i added these lines to ~/.vimrc:
>
>syntax on
>set et
>set sw=4
>set smarttab
>set nocp incsearch
>set cinoptions=:0,p0,t0
>set cinwords=if,else,while,do,for,switch,case
>set formatoptions=tcqr
>set cindent
>
>but my question is: isn't there a way to integrate vim and gdb (watches,
>breakpoints etc on the shell)? If I got it right, both GdbVim and Clewn
>do what I'm looking for, but just on the GUI version of vim. How do you
>program from shell? Suggestions?


As far as I know, (and I could very well be wrong, I don't do much in C)
vim really isn't very good at interfacing with gdb, HOWEVER..

One utility that you might be interested in is called 'cgdb'

http://cgdb.sourceforge.net/

It's a cursed debugger, works pretty good, doesn't need X11

Jamie
--
http://www.geniegate.com Custom web programming
Perl * Java * UNIX User Management Solutions
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
programming project Joseph H. Rosevear Linux 4 06-25-2007 10:10 AM
programming keys geoffrob16@hotmail.com Windows XP 2 06-13-2007 05:30 AM
Why I'm still programming Loren Tablet PC Bloggers 0 06-13-2007 12:02 AM
PC to Mac Programming Barry Fawthrop Apple Macintosh Hardware 3 02-06-2007 04:21 PM
Registry programming.. max Windows XP 3 01-11-2007 11:00 PM


New To Technology Questions? Do You Need Help with Your Computer or Device? Do You Need Help with this site?

All times are GMT -8. The time now is 07:34 PM.


2003 - 2009 All Rights Reserved. Technology Questions

Search Engine Friendly URLs by vBSEO 3.3.0