This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA] thread apply commands change selected frame
- From: Denis PILAT <denis dot pilat at st dot com>
- To: Denis PILAT <denis dot pilat at st dot com>, gdb-patches <gdb-patches at sourceware dot org>
- Date: Thu, 01 Feb 2007 10:14:22 +0100
- Subject: Re: [RFA] thread apply commands change selected frame
- References: <45A61E73.8030400@st.com> <20070121173341.GG12463@nevyn.them.org> <45B73813.9060005@st.com> <45C05A1A.6010109@st.com> <20070131145407.GA24233@nevyn.them.org> <45C0BC7E.80409@st.com> <20070131193254.GA7389@nevyn.them.org>
Daniel Jacobowitz wrote:
On Wed, Jan 31, 2007 at 04:57:50PM +0100, Denis PILAT wrote:
Your remarks have been taken into account into the attached patch.
Are you ok for committing this one plus the previous patch regarding the
thread.c ?
(Frederic Riss will do that for me)
Yes, that's OK (with a minor fix, below). Let me know if you would
like write access yourself.
Yes thanks.
Checking for $[specific number] should be avoided, because adding more
tests earlier in the file will break it. Use \\\$\[0-9]+ instead.
I prefer that as well, therefore I changed the previous test as well to
keep the same style (see attached file).
--
Denis
2007-02-01 Denis Pilat <denis.pilat@st.com>
* gdb.threads/threadapply.exp: check that frame is not changed by
the thread apply all command.
Index: testsuite/gdb.threads/threadapply.exp
===================================================================
--- testsuite/gdb.threads/threadapply.exp (revision 553)
+++ testsuite/gdb.threads/threadapply.exp (working copy)
@@ -67,5 +67,11 @@ gdb_test_multiple "define backthread" "d
# verify that the macro can get past the backtrace error and perform
# subsequent commands.
gdb_test "set backtrace limit 3" ""
-gdb_test "thread apply all backthread" "Thread ..*\\\$1 = 0x14.*Thread ..*\\\$2 = 0x14.*Thread ..*\\\$3 = 0x14.*Thread ..*\\\$4 = 0x14.*Thread ..*\\\$5 = 0x14.*Thread ..*\\\$. = 0x14"
+gdb_test "thread apply all backthread" "Thread ..*\\\$\[0-9]+ = 0x14.*Thread ..*\\\$\[0-9]+ = 0x14.*Thread ..*\\\$\[0-9]+ = 0x14.*Thread ..*\\\$\[0-9]+ = 0x14.*Thread ..*\\\$\[0-9]+ = 0x14.*Thread ..*\\\$\[0-9]+ = 0x14"
+# Go into the thread_function to check that a simple "thread apply"
+# does not change the selected frame.
+gdb_test "step" "thread_function.*" "step to the thread_function"
+gdb_test "up" ".*in main.*" "go up in the stack frame"
+gdb_test "thread apply all print 1" "Thread ..*\\\$\[0-9]+ = 1.*Thread ..*\\\$\[0-9]+ = 1.*Thread ..*\\\$\[0-9]+ = 1.*Thread ..*\\\$\[0-9]+ = 1.*Thread ..*\\\$\[0-9]+ = 1.*Thread ..*\\\$\[0-9]+ = 1" "run a simple print command on all threads"
+gdb_test "down" "#0.*thread_function.*" "go down and check selected frame"