[1/2] gdbinit.in: call a function with "call", not "set"
diff mbox series

Message ID 20191112114734.890813-2-Hi-Angel@yandex.ru
State New
Headers show
Series
  • gdbinit.in fixes
Related show

Commit Message

Konstantin Kharlamov Nov. 12, 2019, 11:47 a.m. UTC
Last time a command that calls a function of debuggee with "set" was
added is 2013 year. Apparently something has changed since then, since
doing "set foo()" in gdb to call a "foo()" results in error.
Disregarding, it looks wrong to call a function with "set". Let's use
"call" instead.

* (debug_rtx,debug_rtx_list,debug_tree,debug_c_tree,debug_gimple_stmt,
debug_gimple_seq,mpz_out_str,debug_dwarf_die,print_binding_stack,
bitmap_print): Replace "set" with "call"
---
 gcc/gdbinit.in | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

Comments

Segher Boessenkool Nov. 13, 2019, 11:20 a.m. UTC | #1
Hi!

On Tue, Nov 12, 2019 at 02:47:33PM +0300, Konstantin Kharlamov wrote:
> Last time a command that calls a function of debuggee with "set" was
> added is 2013 year. Apparently something has changed since then, since
> doing "set foo()" in gdb to call a "foo()" results in error.
> Disregarding, it looks wrong to call a function with "set". Let's use
> "call" instead.

I got a warning, not an error?  Your modified code works fine btw, also
with (at least some) older versions of GDB.

> * (debug_rtx,debug_rtx_list,debug_tree,debug_c_tree,debug_gimple_stmt,
> debug_gimple_seq,mpz_out_str,debug_dwarf_die,print_binding_stack,
> bitmap_print): Replace "set" with "call"

That changelog has multiple problems.  Please use something like this:

2019-11-13  Konstantin Kharlamov  <your@email.here>

	* gdbinit.in (pr, prl, pt, pct, pgg, pgq, pgs, pge, pmz, pdd, pbs, pbm):
	Use "call" instead of "set".

Looks good to me otherwise, thanks!  (This is not an approval, I am not
maintainer of this part of GCC).


Segher
Jeff Law Nov. 13, 2019, 7:58 p.m. UTC | #2
On 11/13/19 4:20 AM, Segher Boessenkool wrote:
> Hi!
> 
> On Tue, Nov 12, 2019 at 02:47:33PM +0300, Konstantin Kharlamov wrote:
>> Last time a command that calls a function of debuggee with "set" was
>> added is 2013 year. Apparently something has changed since then, since
>> doing "set foo()" in gdb to call a "foo()" results in error.
>> Disregarding, it looks wrong to call a function with "set". Let's use
>> "call" instead.
> 
> I got a warning, not an error?  Your modified code works fine btw, also
> with (at least some) older versions of GDB.
> 
>> * (debug_rtx,debug_rtx_list,debug_tree,debug_c_tree,debug_gimple_stmt,
>> debug_gimple_seq,mpz_out_str,debug_dwarf_die,print_binding_stack,
>> bitmap_print): Replace "set" with "call"
> 
> That changelog has multiple problems.  Please use something like this:
> 
> 2019-11-13  Konstantin Kharlamov  <your@email.here>
> 
> 	* gdbinit.in (pr, prl, pt, pct, pgg, pgq, pgs, pge, pmz, pdd, pbs, pbm):
> 	Use "call" instead of "set".
> 
> Looks good to me otherwise, thanks!  (This is not an approval, I am not
> maintainer of this part of GCC).
Approved with a fixed ChangeLog.

jeff

Patch
diff mbox series

diff --git a/gcc/gdbinit.in b/gcc/gdbinit.in
index 42302aecfe3..a933ddc6141 100644
--- a/gcc/gdbinit.in
+++ b/gcc/gdbinit.in
@@ -26,7 +26,7 @@  Works only when an inferior is executing.
 end
 
 define pr
-set debug_rtx ($)
+call debug_rtx ($)
 end
 
 document pr
@@ -35,7 +35,7 @@  Works only when an inferior is executing.
 end
 
 define prl
-set debug_rtx_list ($, debug_rtx_count)
+call debug_rtx_list ($, debug_rtx_count)
 end
 
 document prl
@@ -50,7 +50,7 @@  it using debug_rtx_list. Usage example: set $foo=debug_rtx_find(first, 42)
 end
 
 define pt
-set debug_tree ($)
+call debug_tree ($)
 end
 
 document pt
@@ -59,7 +59,7 @@  Works only when an inferior is executing.
 end
 
 define pct
-set debug_c_tree ($)
+call debug_c_tree ($)
 end
 
 document pct
@@ -68,7 +68,7 @@  Works only when an inferior is executing.
 end
 
 define pgg
-set debug_gimple_stmt ($)
+call debug_gimple_stmt ($)
 end
 
 document pgg
@@ -77,7 +77,7 @@  Works only when an inferior is executing.
 end
 
 define pgq
-set debug_gimple_seq ($)
+call debug_gimple_seq ($)
 end
 
 document pgq
@@ -86,7 +86,7 @@  Works only when an inferior is executing.
 end
 
 define pgs
-set debug_generic_stmt ($)
+call debug_generic_stmt ($)
 end
 
 document pgs
@@ -95,7 +95,7 @@  Works only when an inferior is executing.
 end
 
 define pge
-set debug_generic_expr ($)
+call debug_generic_expr ($)
 end
 
 document pge
@@ -104,7 +104,7 @@  Works only when an inferior is executing.
 end
 
 define pmz
-set mpz_out_str(stderr, 10, $)
+call mpz_out_str(stderr, 10, $)
 end
 
 document pmz
@@ -140,7 +140,7 @@  Print the name of the type-node that is $.
 end
 
 define pdd
-set debug_dwarf_die ($)
+call debug_dwarf_die ($)
 end
 
 document pdd
@@ -167,7 +167,7 @@  Print the fields of an instruction that is $.
 end
 
 define pbs
-set print_binding_stack ()
+call print_binding_stack ()
 end
 
 document pbs
@@ -176,7 +176,7 @@  including the global binding level.
 end
 
 define pbm
-set bitmap_print (stderr, $, "", "\n")
+call bitmap_print (stderr, $, "", "\n")
 end
 
 document pbm