From: Aleksandar Ristovski <aristovski@qnx.com>
To: gdb-patches@sourceware.org
Subject: [RFC] gdb.mi tests
Date: Tue, 11 Mar 2008 19:32:00 -0000 [thread overview]
Message-ID: <47D6DE48.8090003@qnx.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 1152 bytes --]
Hello,
By looking at gdb.mi I have noticed that (unfortunately) the way they are
written, they do not allow baseboard files to override mi_* functions.
gdb.base allows overriding which is great. For example, we override gdb_start
and gdb_load. In overriden functions we call default_ versions and then we
perform some additional tasks.
For gdb.mi, that is not possible since mi-support.exp is going to be loaded
after baseboard file.
I would propose the following changes (only one test from gdb.mi is given as an
example) and would ask you to, please, comment.
Changes:
1. gdb.exp loads mi-support.exp
2. mi-support.exp to "export" overridable functions. By this I mean to have
mi_cmd and default_mi_cmd pairs, where mi_cmd calls default_mi_cmd. Baseboard
can override mi_cmd (well, it can override anything, but this would be meant to
be overriden).
3. gdb.mi/* do not load explicitly mi-support.exp
Something like the diffs attached (I manually removed some things from my diff
so the diff may not be patchable, but it should be sufficient to illustrate what
am I talking about.
Thanks,
Aleksandar Ristovski
QNX Software Systems
[-- Attachment #2: mitests.diff --]
[-- Type: text/plain, Size: 1837 bytes --]
Index: lib/mi-support.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/lib/mi-support.exp,v
retrieving revision 1.51
diff -u -p -r1.51 mi-support.exp
--- lib/mi-support.exp 29 Jan 2008 19:36:58 -0000 1.51
+++ lib/mi-support.exp 11 Mar 2008 19:20:13 -0000
@@ -84,7 +84,7 @@ proc mi_uncatched_gdb_exit {} {
}
#
-# mi_gdb_start [INFERIOR_PTY] -- start gdb running, default procedure
+# default_mi_gdb_start [INFERIOR_PTY] -- start gdb running, default procedure
#
# INFERIOR_PTY should be set to separate-inferior-tty to have the inferior work
# with it's own PTY. If set to same-inferior-tty, the inferior shares GDB's PTY.
@@ -94,7 +94,7 @@ proc mi_uncatched_gdb_exit {} {
# tests on different hosts all using the same server, things can
# get really slow. Give gdb at least 3 minutes to start up.
#
-proc mi_gdb_start { args } {
+proc default_mi_gdb_start { args } {
global verbose
global GDB
global GDBFLAGS
@@ -230,6 +230,14 @@ proc mi_gdb_start { args } {
return 0;
}
+#
+# Overridable function. You can override this function in your
+# baseboard file.
+#
+proc mi_gdb_start { args } {
+ return [default_mi_gdb_start $args]
+}
+
# Many of the tests depend on setting breakpoints at various places and
# running until that breakpoint is reached. At times, we want to start
# with a clean-slate with respect to breakpoints, so this utility proc
Index: lib/gdb.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/lib/gdb.exp,v
retrieving revision 1.96
diff -u -p -r1.96 gdb.exp
--- lib/gdb.exp 23 Jan 2008 06:20:34 -0000 1.96
+++ lib/gdb.exp 11 Mar 2008 19:20:24 -0000
@@ -27,6 +27,7 @@ if {$tool == ""} {
}
load_lib libgloss.exp
+load_lib mi-support.exp
global GDB
[-- Attachment #3: gdb669.exp.diff --]
[-- Type: text/plain, Size: 440 bytes --]
Index: gdb.mi/gdb669.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/gdb669.exp,v
retrieving revision 1.9
diff -u -p -r1.9 gdb669.exp
--- gdb.mi/gdb669.exp 1 Jan 2008 22:53:20 -0000 1.9
+++ gdb.mi/gdb669.exp 11 Mar 2008 19:28:38 -0000
@@ -25,7 +25,7 @@ if {![isnative]} {
return
}
-load_lib mi-support.exp
+# load_lib mi-support.exp
set MIFLAGS "-i=mi"
gdb_exit
next reply other threads:[~2008-03-11 19:32 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-11 19:32 Aleksandar Ristovski [this message]
2008-03-12 19:18 ` Aleksandar Ristovski
2008-03-12 19:25 ` Vladimir Prus
2008-03-12 19:34 ` Daniel Jacobowitz
2008-03-12 20:49 ` Aleksandar Ristovski
2008-03-12 21:05 ` Daniel Jacobowitz
2008-03-14 18:07 ` Aleksandar Ristovski
2008-03-21 15:07 ` Daniel Jacobowitz
2008-03-28 15:24 Aleksandar Ristovski
2008-03-28 15:59 ` Daniel Jacobowitz
2008-03-28 16:00 ` Daniel Jacobowitz
2008-03-28 16:16 Aleksandar Ristovski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=47D6DE48.8090003@qnx.com \
--to=aristovski@qnx.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox