public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "jan.kratochvil at redhat dot com" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug corefiles/11608] gcore does not support build-id
Date: Thu, 09 Aug 2012 08:42:00 -0000	[thread overview]
Message-ID: <bug-11608-4717-ExNgrV6Nju@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-11608-4717@http.sourceware.org/bugzilla/>

http://sourceware.org/bugzilla/show_bug.cgi?id=11608

Jan Kratochvil <jan.kratochvil at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jan.kratochvil at redhat
                   |                            |dot com
            Version|unknown                     |7.5

--- Comment #1 from Jan Kratochvil <jan.kratochvil at redhat dot com> 2012-08-09 08:41:34 UTC ---
In practice it works now although it depends on something accidentally
happening in Linux kernel:

echo 'const int i[2000]={0};void _start(void){}'|gcc -Wall -nostdlib
-fno-asynchronous-unwind-tables -Wl,--build-id -x c -;gdb -nx ./a.out -ex 'b
*_start' -ex r -ex 'gcore core' -ex 'set confirm no' -ex q;eu-unstrip -n
--core=core
[...]
0x400000+0x400000 2fb48d92cfa19eb24524f14211565853e3da3deb@0x400284 - - [exe]

It works since:
http://sourceware.org/ml/gdb-patches/2012-08/msg00225.html

But it is more accidental:
$ cat /proc/22440/smaps
00400000-00401000 r-xp 00000000 fd:02 15079087 /home/jkratoch/t/a.out
Shared_Dirty:          0 kB
Private_Dirty:         4 kB
Anonymous:             4 kB
Swap:                  0 kB

Despite it is r-x Linux kernel had to write there some data - see Private_Dirty
and Anonymous.  I do not know why, Linux kernel hackers could advice.

gcc (GCC) 4.7.2 20120809 (prerelease)
GNU gdb (GDB) 7.5.50.20120809-cvs
binutils-2.22.52.0.4-8.fc18.x86_64
kernel-3.4.6-1.fc16.x86_64

The right fix would be to see the '[exe]' line even with gdb-7.5 or earlier
(not FSF GDB HEAD where is committed the patch for PR 11804 above).  Earlier
GDBs did not pay attention to the 4 lines in smaps and thus they did not dump
the build-id page so that the '[exe]' line was not visible.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


       reply	other threads:[~2012-08-09  8:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-11608-4717@http.sourceware.org/bugzilla/>
2012-08-09  8:42 ` jan.kratochvil at redhat dot com [this message]
2013-11-13  6:23 ` jan.kratochvil at redhat dot com
2010-05-17 13:17 [Bug corefiles/11608] New: " jan dot kratochvil at redhat dot com
2010-05-17 13:52 ` [Bug corefiles/11608] " mjw at redhat dot com
2010-05-24  4:53 ` ppluzhnikov at google dot com

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=bug-11608-4717-ExNgrV6Nju@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@sourceware.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).