From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4811 invoked by alias); 16 Mar 2012 18:39:00 -0000 Received: (qmail 4632 invoked by uid 22791); 16 Mar 2012 18:38:58 -0000 X-SWARE-Spam-Status: No, hits=1.8 required=5.0 tests=AWL,BAYES_00,RCVD_IN_BRBL_LASTEXT,RCVD_IN_NJABL_RELAY,TW_XF,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from new.toad.com (HELO new.toad.com) (209.237.225.253) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 16 Mar 2012 18:38:45 +0000 Received: from new.toad.com (localhost.localdomain [127.0.0.1]) by new.toad.com (8.12.9/8.12.9) with ESMTP id q2GIceWD010681; Fri, 16 Mar 2012 10:38:40 -0800 Message-Id: <201203161838.q2GIceWD010681@new.toad.com> To: gdb@sourceware.org, gnu@toad.com Cc: Martin Langhoff Subject: Reading dynamic symbols from Linux core files? Date: Fri, 16 Mar 2012 18:39:00 -0000 From: John Gilmore X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2012-03/txt/msg00042.txt.bz2 Martin Langhoff of laptop.org is trying to debug an intermittent bug in the One Laptop Per Child that results in a core dump of a Python process. The bug report (including the gzipped core file) is here: http://dev.laptop.org/ticket/11698 Martin and Jan Kratochvil are currently chasing a problem with finding and getting "debug symbol" packages in Fedora 14 (which this OLPC software release is based on). But in the process of helping them, I also noticed that merely running: $ gdb - core.522 on the core file doesn't provide access to most symbols from the dynamic symbol table. Oddly, "info functions" does produce three non-debugging symbols, but nothing else. Gdb knows that the second thread is stopped in __kernel_vsyscall() but doesn't know much else. See attached transcript. The internal structure of GDB has changed enough that I'm not sure exactly where in the code it should be trying to find the dynamic symbol table from the core file and extracting the symbols from it. I remember making this work many years ago in GDB, which made it much more useful when debugging executables that had no symbols, and core files for which matching executables were hard to come by. Have any clues for me? John $ gdb - /tmp/core.522 GNU gdb (Ubuntu/Linaro 7.2-1ubuntu11) 7.2 Copyright (C) 2010 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "i686-linux-gnu". For bug reporting instructions, please see: ... -: No such file or directory. [New Thread 522] [New Thread 603] Core was generated by `python /usr/bin/sugar-session'. Program terminated with signal 11, Segmentation fault. #0 0xa7183e2e in ?? () (gdb) i fun All defined functions: Non-debugging symbols: 0xa78be400 __kernel_sigreturn 0xa78be40c __kernel_rt_sigreturn 0xa78be414 __kernel_vsyscall (gdb) bt #0 0xa7183e2e in ?? () #1 0x08f352d0 in ?? () #2 0xa6f0ae57 in ?? () #3 0x08cea354 in ?? () #4 0xa7771878 in ?? () #5 0x00000000 in ?? () (gdb) i threads 2 Thread 603 0xa78be424 in __kernel_vsyscall () * 1 Thread 522 0xa7183e2e in ?? () (gdb) thread 2 [Switching to thread 2 (Thread 603)]#0 0xa78be424 in __kernel_vsyscall () (gdb) bt #0 0xa78be424 in __kernel_vsyscall () #1 0xa75f6c36 in ?? () #2 0xffffffff in ?? () #3 0x00000001 in ?? () #4 0xa724b27c in ?? () #5 0xa718edac in ?? () #6 0xa55023c0 in ?? () #7 0xa717e8b7 in ?? () #8 0xa55023c0 in ?? () #9 0xa717f04b in ?? () #10 0x00000001 in ?? () #11 0x00000001 in ?? () #12 0xa5e18328 in ?? () #13 0xa70cbed5 in ?? () #14 0x088bd0b0 in ?? () #15 0xa71a7bd0 in ?? () #16 0x00000000 in ?? () (gdb)