* [Bug backtrace/14646] [x32] backtrace doesn't work before main
2012-09-29 18:04 [Bug backtrace/14646] New: [x32] backtrace doesn't work before main hjl.tools at gmail dot com
@ 2012-09-29 23:25 ` hjl.tools at gmail dot com
2012-09-30 21:16 ` hjl.tools at gmail dot com
` (11 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: hjl.tools at gmail dot com @ 2012-09-29 23:25 UTC (permalink / raw)
To: gdb-prs
http://sourceware.org/bugzilla/show_bug.cgi?id=14646
--- Comment #1 from H.J. Lu <hjl.tools at gmail dot com> 2012-09-29 23:25:39 UTC ---
hjl/x32/gdb_7_4-branch git branch at
http://sourceware.org/git/?p=gdb.git;a=summary
works fine.
--
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.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug backtrace/14646] [x32] backtrace doesn't work before main
2012-09-29 18:04 [Bug backtrace/14646] New: [x32] backtrace doesn't work before main hjl.tools at gmail dot com
2012-09-29 23:25 ` [Bug backtrace/14646] " hjl.tools at gmail dot com
@ 2012-09-30 21:16 ` hjl.tools at gmail dot com
2012-10-01 16:13 ` jan.kratochvil at redhat dot com
` (10 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: hjl.tools at gmail dot com @ 2012-09-30 21:16 UTC (permalink / raw)
To: gdb-prs
http://sourceware.org/bugzilla/show_bug.cgi?id=14646
--- Comment #2 from H.J. Lu <hjl.tools at gmail dot com> 2012-09-30 21:16:04 UTC ---
amd64_x32_init_abi has
tdep->sp_regnum_from_eax = AMD64_RSP_REGNUM;
tdep->pc_regnum_from_eax = AMD64_RIP_REGNUM;
But unwind frame info is based on the real RSP/RIP
registers. Pseudo sp/pc registers don't work with
frame related codes:
[hjl@gnu-tools-1 gdb]$ egrep "pc_regnum|sp_regnum" *fram*.c
dwarf2-frame.c: if (regnum == gdbarch_pc_regnum (gdbarch))
dwarf2-frame.c: else if (regnum == gdbarch_sp_regnum (gdbarch))
dwarf2-frame.c: == gdbarch_sp_regnum (gdbarch)))
dwarf2-frame-tailcall.c: if (regnum == gdbarch_pc_regnum (this_gdbarch))
dwarf2-frame-tailcall.c: else if (cache->prev_sp_p && regnum ==
gdbarch_sp_regnum (this_gdbarch))
dwarf2-frame-tailcall.c: int sp_regnum;
dwarf2-frame-tailcall.c: sp_regnum = gdbarch_sp_regnum (prev_gdbarch);
dwarf2-frame-tailcall.c: if (sp_regnum == -1)
dwarf2-frame-tailcall.c: prev_sp = frame_unwind_register_unsigned
(this_frame, sp_regnum);
frame.c: && gdbarch_pc_regnum (gdbarch) >= 0
frame.c: gdbarch_pc_regnum (gdbarch),
frame.c: gdbarch_pc_regnum (gdbarch),
frame.c: the gdbarch_sp_regnum register is meaningful. */
frame.c: if (gdbarch_sp_regnum (gdbarch) >= 0)
frame.c: gdbarch_sp_regnum (gdbarch));
[hjl@gnu-tools-1 gdb]$
It is to print
(gdb) p $sp
$1 = (void *) 0xffffd028
instead of
(gdb) p $sp
$1 = 4294955048
But it breaks frame unwind.
--
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.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug backtrace/14646] [x32] backtrace doesn't work before main
2012-09-29 18:04 [Bug backtrace/14646] New: [x32] backtrace doesn't work before main hjl.tools at gmail dot com
2012-09-29 23:25 ` [Bug backtrace/14646] " hjl.tools at gmail dot com
2012-09-30 21:16 ` hjl.tools at gmail dot com
@ 2012-10-01 16:13 ` jan.kratochvil at redhat dot com
2012-10-01 16:31 ` [Bug backtrace/14646] [x32] backtrace doesn't work hjl.tools at gmail dot com
` (9 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: jan.kratochvil at redhat dot com @ 2012-10-01 16:13 UTC (permalink / raw)
To: gdb-prs
http://sourceware.org/bugzilla/show_bug.cgi?id=14646
Jan Kratochvil <jan.kratochvil at redhat dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jan.kratochvil at redhat
| |dot com
--- Comment #3 from Jan Kratochvil <jan.kratochvil at redhat dot com> 2012-10-01 16:13:27 UTC ---
Not taking this bug but it would be good to have a -nostdlib testcase for this
regression as it should be compatible with common x86_64 OSes.
--
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.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug backtrace/14646] [x32] backtrace doesn't work
2012-09-29 18:04 [Bug backtrace/14646] New: [x32] backtrace doesn't work before main hjl.tools at gmail dot com
` (2 preceding siblings ...)
2012-10-01 16:13 ` jan.kratochvil at redhat dot com
@ 2012-10-01 16:31 ` hjl.tools at gmail dot com
2012-10-01 16:55 ` jan.kratochvil at redhat dot com
` (8 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: hjl.tools at gmail dot com @ 2012-10-01 16:31 UTC (permalink / raw)
To: gdb-prs
http://sourceware.org/bugzilla/show_bug.cgi?id=14646
H.J. Lu <hjl.tools at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|[x32] backtrace doesn't |[x32] backtrace doesn't
|work before main |work
--- Comment #4 from H.J. Lu <hjl.tools at gmail dot com> 2012-10-01 16:31:07 UTC ---
(In reply to comment #3)
> Not taking this bug but it would be good to have a -nostdlib testcase for this
> regression as it should be compatible with common x86_64 OSes.
How should a -nostdlib testcase work? I believe such testcase only works
in x32 environment.
--
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.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug backtrace/14646] [x32] backtrace doesn't work
2012-09-29 18:04 [Bug backtrace/14646] New: [x32] backtrace doesn't work before main hjl.tools at gmail dot com
` (3 preceding siblings ...)
2012-10-01 16:31 ` [Bug backtrace/14646] [x32] backtrace doesn't work hjl.tools at gmail dot com
@ 2012-10-01 16:55 ` jan.kratochvil at redhat dot com
2012-10-01 17:14 ` hjl.tools at gmail dot com
` (7 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: jan.kratochvil at redhat dot com @ 2012-10-01 16:55 UTC (permalink / raw)
To: gdb-prs
http://sourceware.org/bugzilla/show_bug.cgi?id=14646
--- Comment #5 from Jan Kratochvil <jan.kratochvil at redhat dot com> 2012-10-01 16:55:45 UTC ---
While normal GDB testfiles run only on the native arch I believe x32 testfiles
could have an exception to run (also) with x86_64 testsuite run target.
Fedora 16 x86_64
gcc -o x32 x32.c -Wall -g -nostdlib -mx32
gdb ./x32
----------------------------
int f (void) {
volatile int i = 4, j = 2;
return i * 10 + j; }
int _start (void) {
f ();
return 0; }
----------------------------
gcc -dumpmachine
x86_64-unknown-linux-gnu
----------------------------
GNU gdb (GDB) 7.5.50.20120930-cvs
This GDB was configured as "x86_64-unknown-linux-gnu".
(gdb) b _start
Breakpoint 1 at 0x4000c1: file x32.c, line 5.
(gdb) r
Starting program: /home/jkratoch/t/x32
Breakpoint 1, _start () at x32.c:5
5 f ();
(gdb) s
f () at x32.c:2
2 volatile int i = 4, j = 2;
(gdb) fini
Run till exit from #0 f () at x32.c:2
_start () at x32.c:6
6 return 0; }
Value returned is $1 = 42
(gdb) _
--
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.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug backtrace/14646] [x32] backtrace doesn't work
2012-09-29 18:04 [Bug backtrace/14646] New: [x32] backtrace doesn't work before main hjl.tools at gmail dot com
` (4 preceding siblings ...)
2012-10-01 16:55 ` jan.kratochvil at redhat dot com
@ 2012-10-01 17:14 ` hjl.tools at gmail dot com
2012-10-01 17:20 ` jan.kratochvil at redhat dot com
` (6 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: hjl.tools at gmail dot com @ 2012-10-01 17:14 UTC (permalink / raw)
To: gdb-prs
http://sourceware.org/bugzilla/show_bug.cgi?id=14646
--- Comment #6 from H.J. Lu <hjl.tools at gmail dot com> 2012-10-01 17:14:35 UTC ---
(In reply to comment #5)
> While normal GDB testfiles run only on the native arch I believe x32 testfiles
> could have an exception to run (also) with x86_64 testsuite run target.
>
> Fedora 16 x86_64
> gcc -o x32 x32.c -Wall -g -nostdlib -mx32
How did you enable x32 support in your kernel?
My request to enable x32 in Fedora 18 kernel
was rejected.
--
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.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug backtrace/14646] [x32] backtrace doesn't work
2012-09-29 18:04 [Bug backtrace/14646] New: [x32] backtrace doesn't work before main hjl.tools at gmail dot com
` (5 preceding siblings ...)
2012-10-01 17:14 ` hjl.tools at gmail dot com
@ 2012-10-01 17:20 ` jan.kratochvil at redhat dot com
2012-10-01 17:33 ` hjl.tools at gmail dot com
` (5 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: jan.kratochvil at redhat dot com @ 2012-10-01 17:20 UTC (permalink / raw)
To: gdb-prs
http://sourceware.org/bugzilla/show_bug.cgi?id=14646
--- Comment #7 from Jan Kratochvil <jan.kratochvil at redhat dot com> 2012-10-01 17:20:15 UTC ---
Sorry I do not know more:
$ grep -i x32 /boot/config-3.4.11-1.fc16.x86_64
# CONFIG_X86_X32 is not set
--
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.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug backtrace/14646] [x32] backtrace doesn't work
2012-09-29 18:04 [Bug backtrace/14646] New: [x32] backtrace doesn't work before main hjl.tools at gmail dot com
` (6 preceding siblings ...)
2012-10-01 17:20 ` jan.kratochvil at redhat dot com
@ 2012-10-01 17:33 ` hjl.tools at gmail dot com
2012-10-01 17:59 ` jan.kratochvil at redhat dot com
` (4 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: hjl.tools at gmail dot com @ 2012-10-01 17:33 UTC (permalink / raw)
To: gdb-prs
http://sourceware.org/bugzilla/show_bug.cgi?id=14646
--- Comment #8 from H.J. Lu <hjl.tools at gmail dot com> 2012-10-01 17:33:35 UTC ---
(In reply to comment #7)
> Sorry I do not know more:
> $ grep -i x32 /boot/config-3.4.11-1.fc16.x86_64
> # CONFIG_X86_X32 is not set
This is very odd. Does your GCC really support -mx32?
What does "file x32" say?
--
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.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug backtrace/14646] [x32] backtrace doesn't work
2012-09-29 18:04 [Bug backtrace/14646] New: [x32] backtrace doesn't work before main hjl.tools at gmail dot com
` (7 preceding siblings ...)
2012-10-01 17:33 ` hjl.tools at gmail dot com
@ 2012-10-01 17:59 ` jan.kratochvil at redhat dot com
2012-10-01 18:42 ` hjl.tools at gmail dot com
` (3 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: jan.kratochvil at redhat dot com @ 2012-10-01 17:59 UTC (permalink / raw)
To: gdb-prs
http://sourceware.org/bugzilla/show_bug.cgi?id=14646
--- Comment #9 from Jan Kratochvil <jan.kratochvil at redhat dot com> 2012-10-01 17:59:26 UTC ---
OK, you are right; GCC has built it as x32 but the kernel executes it as
x86_64:
$ file x32
x32: ELF 32-bit LSB executable, x86-64, version 1 (SYSV), statically linked,
not stripped
(gdb) disas
Dump of assembler code for function f:
=> 0x00400094 <+0>: push %rbp
[...]
(gdb) p/x $sp
$1 = 0xffffce20
(gdb) stepi
0x00400095 1 int f (void) {
(gdb) p/x $sp
$2 = 0xffffce18
--
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.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug backtrace/14646] [x32] backtrace doesn't work
2012-09-29 18:04 [Bug backtrace/14646] New: [x32] backtrace doesn't work before main hjl.tools at gmail dot com
` (8 preceding siblings ...)
2012-10-01 17:59 ` jan.kratochvil at redhat dot com
@ 2012-10-01 18:42 ` hjl.tools at gmail dot com
2012-10-15 20:37 ` cvs-commit at gcc dot gnu.org
` (2 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: hjl.tools at gmail dot com @ 2012-10-01 18:42 UTC (permalink / raw)
To: gdb-prs
http://sourceware.org/bugzilla/show_bug.cgi?id=14646
--- Comment #10 from H.J. Lu <hjl.tools at gmail dot com> 2012-10-01 18:42:07 UTC ---
(In reply to comment #9)
> OK, you are right; GCC has built it as x32 but the kernel executes it as
> x86_64:
>
> $ file x32
> x32: ELF 32-bit LSB executable, x86-64, version 1 (SYSV), statically linked,
> not stripped
>
Your kernel has partial x32 support. I don't think we should
count on it. It is better to run x32 tests in x32 environment.
--
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.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug backtrace/14646] [x32] backtrace doesn't work
2012-09-29 18:04 [Bug backtrace/14646] New: [x32] backtrace doesn't work before main hjl.tools at gmail dot com
` (9 preceding siblings ...)
2012-10-01 18:42 ` hjl.tools at gmail dot com
@ 2012-10-15 20:37 ` cvs-commit at gcc dot gnu.org
2012-11-10 0:50 ` cvs-commit at gcc dot gnu.org
2012-11-10 0:52 ` hjl.tools at gmail dot com
12 siblings, 0 replies; 14+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2012-10-15 20:37 UTC (permalink / raw)
To: gdb-prs
http://sourceware.org/bugzilla/show_bug.cgi?id=14646
--- Comment #11 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> 2012-10-15 20:37:44 UTC ---
CVSROOT: /cvs/src
Module name: src
Changes by: hjl@sourceware.org 2012-10-15 20:37:39
Modified files:
gdb : ChangeLog amd64-tdep.c i386-tdep.c i386-tdep.h
Log message:
Remove sp_regnum_from_eax and pc_regnum_from_eax
PR backtrace/14646
PR gdb/14647
* i386-tdep.h (gdbarch_tdep): Remove sp_regnum_from_eax and
pc_regnum_from_eax.
* i386-tdep.c (i386_gdbarch_init): Don't use sp_regnum_from_eax
nor pc_regnum_from_eax.
* amd64-tdep.c (amd64_x32_init_abi): Don't set sp_regnum_from_eax
nor pc_regnum_from_eax.
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/ChangeLog.diff?cvsroot=src&r1=1.14736&r2=1.14737
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/amd64-tdep.c.diff?cvsroot=src&r1=1.112&r2=1.113
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/i386-tdep.c.diff?cvsroot=src&r1=1.357&r2=1.358
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/i386-tdep.h.diff?cvsroot=src&r1=1.80&r2=1.81
--
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.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug backtrace/14646] [x32] backtrace doesn't work
2012-09-29 18:04 [Bug backtrace/14646] New: [x32] backtrace doesn't work before main hjl.tools at gmail dot com
` (10 preceding siblings ...)
2012-10-15 20:37 ` cvs-commit at gcc dot gnu.org
@ 2012-11-10 0:50 ` cvs-commit at gcc dot gnu.org
2012-11-10 0:52 ` hjl.tools at gmail dot com
12 siblings, 0 replies; 14+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2012-11-10 0:50 UTC (permalink / raw)
To: gdb-prs
http://sourceware.org/bugzilla/show_bug.cgi?id=14646
--- Comment #12 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> 2012-11-10 00:50:53 UTC ---
CVSROOT: /cvs/src
Module name: src
Branch: gdb_7_5-branch
Changes by: hjl@sourceware.org 2012-11-10 00:50:46
Modified files:
gdb : ChangeLog amd64-tdep.c i386-tdep.c i386-tdep.h
Log message:
Remove sp_regnum_from_eax and pc_regnum_from_eax
PR backtrace/14646
PR gdb/14647
* i386-tdep.h (gdbarch_tdep): Remove sp_regnum_from_eax and
pc_regnum_from_eax.
* i386-tdep.c (i386_gdbarch_init): Don't use sp_regnum_from_eax
nor pc_regnum_from_eax.
* amd64-tdep.c (amd64_x32_init_abi): Don't set sp_regnum_from_eax
nor pc_regnum_from_eax.
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/ChangeLog.diff?cvsroot=src&only_with_tag=gdb_7_5-branch&r1=1.14469.2.37&r2=1.14469.2.38
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/amd64-tdep.c.diff?cvsroot=src&only_with_tag=gdb_7_5-branch&r1=1.109&r2=1.109.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/i386-tdep.c.diff?cvsroot=src&only_with_tag=gdb_7_5-branch&r1=1.355&r2=1.355.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/i386-tdep.h.diff?cvsroot=src&only_with_tag=gdb_7_5-branch&r1=1.80&r2=1.80.2.1
--
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.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug backtrace/14646] [x32] backtrace doesn't work
2012-09-29 18:04 [Bug backtrace/14646] New: [x32] backtrace doesn't work before main hjl.tools at gmail dot com
` (11 preceding siblings ...)
2012-11-10 0:50 ` cvs-commit at gcc dot gnu.org
@ 2012-11-10 0:52 ` hjl.tools at gmail dot com
12 siblings, 0 replies; 14+ messages in thread
From: hjl.tools at gmail dot com @ 2012-11-10 0:52 UTC (permalink / raw)
To: gdb-prs
http://sourceware.org/bugzilla/show_bug.cgi?id=14646
H.J. Lu <hjl.tools at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
Target Milestone|--- |7.5
--- Comment #13 from H.J. Lu <hjl.tools at gmail dot com> 2012-11-10 00:52:07 UTC ---
Fixed on 7.5 branch.
--
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.
^ permalink raw reply [flat|nested] 14+ messages in thread