I think men and women who work in common tools and discuss their common
interests (such as the C computer language) should help one another in
those areas, and even some tangential ones.
People have experience in things. It takes about as much time to write
a reply with the information someone has in the foreground of their
general knowledge, as it does to write a ridiculous reply like "off
topic."
The way to acknowledge periodic off-topic posts is to ignore them. If
the off-topic content continues for some time, then a response is war-
ranted.
In any event, GDB has never been a friend of mine. I've used with some
GUI wrappers (primarily the CodeLite IDE by Eran Ifrah), but it doesn't
compare to Visual Studio's Debugger so I rarely use it except when I
have no choice but to write code that only GCC + GDB supports.
In these past days I've been forced to use SSH to access a Linux machine
and do development. And while I've discovered SSH -X to tunnel X-Windows
it is slow, and it's almost unusable.
In any event, a handful of common commands would get someone started.
I'm sure there are people here who use GCC and GDB daily, and to convey
those commands would be a quick and simple thing. It would someone out
who is seeking knowledge and understanding, and it's relevant to the
needs of someone coding in C because we don't just read the C Standard
and wax philosophical about it. We actually step forward and do, writing
code, debugging code, sharing code, etc.
This wasn't specifically addressed to you, Öö Tiib. It's a general post
for those in clc who are so myopic they can't see human beings on the
other ends of these posts. They just see rules and regulations and hide
behind blindness with regard to the human condition.
I appreciate your help, Öö Tiib. I was able to discover some things about
GDB that have proven helpful. I summarize them here:
gcc -O0 -g3 progname.c -o progname
gdb --tui progname
tabset 4 -- set 4 character tabs
break main -- Break at main()
break Nnn -- Break on the line number
clear nnn -- Clear a breakpoint
r -- Start the program
c -- Continue after a break
k -- Kill the current process
s -- Step into the next line of code
n -- Step over the current line of code
p variable -- Print out the contents of the variable
bt -- Show the stack back trace for the current thread
f Nn -- Such as f 1, show the source code associated with
stack frame number Nn
layout regs -- to see registers
layout split -- to see source + assembly
layout src -- to go back to source only view
Pressing Ctrl+C while the task is running signals SIGINT in Linux, and
stops execution where you are. From there, the commands above can be
used. Typing k to kill, and then r to run will restart the program.
It's worth setting some keys up for STEP, OVER, CONTINUE so that you
aren't constantly typing "s[enter]" or "n[enter]" or "c[enter]", but
just a single F10, F11, and F5, if you're used to Visual Studio.
Still haven't figured out to step out of the current frame. I came
across the command u (Up) but I couldn't figure out how it worked or
if that was it.
Could still use some help.
--
Rick C. Hodgin
PS -- Jesus is more than religion. In fact, He's not even religion.
But what He teaches us about who we are, what sin is, why this
world is the way it is ... it's important. Each of you owe it
to yourself to learn of Jesus because He will teach you about
yourself, and about all the people around you. He will teach
you how to embrace love, and loving people. He will teach you
how to forgive, how to overcome, how to be the men and women He
created us to be before the rigors of this world clobbered each
of us upside the head and set us on other paths.
I cannot stress this enough. Jesus is exactly what all of us
need. He's not religion. He's not punishment. That comes from
other sources. What Jesus brings is life and forgiveness. It is
the sin that He rescues us from that brings everything hurtful and
harmful.
I love each of you. Consider these things, and especially so as
you see the world changing before your very eyes, preparing for
the coming 7-year tribulation where most of mankind will be literally
destroyed. Jesus rescues us from the coming wrath, and gives us what
He intended for us before sin entered in and destroyed everything.
Peace.