NetBSD Problem Report #44836

From jmmv@julipedia.org  Wed Apr  6 10:27:44 2011
Return-Path: <jmmv@julipedia.org>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by www.NetBSD.org (Postfix) with ESMTP id 8FC5563C0F9
	for <gnats-bugs@gnats.NetBSD.org>; Wed,  6 Apr 2011 10:27:44 +0000 (UTC)
Message-Id: <20110406102021.BD179F08191@desky.julipedia.org>
Date: Wed,  6 Apr 2011 11:20:21 +0100 (IST)
From: jmmv@julipedia.org
Reply-To: jmmv@julipedia.org
To: gnats-bugs@gnats.NetBSD.org
Subject: gdb -batch prints spurious useless messages
X-Send-Pr-Version: 3.95

>Number:         44836
>Category:       bin
>Synopsis:       gdb -batch prints spurious useless messages
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Apr 06 10:30:01 +0000 2011
>Closed-Date:    Wed Apr 06 10:41:21 +0000 2011
>Last-Modified:  Wed Apr 06 10:41:21 +0000 2011
>Originator:     Julio Merino
>Release:        NetBSD 5.99.48
>Organization:

>Environment:


System: NetBSD desky 5.99.48 NetBSD 5.99.48 (GENERIC) #4: Mon Apr 4 21:31:19 IST 2011 jmmv@desky:/s/jmmv/os/netbsd/obj.amd64/s/jmmv/os/netbsd/src/sys/arch/amd64/compile/GENERIC amd64
Architecture: x86_64
Machine: amd64
>Description:
	When running gdb on a core file, gdb prints status messages that
	describe the shared objects being loaded.  It also prints whether
	such objects had debugging symbols or not:

	Reading symbols from /usr/lib/libutil.so.7...(no debugging symbols found)...done.
	Loaded symbols for /usr/lib/libutil.so.7

	However, when running gdb with the -batch flag, such messages are
	skipped with the exception that gdb still prints the "(no debugging
	symbols found)" part by itself.  Printing these messages with the
	corresponding "Reading symbols" line is useless.  Either gdb should
	not be printing anything at all, or it should be printing the whole
	messages.
>How-To-Repeat:
	Write a test.c program that calls abort(), compile it and link it
	against arbitrary libraries that have no debugging symbols.

	Then, load the core dump without -batch:

	$ gdb -q a.out a.out.core
	(no debugging symbols found)
	Reading symbols from /usr/lib/libutil.so.7...(no debugging symbols found)...done.
	Loaded symbols for /usr/lib/libutil.so.7
	Reading symbols from /usr/lib/libc.so.12...(no debugging symbols found)...done.
	Loaded symbols for /usr/lib/libc.so.12
	Reading symbols from /usr/libexec/ld.elf_so...(no debugging symbols found)...done.
	Loaded symbols for /usr/libexec/ld.elf_so
	Core was generated by `a.out'.
	Program terminated with signal 6, Aborted.
	#0  0x00007f7ff74e981a in _lwp_kill () from /usr/lib/libc.so.12

	And now do the same with -batch:

	$ gdb -q -batch a.out a.out.core
	(no debugging symbols found)
	(no debugging symbols found)
	(no debugging symbols found)
	(no debugging symbols found)
	Core was generated by `a.out'.
	Program terminated with signal 6, Aborted.
	#0  0x00007f7ff74e981a in _lwp_kill () from /usr/lib/libc.so.12

	Note that the first 4 lines of the output are completely useless.

	You can omit the -q flag in the above commands; I just included it
	to skip the copyright notices.
>Fix:
	Possibly trivial, but likely needs discussion with upstream.

>Release-Note:

>Audit-Trail:

State-Changed-From-To: open->closed
State-Changed-By: jmmv@NetBSD.org
State-Changed-When: Wed, 06 Apr 2011 10:41:21 +0000
State-Changed-Why:
Duplicate of PR bin/44829.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.