• R/O
  • HTTP
  • SSH
  • HTTPS

コミット

タグ
未設定

よく使われているワード(クリックで追加)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

GNU Binutils with patches for OS216


コミットメタ情報

リビジョン6227a6614ca9b363622660129273c4cb8a9c10c0 (tree)
日時2019-09-07 07:27:52
作者Pedro Alves <palves@redh...>
コミッターPedro Alves

ログメッセージ

Make "show remote exec-file" inferior-aware

The "set remote exec-file" setting is per-inferior, but the "show
remote exec-file" command always shows the last set exec-file,
irrespective of the current inferior. E.g.:

# Set inferior 1's exec-file:
(gdb) set remote exec-file prog1
# Add inferior 2, switch to it, and set its exec-file:
(gdb) add-inferior
Added inferior 2
(gdb) inferior 2
(gdb) set remote exec-file prog2
# Switch back to inferior 1, and show its exec-file:
(gdb) inferior 1
(gdb) show remote exec-file
prog2
should show "prog1" instead here.

gdb/ChangeLog:
yyyy-mm-dd Pedro Alves <palves@redhat.com>

* remote.c (show_remote_exec_file): Show the current inferior's
exec-file instead of the command variable's value.

gdb/testsuite/ChangeLog:
yyyy-mm-dd Pedro Alves <palves@redhat.com>

* gdb.base/remote-exec-file.exp: New file.

変更サマリ

差分

--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -1272,7 +1272,7 @@ static void
12721272 show_remote_exec_file (struct ui_file *file, int from_tty,
12731273 struct cmd_list_element *cmd, const char *value)
12741274 {
1275- fprintf_filtered (file, "%s\n", remote_exec_file_var);
1275+ fprintf_filtered (file, "%s\n", get_remote_exec_file ());
12761276 }
12771277
12781278 static int
--- /dev/null
+++ b/gdb/testsuite/gdb.base/remote-exec-file.exp
@@ -0,0 +1,46 @@
1+# Copyright 2019 Free Software Foundation, Inc.
2+
3+# This program is free software; you can redistribute it and/or modify
4+# it under the terms of the GNU General Public License as published by
5+# the Free Software Foundation; either version 3 of the License, or
6+# (at your option) any later version.
7+#
8+# This program is distributed in the hope that it will be useful,
9+# but WITHOUT ANY WARRANTY; without even the implied warranty of
10+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+# GNU General Public License for more details.
12+#
13+# You should have received a copy of the GNU General Public License
14+# along with this program. If not, see <http://www.gnu.org/licenses/>.
15+
16+# Check that "show remote exec-file" displays each inferior's
17+# exec-file. Regression test for a bug where "show remote exec-file"
18+# would show the last exec-file set, irrespective of the current
19+# inferior.
20+
21+clean_restart
22+
23+# Set remote exec-file in inferior 1.
24+with_test_prefix "set inf 1" {
25+ gdb_test_no_output "set remote exec-file prog1"
26+}
27+
28+# Set remote exec-file in inferior 2.
29+with_test_prefix "set inf 2" {
30+ gdb_test "add-inferior" "Added inferior 2" "add inferior 2"
31+ gdb_test "inferior 2" "Switching to inferior 2.*"
32+ gdb_test_no_output "set remote exec-file prog2"
33+}
34+
35+# Check that "show remote exec-file" diplays each inferior's
36+# exec-file.
37+
38+with_test_prefix "show inf 1" {
39+ gdb_test "inferior 1" "Switching to inferior 1.*"
40+ gdb_test "show remote exec-file" "prog1"
41+}
42+
43+with_test_prefix "show inf 2" {
44+ gdb_test "inferior 2" "Switching to inferior 2.*"
45+ gdb_test "show remote exec-file" "prog2"
46+}