This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Testcase for breakpoints/2080


I've got a fix too, but I need to polish it a bit.

Committed,

Mark


Index: ChangeLog
from  Mark Kettenis  <kettenis@gnu.org>

	* gdb.arch/i386-prologue.exp: Add testcase for PR breakpoints/2080.

Index: gdb.arch/i386-prologue.c
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.arch/i386-prologue.c,v
retrieving revision 1.6
diff -u -p -r1.6 i386-prologue.c
--- gdb.arch/i386-prologue.c 1 Aug 2004 14:28:51 -0000 1.6
+++ gdb.arch/i386-prologue.c 13 Feb 2006 22:31:40 -0000
@@ -1,6 +1,6 @@
 /* Unwinder test program.
 
-   Copyright 2003, 2004 Free Software Foundation, Inc.
+   Copyright (C) 2003, 2004, 2006 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -34,6 +34,7 @@ int
 main (void)
 {
   standard ();
+  stack_align ();
   gdb1253 ();
   gdb1718 ();
   gdb1338 ();
@@ -110,3 +111,20 @@ asm(".text\n"
     "    movl  %ebp,%esp\n"
     "    popl  %ebp\n"
     "    ret\n");
+
+asm(".text\n"
+    "    .align 8\n"
+    SYMBOL (stack_align) ":\n"
+    "    leal  4(%esp), %ecx\n"
+    "    andl  $-16, %esp\n"
+    "    pushl -4(%ecx)\n"
+    "    pushl %ebp\n"
+    "    movl  %esp, %ebp\n"
+    "    pushl %edi\n"
+    "    pushl %ecx\n"
+    "    int   $0x03\n"
+    "    popl  %ecx\n"
+    "    popl  %edi\n"
+    "    popl  %ebp\n"
+    "    leal  -4(%ecx), %esp\n"
+    "    ret\n");
Index: gdb.arch/i386-prologue.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.arch/i386-prologue.exp,v
retrieving revision 1.10
diff -u -p -r1.10 i386-prologue.exp
--- gdb.arch/i386-prologue.exp 20 Aug 2004 22:15:03 -0000 1.10
+++ gdb.arch/i386-prologue.exp 13 Feb 2006 22:31:40 -0000
@@ -1,4 +1,4 @@
-# Copyright 2003, 2004 Free Software Foundation, Inc.
+# Copyright (C) 2003, 2004, 2006 Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -93,6 +93,38 @@ gdb_test "info frame" \
 	".*Saved registers:.*ebp at.*edi at.*eip at.*" \
 	"saved registers in standard"
 
+
+# Testcase from breakpoints/2080.
+
+gdb_test "break *(stack_align + 7)" \
+	"Breakpoint \[0-9\]* at $hex"
+
+gdb_test "continue" \
+	"Breakpoint \[0-9\]*.*stack_align.*" \
+	"continue to stack_align + 7"
+
+setup_kfail *-*-* gdb/2080
+gdb_test "backtrace 10" \
+	"#0\[ \t\]*$hex in stack_align.*\r\n#1\[ \t\]*$hex in main.*" \
+	"first backtrace in stack_align"
+
+gdb_test "continue" \
+	"Program received signal SIGTRAP.*" \
+	"continue in stack_align"
+
+skip_breakpoint stack_align
+
+setup_kfail *-*-* gdb/2080
+gdb_test "backtrace 10" \
+	"#0\[ \t\]*$hex in stack_align.*\r\n#1\[ \t\]*$hex in main.*" \
+	"second backtrace in stack_align"
+
+setup_kfail *-*-* gdb/2080
+gdb_test "info frame" \
+	".*Saved registers:.*ecx at.*ebp at.*edi at.*eip at.*" \
+	"saved registers in stack_align"
+
+
 # Testcase from symtab/1253.
 
 gdb_test "continue" "Program received signal SIGTRAP.*" "continue to gdb1253"
@@ -107,6 +139,7 @@ gdb_test "info frame" \
 	".*Saved registers:.*ebp at.*edi at.*eip at.*" \
 	"saved registers in gdb1253"
 
+
 # Testcase from backtrace/1718.
 
 gdb_test "continue" "Program received signal SIGTRAP.*" "continue to gdb1718"
@@ -122,6 +155,7 @@ gdb_test "info frame" \
 	".*Saved registers:.*esi at.*ebx at.*eip at.*" \
 	"saved registers in gdb1718"
 
+
 # Testcase from backtrace/1338.
 
 gdb_test "continue" "Program received signal SIGTRAP.*" "continue to gdb1338"


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]