* Re: [gentoo-user] [~amd64] Confusing behavior from gdb
@ 2015-04-26 2:52 99% ` Fernando Rodriguez
0 siblings, 0 replies; 1+ results
From: Fernando Rodriguez @ 2015-04-26 2:52 UTC (permalink / raw
To: gentoo-user
On Saturday, April 25, 2015 7:42:30 PM covici@ccs.covici.com wrote:
> > (gdb) list mount.c:123
> > 118 else
> > 119 fputc(*p, stdout);
> > 120 }
> > 121 }
> > 122
> > 123 static void print_all(struct libmnt_context *cxt, char *pattern, int
show_label)
> > 124 {
> > 125 struct libmnt_table *tb;
> > 126 struct libmnt_iter *itr = NULL;
> > 127 struct libmnt_fs *fs;
> > (gdb)
> >
> >
> > This seems to me to be very buggy behavior, but I'd like to get opinions
from
> > people who really know gdb, which I don't.
>
> I think it wants to put you on the first real statement of the function.
>
Yes. Also, if you compiled with any optimizations compile again with none.
That way the compiler will try to generate code that matches the order of your
C statements. It doesn't guarantees that this won't happen but with
optimizations if you try to step through the source it'll definitely be jumping
back and forth. The first statement here is line 126 but it may be optimized
away or out of order. Also for source code debugging it'll be much easier to
use a graphical frontend (ddd,kdbg,kdevelop,etc).
--
Fernando Rodriguez
^ permalink raw reply [relevance 99%]
Results 1-1 of 1 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2015-04-25 23:31 [gentoo-user] [~amd64] Confusing behavior from gdb walt
2015-04-25 23:42 ` covici
2015-04-26 2:52 99% ` Fernando Rodriguez
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox