public inbox for gdb-testers@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] minsyms.c: Scan backwards over all zero sized symbols.
@ 2015-11-23 23:05 sergiodj+buildbot
  2015-11-23 23:05 ` Failures on Debian-s390x-native-gdbserver-m64, branch master sergiodj+buildbot
                   ` (20 more replies)
  0 siblings, 21 replies; 22+ messages in thread
From: sergiodj+buildbot @ 2015-11-23 23:05 UTC (permalink / raw)
  To: gdb-testers

*** TEST RESULTS FOR COMMIT 5506f9f67ec105b0059a0b3a66fbde82cb5a0a15 ***

Author: Kevin Buettner <kevinb@redhat.com>
Branch: master
Commit: 5506f9f67ec105b0059a0b3a66fbde82cb5a0a15

minsyms.c: Scan backwards over all zero sized symbols.

The comment for the code in question says:

		  /* If the minimal symbol has a zero size, save it
		     but keep scanning backwards looking for one with
		     a non-zero size.  A zero size may mean that the
		     symbol isn't an object or function (e.g. a
		     label), or it may just mean that the size was not
		     specified.  */

As written, the code in question will only scan past the first symbol
of zero size.  My change fixes the implementation to match the
comment.

Having this correct is important when the compiler generates several
local labels that are left in place by the linker.  (I've been told
that the linker should eliminate these symbols, but I know of one
architecture for which this is not happening.)

I've created a test case called asmlabel.c.  It's pretty simple:

main (int argc, char **argv)
{
  asm ("L0:");
  v = 0;
  asm ("L1:");
  v = 1;		/* set L1 breakpoint here */
  asm ("L2:");
  v = 2;		/* set L2 breakpoint here */
  return 0;
}

If breakpoints are placed on the lines indicated by the comments,
this is the behavior of GDB built without my patch:

    (gdb) continue
    Continuing.

    Breakpoint 2, L1 () at asmlabel.c:26
    26	  v = 1;		/* set L1 breakpoint here */

Note that L1 appears as the function instead of main.  This is not
what we want to happen.  With my patch in place, we see the desired
behavior instead:

    (gdb) continue
    Continuing.

    Breakpoint 2, main (argc=1, argv=0x7fffffffdb88) at asmlabel.c:26
    26	  v = 1;		/* set L1 breakpoint here */

gdb/ChangeLog:

	* minsyms.c (lookup_minimal_symbol_by_pc_section_1): Scan backwards
	over all zero-sized symbols.

gdb/testsuite/ChangeLog:

	* gdb.base/asmlabel.exp: New test.
	* gdb.base/asmlabel.c: New test case.


^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2015-11-24  7:58 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-23 23:05 [binutils-gdb] minsyms.c: Scan backwards over all zero sized symbols sergiodj+buildbot
2015-11-23 23:05 ` Failures on Debian-s390x-native-gdbserver-m64, branch master sergiodj+buildbot
2015-11-23 23:06 ` Failures on RHEL-s390x-m64, " sergiodj+buildbot
2015-11-23 23:19 ` Failures on Debian-s390x-m64, " sergiodj+buildbot
2015-11-23 23:22 ` Failures on AIX-POWER7-plain, " sergiodj+buildbot
2015-11-23 23:25 ` Failures on Debian-s390x-native-extended-gdbserver-m64, " sergiodj+buildbot
2015-11-23 23:39 ` Failures on Fedora-s390x-m64, " sergiodj+buildbot
2015-11-23 23:45 ` Failures on Fedora-x86_64-native-extended-gdbserver-m32, " sergiodj+buildbot
2015-11-23 23:51 ` Failures on Fedora-x86_64-cc-with-index, " sergiodj+buildbot
2015-11-24  0:01 ` Failures on Fedora-x86_64-native-extended-gdbserver-m64, " sergiodj+buildbot
2015-11-24  0:05 ` Failures on Fedora-x86_64-native-gdbserver-m64, " sergiodj+buildbot
2015-11-24  0:13 ` Failures on Debian-i686, " sergiodj+buildbot
2015-11-24  0:20 ` Failures on Fedora-x86_64-native-gdbserver-m32, " sergiodj+buildbot
2015-11-24  0:29 ` Failures on Debian-i686-native-gdbserver, " sergiodj+buildbot
2015-11-24  0:35 ` Failures on Debian-x86_64-native-extended-gdbserver-m64, " sergiodj+buildbot
2015-11-24  1:09 ` Failures on Debian-i686-native-extended-gdbserver, " sergiodj+buildbot
2015-11-24  1:47 ` Failures on Fedora-ppc64be-m64, " sergiodj+buildbot
2015-11-24  2:05 ` Failures on Fedora-ppc64be-native-gdbserver-m64, " sergiodj+buildbot
2015-11-24  4:43 ` Failures on Fedora-ppc64le-native-extended-gdbserver-m64, " sergiodj+buildbot
2015-11-24  5:17 ` Failures on Fedora-ppc64le-native-gdbserver-m64, " sergiodj+buildbot
2015-11-24  6:00 ` Failures on Fedora-ppc64le-m64, " sergiodj+buildbot
2015-11-24  8:03 ` Failures on Debian-x86_64-native-gdbserver-m64, " sergiodj+buildbot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).