• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Keine Tags

Frequently used words (click to add to your profile)

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

GNU Binutils with patches for OS216


Commit MetaInfo

Revision717c684dd1afe36293a256aa2bce4b3af56402c5 (tree)
Zeit2020-01-15 05:20:16
AutorBernd Edlinger <bernd.edlinger@hotm...>
CommiterBernd Edlinger

Log Message

Make skip without argument skip the current inline function

Previously always the outermost function block was used, but
since skip is now able to skip over inline functions it is more
natural to skip the inline function that the program is currently
executing.

gdb:
2020-01-14 Bernd Edlinger <bernd.edlinger@hotmail.de>

* skip.c (skip_function_command): Make skip w/o arguments use the
name of the inlined function if pc is inside any inlined function.

gdb/testsuite:
2020-01-14 Bernd Edlinger <bernd.edlinger@hotmail.de>

* gdb.base/skip-inline.exp: Extend test.

Ändern Zusammenfassung

Diff

--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
1+2020-01-14 Bernd Edlinger <bernd.edlinger@hotmail.de>
2+
3+ * skip.c (skip_function_command): Make skip w/o arguments use the
4+ name of the inlined function if pc is inside any inlined function.
5+
16 2020-01-14 Luis Machado <luis.machado@linaro.org>
27
38 * inf-ptrace.c (inf_ptrace_target::resume): Update comments.
--- a/gdb/skip.c
+++ b/gdb/skip.c
@@ -209,18 +209,15 @@ skip_function_command (const char *arg, int from_tty)
209209 /* Default to the current function if no argument is given. */
210210 if (arg == NULL)
211211 {
212+ frame_info *fi = get_selected_frame (_("No default function now."));
213+ struct symbol *sym = get_frame_function (fi);
212214 const char *name = NULL;
213- CORE_ADDR pc;
214215
215- if (!last_displayed_sal_is_valid ())
216- error (_("No default function now."));
217-
218- pc = get_last_displayed_addr ();
219- if (!find_pc_partial_function (pc, &name, NULL, NULL))
220- {
221- error (_("No function found containing current program point %s."),
222- paddress (get_current_arch (), pc));
223- }
216+ if (sym != NULL)
217+ name = sym->print_name ();
218+ else
219+ error (_("No function found containing current program point %s."),
220+ paddress (get_current_arch (), get_frame_pc (fi)));
224221 skip_function (name);
225222 return;
226223 }
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,7 @@
1+2020-01-14 Bernd Edlinger <bernd.edlinger@hotmail.de>
2+
3+ * gdb.base/skip-inline.exp: Extend test.
4+
15 2020-01-13 Andrew Burgess <andrew.burgess@embecosm.com>
26
37 * gdb.dwarf2/dw2-bad-elf-other.S: New file.
--- a/gdb/testsuite/gdb.base/skip-inline.exp
+++ b/gdb/testsuite/gdb.base/skip-inline.exp
@@ -76,3 +76,17 @@ with_test_prefix "triple step" {
7676 gdb_test "step 3" ".*" "step over baz, again"
7777 gdb_test "bt" "\\s*\\#0\\s+main.*" "again back to main"
7878 }
79+
80+if ![runto_main] {
81+ fail "can't run to main"
82+ return
83+}
84+
85+gdb_test "skip delete" ".*" "skip delete"
86+
87+with_test_prefix "skip current frame" {
88+ gdb_test "bt" "\\s*\\#0\\s+main.*" "in the main"
89+ gdb_test "step" ".*" "step into foo"
90+ gdb_test "bt" "\\s*\\#0\\s+foo.*" "in the foo"
91+ gdb_test "skip" "Function foo will be skipped when stepping\." "skip"
92+}