Another Word For It Patrick Durusau on Topic Maps and Semantic Diversity

September 14, 2012

Learning C with gdb

Filed under: Programming — Patrick Durusau @ 5:25 am

Learning C with gdb by Alan O’Donnell.

From the post:

Coming from a background in higher-level languages like Ruby, Scheme, or Haskell, learning C can be challenging. In addition to having to wrestle with C’s lower-level features like manual memory management and pointers, you have to make do without a REPL. Once you get used to exploratory programming in a REPL, having to deal with the write-compile-run loop is a bit of a bummer.

It occurred to me recently that I could use gdb as a pseudo-REPL for C. I’ve been experimenting with using gdb as a tool for learning C, rather than merely debugging C, and it’s a lot of fun.

My goal in this post is to show you that gdb is a great tool for learning C. I’ll introduce you to a few of my favorite gdb commands, and then I’ll demonstrate how you can use gdb to understand a notoriously tricky part of C: the difference between arrays and pointers.

The other day I read about a root kit that you can rent by the day.

If that doesn’t make you nervous about the code on your computer, it should.

Learning C won’t protect you from root kit renters, but it may make you a better programmer.

And poking around in memory locations can make you more aware of tradeoffs made by applications.

Which may or may not fit your data/needs.

No Comments

No comments yet.

RSS feed for comments on this post.

Sorry, the comment form is closed at this time.

Powered by WordPress