public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
From: Fernando Rodriguez <frodriguez.developer@outlook.com>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] [~amd64] Confusing behavior from gdb
Date: Sat, 25 Apr 2015 22:52:48 -0400	[thread overview]
Message-ID: <6039874.Cl4Wh1aHLI@navi> (raw)
In-Reply-To: <5846.1430005350@ccs.covici.com>

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


      reply	other threads:[~2015-04-26  2:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-25 23:31 [gentoo-user] [~amd64] Confusing behavior from gdb walt
2015-04-25 23:42 ` covici
2015-04-26  2:52   ` Fernando Rodriguez [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6039874.Cl4Wh1aHLI@navi \
    --to=frodriguez.developer@outlook.com \
    --cc=gentoo-user@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox