This is the mail archive of the
gdb-prs@sourceware.org
mailing list for the GDB project.
[Bug corefiles/11608] gcore does not support build-id
- From: "jan.kratochvil at redhat dot com" <sourceware-bugzilla at sourceware dot org>
- To: gdb-prs at sourceware dot org
- Date: Thu, 09 Aug 2012 08:41:34 +0000
- Subject: [Bug corefiles/11608] gcore does not support build-id
- Auto-submitted: auto-generated
- References: <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.