Bug 11511 - gcore doesn't work with orig_rax on Linux/amd64
Summary: gcore doesn't work with orig_rax on Linux/amd64
Status: RESOLVED FIXED
Alias: None
Product: gdb
Classification: Unclassified
Component: corefiles (show other bugs)
Version: 7.1
: P2 normal
Target Milestone: 7.1
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-17 13:25 UTC by H.J. Lu
Modified: 2010-04-17 18:57 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description H.J. Lu 2010-04-17 13:25:05 UTC
(gdb) b main
Breakpoint 1 at 0x4005d2: file gcore.c, line 68.
(gdb) r
Starting program: /export/home/hjl/bugs/gdb/core/64 

Breakpoint 1, main () at gcore.c:68
68	  factorial_func (6);
(gdb) info reg system
orig_rax       0xffffffffffffffff	-1
(gdb) gcore
Saved corefile core.26537
(gdb) 

[hjl@gnu-6 core]$ ./gdb 64 core.26537 
GNU gdb (GDB) 7.1.50.20100417-cvs
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
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 "x86_64-unknown-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /export/home/hjl/bugs/gdb/core/64...done.
[New Thread 26537]

warning: Can't read pathname for load map: Input/output error.
Reading symbols from /lib64/libc.so.6...(no debugging symbols found)...done.
Loaded symbols for /lib64/libc.so.6
Reading symbols from /lib64/ld-linux-x86-64.so.2...(no debugging symbols
found)...done.
Loaded symbols for /lib64/ld-linux-x86-64.so.2
Core was generated by `/export/home/hjl/bugs/gdb/core/64'.
Program terminated with signal 5, Trace/breakpoint trap.
#0  main () at gcore.c:68
68	  factorial_func (6);
Setting up the environment for debugging gdb.
Function "internal_error" not defined.
Make breakpoint pending on future shared library load? (y or [n]) [answered N;
input not from terminal]
Function "info_command" not defined.
Make breakpoint pending on future shared library load? (y or [n]) [answered N;
input not from terminal]
.gdbinit:8: Error in sourced command file:
Argument required (one or more breakpoint numbers).
(gdb) info reg system
orig_rax       0x0	0
(gdb)
Comment 1 H.J. Lu 2010-04-17 16:12:00 UTC
A patch is posted at

http://sourceware.org/ml/gdb-patches/2010-04/msg00530.html
Comment 2 Sourceware Commits 2010-04-17 18:54:10 UTC
Subject: Bug 11511

CVSROOT:	/cvs/src
Module name:	src
Changes by:	hjl@sourceware.org	2010-04-17 18:53:46

Modified files:
	gdb            : ChangeLog amd64-linux-tdep.c 
	gdb/testsuite  : ChangeLog 
Added files:
	gdb/testsuite/gdb.arch: gcore.c system-gcore.exp 

Log message:
	gdb/
	
	2010-04-17  H.J. Lu  <hongjiu.lu@intel.com>
	
	PR corefiles/11511
	* amd64-linux-tdep.c (amd64_linux_gregset_reg_offset): Support
	orig_rax.
	
	gdb/testsuite/
	
	2010-04-17  H.J. Lu  <hongjiu.lu@intel.com>
	
	PR corefiles/11511
	* gdb.arch/system-gcore.exp: New.
	* gdb.arch/gcore.c: Likewise.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/ChangeLog.diff?cvsroot=src&r1=1.11633&r2=1.11634
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/amd64-linux-tdep.c.diff?cvsroot=src&r1=1.34&r2=1.35
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/ChangeLog.diff?cvsroot=src&r1=1.2234&r2=1.2235
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/gdb.arch/gcore.c.diff?cvsroot=src&r1=NONE&r2=1.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/gdb.arch/system-gcore.exp.diff?cvsroot=src&r1=NONE&r2=1.1

Comment 3 H.J. Lu 2010-04-17 18:57:45 UTC
Fixed.