NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

bin/44836: gdb -batch prints spurious useless messages



>Number:         44836
>Category:       bin
>Synopsis:       gdb -batch prints spurious useless messages
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Apr 06 10:30:01 +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.

>Unformatted:
        
        


Home | Main Index | Thread Index | Old Index