This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[PATCH] Add test for i386 standard prologue
- From: Mark Kettenis <kettenis at chello dot nl>
- To: gdb-patches at sources dot redhat dot com
- Date: Sun, 1 Aug 2004 16:49:58 +0200 (CEST)
- Subject: [PATCH] Add test for i386 standard prologue
I've committed this as it's fairly obvious. Wanted to have this
before I started fiddling with the i386 prologue analyzer :-).
Tested on i386-unknownd-freebsd4.7
Mark
Index: ChangeLog
from Mark Kettenis <kettenis@gnu.org>
* gdb.arch/i386-prologue.exp: Add testcase for standard prolgue.
* gdb.arch/i386-prologue.c (standard): New prototype and function.
(main): Call new function.
Index: gdb.arch/i386-prologue.c
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.arch/i386-prologue.c,v
retrieving revision 1.5
diff -u -p -r1.5 i386-prologue.c
--- gdb.arch/i386-prologue.c 23 Jul 2004 22:08:39 -0000 1.5
+++ gdb.arch/i386-prologue.c 1 Aug 2004 14:19:25 -0000
@@ -33,6 +33,7 @@ void jump_at_beginning (void);
int
main (void)
{
+ standard ();
gdb1253 ();
gdb1718 ();
gdb1338 ();
@@ -40,6 +41,18 @@ main (void)
return 0;
}
+/* A normal prologue. */
+
+asm(".text\n"
+ " .align 8\n"
+ SYMBOL (standard) ":\n"
+ " pushl %ebp\n"
+ " movl %esp, %ebp\n"
+ " pushl %edi\n"
+ " int $0x03\n"
+ " leave\n"
+ " ret\n");
+
/* Relevant part of the prologue from symtab/1253. */
asm(".text\n"
Index: gdb.arch/i386-prologue.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.arch/i386-prologue.exp,v
retrieving revision 1.7
diff -u -p -r1.7 i386-prologue.exp
--- gdb.arch/i386-prologue.exp 29 Jul 2004 22:02:57 -0000 1.7
+++ gdb.arch/i386-prologue.exp 1 Aug 2004 14:19:25 -0000
@@ -61,6 +61,18 @@ if ![runto_main] then {
gdb_suppress_tests
}
+# Testcase for standard prologue.
+
+gdb_test "continue" "Program received signal SIGTRAP.*" "continue to standard"
+
+gdb_test "backtrace 10" \
+ "#0\[ \t\]*$hex in standard.*\r\n#1\[ \t\]*$hex in main.*" \
+ "backtrace in standard"
+
+gdb_test "info frame" \
+ ".*Saved registers:.*ebp at.*edi at.*eip at.*" \
+ "saved registers in standard"
+
# Testcase from symtab/1253.
gdb_test "continue" "Program received signal SIGTRAP.*" "continue to gdb1253"