LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Blogs
User Name
Password

Notices


Old

How To Debug Linux C Programs Effectively Using The Debugger

Posted 02-20-2019 at 02:23 PM by rtmistler
Updated 02-25-2019 at 10:23 AM by rtmistler

Introduction

The purpose of this blog is to provide a guide to Linux C (and C++) programmers as to how to use the Gnu DebuGger, GDB, effectively.

My reasons for writing this are because I participate a great deal in the Linux Questions site and view, plus respond to a number of questions in the Programming forum, and I notice that programmers of various experience seem to be lacking in either experience+knowledge, or initiative, to use the debugger.

This blog...
Attached Images
File Type: png emacs-1.png (67.5 KB, 25 views)
File Type: png emacs-2.png (42.1 KB, 18 views)
Moderator
Views 2411 Comments 1 rtmistler is offline
Old

An Alternate Glade Build.

Posted 04-25-2015 at 01:03 PM by rainbowsally

An Alternate Glade Build. Yes, this actually pertains to the parser, but nevermind that for now.

Need to build glade with -g3 flags? The Computer Mad Science Team does, and so today's marvelous adventure starts here. [Only needs 'make' and the original glade sources d/load to do it.]

Features:
  • An alternate build system generated with Computer Mad Science tools.

Our attempt to use the standard ./configure-make sources to get glade to compile with debug flags...
Member
Posted in Uncategorized
Views 1061 Comments 0 rainbowsally is offline
Old

See source code intermixed with assembly

Posted 01-16-2012 at 03:25 AM by hydraMax (Bits and Pixels)

Maybe everybody else already knows this, but I thought it was pretty neat anyway:

If you compile some C code with -g option (to include debugging symbols), you can then use objdump on the binary, with the -S switch, to get source code intermixed with assembly. For example, here is a snippet from one of my binaries:

Code:
int main() {
  401163:       55                      push   %rbp
  401164:       48 89 e5                mov    %rsp,%rbp
  401167:
...
Member
Posted in Uncategorized
Views 1107 Comments 0 hydraMax is offline

  



All times are GMT -5. The time now is 09:19 AM.

Main Menu
Advertisement
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration