public inbox for archer-commits@sourceware.org
help / color / mirror / Atom feed
* [SCM] archer-jankratochvil-entryval: Fix `@entry' for C++.
@ 2011-07-10 20:04 jkratoch
0 siblings, 0 replies; only message in thread
From: jkratoch @ 2011-07-10 20:04 UTC (permalink / raw)
To: archer-commits
The branch, archer-jankratochvil-entryval has been updated
via 7b006f3642006079363d1409e9ce36f738c09851 (commit)
from e4173bfef94aeb5847c6b6a1a8c792aaaea238b5 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email.
- Log -----------------------------------------------------------------
commit 7b006f3642006079363d1409e9ce36f738c09851
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date: Sun Jul 10 22:03:54 2011 +0200
Fix `@entry' for C++.
-----------------------------------------------------------------------
Summary of changes:
gdb/c-exp.y | 10 +-
.../{amd64-entry-value.c => amd64-entry-value.cc} | 14 +-
gdb/testsuite/gdb.arch/amd64-entry-value.exp | 34 +-
gdb/testsuite/gdb.arch/amd64-entry-value.s | 1395 ++++++++++++--------
gdb/testsuite/gdb.cp/koenig.cc | 6 +
gdb/testsuite/gdb.cp/koenig.exp | 3 +
6 files changed, 877 insertions(+), 585 deletions(-)
rename gdb/testsuite/gdb.arch/{amd64-entry-value.c => amd64-entry-value.cc} (89%)
First 500 lines of diff:
diff --git a/gdb/c-exp.y b/gdb/c-exp.y
index 0c0a53b..5b40002 100644
--- a/gdb/c-exp.y
+++ b/gdb/c-exp.y
@@ -194,6 +194,7 @@ static struct stoken operator_stoken (const char *);
%type <svec> string_exp
%type <ssym> name_not_typename
%type <tsym> typename
+%type <ssym> unknown_cpp_name
/* A NAME_OR_INT is a symbol which is not known in the symbol table,
but which would parse as a valid number in the current input radix.
@@ -393,7 +394,7 @@ exp : exp '('
write_exp_elt_opcode (OP_FUNCALL); }
;
-exp : UNKNOWN_CPP_NAME '('
+exp : unknown_cpp_name '('
{
/* This could potentially be a an argument defined
lookup function (Koenig). */
@@ -416,6 +417,10 @@ exp : UNKNOWN_CPP_NAME '('
}
;
+unknown_cpp_name : UNKNOWN_CPP_NAME
+ | ENTRY
+ ;
+
lcurly : '{'
{ start_arglist (); }
;
@@ -2543,7 +2548,8 @@ yylex (void)
current.token = lex_one_token ();
if (current.token == NAME)
current.token = classify_name (expression_context_block);
- if (current.token == NAME && yylval.sval.length == strlen ("entry")
+ if ((current.token == NAME || current.token == UNKNOWN_CPP_NAME)
+ && yylval.sval.length == strlen ("entry")
&& strncmp (yylval.sval.ptr, "entry", strlen ("entry")) == 0)
current.token = ENTRY;
diff --git a/gdb/testsuite/gdb.arch/amd64-entry-value.c b/gdb/testsuite/gdb.arch/amd64-entry-value.cc
similarity index 89%
rename from gdb/testsuite/gdb.arch/amd64-entry-value.c
rename to gdb/testsuite/gdb.arch/amd64-entry-value.cc
index 2ff3b13..fd5463c 100644
--- a/gdb/testsuite/gdb.arch/amd64-entry-value.c
+++ b/gdb/testsuite/gdb.arch/amd64-entry-value.cc
@@ -30,6 +30,7 @@ d (int i)
e (i);
e (v);
asm ("breakhere:");
+ e (v);
}
static void __attribute__((noinline, noclone))
@@ -112,10 +113,21 @@ self (int i)
}
}
+static void __attribute__((noinline, noclone))
+stacktest (int r1, int r2, int r3, int r4, int r5, int r6, int s1, int s2)
+{
+ s1 = 3;
+ s2 = 4;
+ e (v);
+asm ("breakhere_stacktest:");
+ e (v);
+}
+
int
-main (void)
+main ()
{
d (30);
+ stacktest (1, 2, 3, 4, 5, 6, 11, 12);
if (v)
a (1);
else
diff --git a/gdb/testsuite/gdb.arch/amd64-entry-value.exp b/gdb/testsuite/gdb.arch/amd64-entry-value.exp
index 8905acf..76b9f85 100644
--- a/gdb/testsuite/gdb.arch/amd64-entry-value.exp
+++ b/gdb/testsuite/gdb.arch/amd64-entry-value.exp
@@ -35,9 +35,9 @@ gdb_breakpoint "breakhere"
gdb_continue_to_breakpoint "entry: breakhere"
# (gdb) bt full
-# #0 d (i=31) at gdb.arch/amd64-entry-value.c:33
+# #0 d (i=31) at gdb.arch/amd64-entry-value.cc:33
# i@entry = 30
-# #1 0x00000000004003da in main () at gdb.arch/amd64-entry-value.c:56
+# #1 0x00000000004003da in main () at gdb.arch/amd64-entry-value.cc:56
# No locals.
gdb_test "bt full" "^bt full\r\n#0 +d *\\(i=31\\) \[^\r\n\]*\r\n\[ \t\]*i@entry = 30\r\n#1 +0x\[0-9a-f\]+ in main .*" \
"entry: bt full"
@@ -49,10 +49,10 @@ gdb_test "p i@entry" " = 30" "entry: p i@entry"
gdb_continue_to_breakpoint "tailcall: breakhere"
-# #0 d (i=71) at gdb.arch/amd64-entry-value.c:33
-# #1 0x0000000000400527 in c (i=7) at gdb.arch/amd64-entry-value.c:38
-# #2 0x0000000000400545 in b (i=5) at gdb.arch/amd64-entry-value.c:50
-# #3 0x00000000004003ee in main () at gdb.arch/amd64-entry-value.c:60
+# #0 d (i=71) at gdb.arch/amd64-entry-value.cc:33
+# #1 0x0000000000400527 in c (i=7) at gdb.arch/amd64-entry-value.cc:38
+# #2 0x0000000000400545 in b (i=5) at gdb.arch/amd64-entry-value.cc:50
+# #3 0x00000000004003ee in main () at gdb.arch/amd64-entry-value.cc:60
gdb_test "bt" "^bt\r\n#0 +d *\\(i=71\\) \[^\r\n\]*\r\n#1 +0x\[0-9a-f\]+ in c \\(i=7\\) \[^\r\n\]*\r\n#2 +0x\[0-9a-f\]+ in b \\(i=5\\) \[^\r\n\]*\r\n#3 +0x\[0-9a-f\]+ in main \[^\r\n\]*" \
"tailcall: bt"
gdb_test "p i" " = 71" "tailcall: p i"
@@ -63,14 +63,14 @@ gdb_test "p i@entry" " = 70" "tailcall: p i@entry"
gdb_continue_to_breakpoint "ambiguous: breakhere"
-# #0 d (i=<optimized out>) at gdb.arch/amd64-entry-value.c:33
-# #1 0x0000000000400555 in amb_z (i=<optimized out>) at gdb.arch/amd64-entry-value.c:56
-# #2 0x0000000000400565 in amb_y (i=<optimized out>) at gdb.arch/amd64-entry-value.c:62
-# #3 0x0000000000400575 in amb_x (i=<optimized out>) at gdb.arch/amd64-entry-value.c:68
+# #0 d (i=<optimized out>) at gdb.arch/amd64-entry-value.cc:33
+# #1 0x0000000000400555 in amb_z (i=<optimized out>) at gdb.arch/amd64-entry-value.cc:56
+# #2 0x0000000000400565 in amb_y (i=<optimized out>) at gdb.arch/amd64-entry-value.cc:62
+# #3 0x0000000000400575 in amb_x (i=<optimized out>) at gdb.arch/amd64-entry-value.cc:68
# --- here is missing a frame for ambiguous PC in amb ().
-# #4 0x0000000000400595 in amb_b (i=101) at gdb.arch/amd64-entry-value.c:83
-# #5 0x00000000004005a5 in amb_a (i=100) at gdb.arch/amd64-entry-value.c:89
-# #6 0x00000000004003f8 in main () at gdb.arch/amd64-entry-value.c:100
+# #4 0x0000000000400595 in amb_b (i=101) at gdb.arch/amd64-entry-value.cc:83
+# #5 0x00000000004005a5 in amb_a (i=100) at gdb.arch/amd64-entry-value.cc:89
+# #6 0x00000000004003f8 in main () at gdb.arch/amd64-entry-value.cc:100
gdb_test "bt" "^bt\r\n#0 +d \\(i=<optimized out>\\)\[^\r\n\]*\r\n#1 +0x\[0-9a-f\]+ in amb_z \\(i=<optimized out>\\)\[^\r\n\]*\r\n#2 +0x\[0-9a-f\]+ in amb_y \\(i=<optimized out>\\)\[^\r\n\]*\r\n#3 +0x\[0-9a-f\]+ in amb_x \\(i=<optimized out>\\)\[^\r\n\]*\r\n#4 +0x\[0-9a-f\]+ in amb_b \\(i=101\\)\[^\r\n\]*\r\n#5 +0x\[0-9a-f\]+ in amb_a \\(i=100\\)\[^\r\n\]*\r\n#6 +0x\[0-9a-f\]+ in main \\(\\)\[^\r\n\]*" \
"ambiguous: bt"
@@ -80,12 +80,12 @@ gdb_test "bt" "^bt\r\n#0 +d \\(i=<optimized out>\\)\[^\r\n\]*\r\n#1 +0x\[0-9a-f\
gdb_continue_to_breakpoint "self: breakhere"
-# #0 d (i=<optimized out>) at gdb.arch/amd64-entry-value.c:33
-# #1 0x00000000004005df in self (i=<optimized out>) at gdb.arch/amd64-entry-value.c:111
-# #2 0x0000000000400406 in main () at gdb.arch/amd64-entry-value.c:124
+# #0 d (i=<optimized out>) at gdb.arch/amd64-entry-value.cc:33
+# #1 0x00000000004005df in self (i=<optimized out>) at gdb.arch/amd64-entry-value.cc:111
+# #2 0x0000000000400406 in main () at gdb.arch/amd64-entry-value.cc:124
gdb_test "bt" "^bt\r\n#0 +d \\(i=<optimized out>\\)\[^\r\n\]*\r\n#1 +0x\[0-9a-f\]+ in self \\(i=<optimized out>\\)\[^\r\n\]*\r\n#2 +0x\[0-9a-f\]+ in main \\(\\)\[^\r\n\]*" \
"self: bt"
gdb_test_no_output "set verbose on"
-gdb_test "bt" "DW_OP_GNU_entry_value resolving has found function \"self\" at 0x\[0-9a-f\]+ can call itself via tail calls\r\n.*" \
+gdb_test "bt" "DW_OP_GNU_entry_value resolving has found function \"self\\(int\\)\" at 0x\[0-9a-f\]+ can call itself via tail calls\r\n.*" \
"self: bt verbose"
diff --git a/gdb/testsuite/gdb.arch/amd64-entry-value.s b/gdb/testsuite/gdb.arch/amd64-entry-value.s
index 0994854..2b971fb 100644
--- a/gdb/testsuite/gdb.arch/amd64-entry-value.s
+++ b/gdb/testsuite/gdb.arch/amd64-entry-value.s
@@ -18,313 +18,315 @@
/* This file is compiled form gdb.arch/amd64-entry-value.c
using -g -dA -S -O2. */
- .file "amd64-entry-value.c"
+ .file "amd64-entry-value.cc"
.text
.Ltext0:
.p2align 4,,15
- .type e, @function
-e:
+ .type _ZL1ei, @function
+_ZL1ei:
.LFB0:
- .file 1 "gdb.arch/amd64-entry-value.c"
- # gdb.arch/amd64-entry-value.c:22
+ .file 1 "gdb.arch/amd64-entry-value.cc"
+ # gdb.arch/amd64-entry-value.cc:22
.loc 1 22 0
.cfi_startproc
.LVL0:
# BLOCK 2 freq:10000 seq:0
# PRED: ENTRY [100.0%] (fallthru)
- # gdb.arch/amd64-entry-value.c:23
+ # gdb.arch/amd64-entry-value.cc:23
.loc 1 23 0
- movl $0, v(%rip)
+ movl $0, _ZL1v(%rip)
# SUCC: EXIT [100.0%]
- # gdb.arch/amd64-entry-value.c:24
+ # gdb.arch/amd64-entry-value.cc:24
.loc 1 24 0
ret
.cfi_endproc
.LFE0:
- .size e, .-e
+ .size _ZL1ei, .-_ZL1ei
.p2align 4,,15
- .type d, @function
-d:
+ .type _ZL1di, @function
+_ZL1di:
.LFB1:
- # gdb.arch/amd64-entry-value.c:28
+ # gdb.arch/amd64-entry-value.cc:28
.loc 1 28 0
.cfi_startproc
.LVL1:
# BLOCK 2 freq:10000 seq:0
# PRED: ENTRY [100.0%] (fallthru)
- # gdb.arch/amd64-entry-value.c:29
+ # gdb.arch/amd64-entry-value.cc:29
.loc 1 29 0
addl $1, %edi
.LVL2:
- # gdb.arch/amd64-entry-value.c:30
+ # gdb.arch/amd64-entry-value.cc:30
.loc 1 30 0
- call e
+ call _ZL1ei
.LVL3:
- # gdb.arch/amd64-entry-value.c:31
+ # gdb.arch/amd64-entry-value.cc:31
.loc 1 31 0
- movl v(%rip), %edi
- call e
+ movl _ZL1v(%rip), %edi
+ call _ZL1ei
.LVL4:
- # gdb.arch/amd64-entry-value.c:32
+ # gdb.arch/amd64-entry-value.cc:32
.loc 1 32 0
#APP
-# 32 "gdb.arch/amd64-entry-value.c" 1
+# 32 "gdb.arch/amd64-entry-value.cc" 1
breakhere:
# 0 "" 2
-# SUCC: EXIT [100.0%]
- # gdb.arch/amd64-entry-value.c:33
+ # gdb.arch/amd64-entry-value.cc:33
.loc 1 33 0
#NO_APP
- ret
+ movl _ZL1v(%rip), %edi
+ jmp _ZL1ei
+# SUCC: EXIT [100.0%] (ab,sibcall)
+.LVL5:
.cfi_endproc
.LFE1:
- .size d, .-d
+ .size _ZL1di, .-_ZL1di
.p2align 4,,15
- .type c, @function
-c:
+ .type _ZL1ci, @function
+_ZL1ci:
.LFB2:
- # gdb.arch/amd64-entry-value.c:37
- .loc 1 37 0
+ # gdb.arch/amd64-entry-value.cc:38
+ .loc 1 38 0
.cfi_startproc
-.LVL5:
+.LVL6:
# BLOCK 2 freq:10000 seq:0
# PRED: ENTRY [100.0%] (fallthru)
- # gdb.arch/amd64-entry-value.c:38
- .loc 1 38 0
+ # gdb.arch/amd64-entry-value.cc:39
+ .loc 1 39 0
leal (%rdi,%rdi,4), %edi
-.LVL6:
+.LVL7:
addl %edi, %edi
- jmp d
+ jmp _ZL1di
# SUCC: EXIT [100.0%] (ab,sibcall)
-.LVL7:
+.LVL8:
.cfi_endproc
.LFE2:
- .size c, .-c
+ .size _ZL1ci, .-_ZL1ci
.p2align 4,,15
- .type a, @function
-a:
+ .type _ZL1ai, @function
+_ZL1ai:
.LFB3:
- # gdb.arch/amd64-entry-value.c:43
- .loc 1 43 0
+ # gdb.arch/amd64-entry-value.cc:44
+ .loc 1 44 0
.cfi_startproc
-.LVL8:
+.LVL9:
# BLOCK 2 freq:10000 seq:0
# PRED: ENTRY [100.0%] (fallthru)
- # gdb.arch/amd64-entry-value.c:44
- .loc 1 44 0
+ # gdb.arch/amd64-entry-value.cc:45
+ .loc 1 45 0
addl $1, %edi
-.LVL9:
- jmp c
.LVL10:
+ jmp _ZL1ci
+.LVL11:
# SUCC: EXIT [100.0%] (ab,sibcall)
.cfi_endproc
.LFE3:
- .size a, .-a
+ .size _ZL1ai, .-_ZL1ai
.p2align 4,,15
- .type b, @function
-b:
+ .type _ZL1bi, @function
+_ZL1bi:
.LFB4:
- # gdb.arch/amd64-entry-value.c:49
- .loc 1 49 0
+ # gdb.arch/amd64-entry-value.cc:50
+ .loc 1 50 0
.cfi_startproc
-.LVL11:
+.LVL12:
# BLOCK 2 freq:10000 seq:0
# PRED: ENTRY [100.0%] (fallthru)
- # gdb.arch/amd64-entry-value.c:50
- .loc 1 50 0
+ # gdb.arch/amd64-entry-value.cc:51
+ .loc 1 51 0
addl $2, %edi
-.LVL12:
- jmp c
.LVL13:
+ jmp _ZL1ci
+.LVL14:
# SUCC: EXIT [100.0%] (ab,sibcall)
.cfi_endproc
.LFE4:
- .size b, .-b
+ .size _ZL1bi, .-_ZL1bi
.p2align 4,,15
- .type amb_z, @function
-amb_z:
+ .type _ZL5amb_zi, @function
+_ZL5amb_zi:
.LFB5:
- # gdb.arch/amd64-entry-value.c:55
- .loc 1 55 0
+ # gdb.arch/amd64-entry-value.cc:56
+ .loc 1 56 0
.cfi_startproc
-.LVL14:
+.LVL15:
# BLOCK 2 freq:10000 seq:0
# PRED: ENTRY [100.0%] (fallthru)
- # gdb.arch/amd64-entry-value.c:56
- .loc 1 56 0
+ # gdb.arch/amd64-entry-value.cc:57
+ .loc 1 57 0
addl $7, %edi
-.LVL15:
- jmp d
.LVL16:
+ jmp _ZL1di
+.LVL17:
# SUCC: EXIT [100.0%] (ab,sibcall)
.cfi_endproc
.LFE5:
- .size amb_z, .-amb_z
+ .size _ZL5amb_zi, .-_ZL5amb_zi
.p2align 4,,15
- .type amb_y, @function
-amb_y:
+ .type _ZL5amb_yi, @function
+_ZL5amb_yi:
.LFB6:
- # gdb.arch/amd64-entry-value.c:61
- .loc 1 61 0
+ # gdb.arch/amd64-entry-value.cc:62
+ .loc 1 62 0
.cfi_startproc
-.LVL17:
+.LVL18:
# BLOCK 2 freq:10000 seq:0
# PRED: ENTRY [100.0%] (fallthru)
- # gdb.arch/amd64-entry-value.c:62
- .loc 1 62 0
+ # gdb.arch/amd64-entry-value.cc:63
+ .loc 1 63 0
addl $6, %edi
-.LVL18:
- jmp amb_z
.LVL19:
+ jmp _ZL5amb_zi
+.LVL20:
# SUCC: EXIT [100.0%] (ab,sibcall)
.cfi_endproc
.LFE6:
- .size amb_y, .-amb_y
+ .size _ZL5amb_yi, .-_ZL5amb_yi
.p2align 4,,15
- .type amb_x, @function
-amb_x:
+ .type _ZL5amb_xi, @function
+_ZL5amb_xi:
.LFB7:
- # gdb.arch/amd64-entry-value.c:67
- .loc 1 67 0
+ # gdb.arch/amd64-entry-value.cc:68
+ .loc 1 68 0
.cfi_startproc
-.LVL20:
+.LVL21:
# BLOCK 2 freq:10000 seq:0
# PRED: ENTRY [100.0%] (fallthru)
- # gdb.arch/amd64-entry-value.c:68
- .loc 1 68 0
+ # gdb.arch/amd64-entry-value.cc:69
+ .loc 1 69 0
addl $5, %edi
-.LVL21:
- jmp amb_y
.LVL22:
+ jmp _ZL5amb_yi
+.LVL23:
# SUCC: EXIT [100.0%] (ab,sibcall)
.cfi_endproc
.LFE7:
- .size amb_x, .-amb_x
+ .size _ZL5amb_xi, .-_ZL5amb_xi
.p2align 4,,15
- .type amb, @function
-amb:
+ .type _ZL3ambi, @function
+_ZL3ambi:
.LFB8:
- # gdb.arch/amd64-entry-value.c:73
- .loc 1 73 0
+ # gdb.arch/amd64-entry-value.cc:74
+ .loc 1 74 0
.cfi_startproc
-.LVL23:
+.LVL24:
# BLOCK 2 freq:10000 seq:0
# PRED: ENTRY [100.0%] (fallthru)
- # gdb.arch/amd64-entry-value.c:74
- .loc 1 74 0
+ # gdb.arch/amd64-entry-value.cc:75
+ .loc 1 75 0
testl %edi, %edi
# SUCC: 4 [19.1%] (can_fallthru) 3 [80.9%] (fallthru,can_fallthru)
js .L12
# BLOCK 3 freq:8088 seq:1
# PRED: 2 [80.9%] (fallthru,can_fallthru)
- # gdb.arch/amd64-entry-value.c:77
- .loc 1 77 0
+ # gdb.arch/amd64-entry-value.cc:78
+ .loc 1 78 0
addl $4, %edi
-.LVL24:
- jmp amb_x
.LVL25:
+ jmp _ZL5amb_xi
+.LVL26:
# SUCC: EXIT [100.0%] (ab,sibcall)
# BLOCK 4 freq:1912 seq:2
# PRED: 2 [19.1%] (can_fallthru)
.L12:
- # gdb.arch/amd64-entry-value.c:75
- .loc 1 75 0
+ # gdb.arch/amd64-entry-value.cc:76
+ .loc 1 76 0
addl $3, %edi
-.LVL26:
- jmp amb_x
.LVL27:
+ jmp _ZL5amb_xi
+.LVL28:
# SUCC: EXIT [100.0%] (ab,sibcall)
.cfi_endproc
.LFE8:
- .size amb, .-amb
+ .size _ZL3ambi, .-_ZL3ambi
.p2align 4,,15
- .type amb_b, @function
-amb_b:
+ .type _ZL5amb_bi, @function
+_ZL5amb_bi:
.LFB9:
- # gdb.arch/amd64-entry-value.c:82
- .loc 1 82 0
+ # gdb.arch/amd64-entry-value.cc:83
+ .loc 1 83 0
.cfi_startproc
-.LVL28:
+.LVL29:
# BLOCK 2 freq:10000 seq:0
# PRED: ENTRY [100.0%] (fallthru)
- # gdb.arch/amd64-entry-value.c:83
- .loc 1 83 0
+ # gdb.arch/amd64-entry-value.cc:84
+ .loc 1 84 0
addl $2, %edi
hooks/post-receive
--
Repository for Project Archer.
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2011-07-10 20:04 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-10 20:04 [SCM] archer-jankratochvil-entryval: Fix `@entry' for C++ jkratoch
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).