* [PATCH 0/2] gdbinit.in fixes @ 2019-11-12 11:47 Konstantin Kharlamov 2019-11-12 11:47 ` [PATCH 1/2] gdbinit.in: call a function with "call", not "set" Konstantin Kharlamov 2019-11-12 12:07 ` [PATCH 2/2] gdbinit.in: fix wrong reference to function argument Konstantin Kharlamov 0 siblings, 2 replies; 14+ messages in thread From: Konstantin Kharlamov @ 2019-11-12 11:47 UTC (permalink / raw) To: gcc-patches This includes the unmerged previously posted here patch about calling with `call`. I made a typo in commit message formatting, so I fix it here. I'd like to note that I am not subscribed to the list, so please add me to CC when replying. Thanks in advance. Konstantin Kharlamov (2): gdbinit.in: call a function with "call", not "set" gdbinit.in: fix wrong reference to function argument gcc/gdbinit.in | 84 +++++++++++++++++++++++++------------------------- 1 file changed, 42 insertions(+), 42 deletions(-) -- 2.24.0 ^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH 1/2] gdbinit.in: call a function with "call", not "set" 2019-11-12 11:47 [PATCH 0/2] gdbinit.in fixes Konstantin Kharlamov @ 2019-11-12 11:47 ` Konstantin Kharlamov 2019-11-13 11:22 ` Segher Boessenkool 2019-11-12 12:07 ` [PATCH 2/2] gdbinit.in: fix wrong reference to function argument Konstantin Kharlamov 1 sibling, 1 reply; 14+ messages in thread From: Konstantin Kharlamov @ 2019-11-12 11:47 UTC (permalink / raw) To: gcc-patches 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(-) 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 -- 2.24.0 ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 1/2] gdbinit.in: call a function with "call", not "set" 2019-11-12 11:47 ` [PATCH 1/2] gdbinit.in: call a function with "call", not "set" Konstantin Kharlamov @ 2019-11-13 11:22 ` Segher Boessenkool 2019-11-13 20:03 ` Jeff Law 0 siblings, 1 reply; 14+ messages in thread From: Segher Boessenkool @ 2019-11-13 11:22 UTC (permalink / raw) To: Konstantin Kharlamov; +Cc: gcc-patches 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 ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 1/2] gdbinit.in: call a function with "call", not "set" 2019-11-13 11:22 ` Segher Boessenkool @ 2019-11-13 20:03 ` Jeff Law 0 siblings, 0 replies; 14+ messages in thread From: Jeff Law @ 2019-11-13 20:03 UTC (permalink / raw) To: Segher Boessenkool, Konstantin Kharlamov; +Cc: gcc-patches 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 ^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH 2/2] gdbinit.in: fix wrong reference to function argument 2019-11-12 11:47 [PATCH 0/2] gdbinit.in fixes Konstantin Kharlamov 2019-11-12 11:47 ` [PATCH 1/2] gdbinit.in: call a function with "call", not "set" Konstantin Kharlamov @ 2019-11-12 12:07 ` Konstantin Kharlamov 2019-11-12 12:57 ` Andreas Schwab 1 sibling, 1 reply; 14+ messages in thread From: Konstantin Kharlamov @ 2019-11-12 12:07 UTC (permalink / raw) To: gcc-patches Gdb documentation says that gdb-defined functions refer to their args as $arg0â¦$argN. The just "$" that gdbinit is using here refers to something else, which results in gdb errors, or even crashes of debuggee. Let's fix that. * (debug,debug_rtx,pr,prl,pt,pct,pgg,pgq,pgq,pgs,pge,pmz,ptc, pdn,ptn,pdd,prc,pi,pbs,pbm,pel,pcfun,trt): replace $ with $arg0 --- gcc/gdbinit.in | 82 +++++++++++++++++++++++++------------------------- 1 file changed, 41 insertions(+), 41 deletions(-) diff --git a/gcc/gdbinit.in b/gcc/gdbinit.in index a933ddc6141..71a01edaa71 100644 --- a/gcc/gdbinit.in +++ b/gcc/gdbinit.in @@ -17,153 +17,153 @@ # <http://www.gnu.org/licenses/>. define pp -call debug ($) +call debug ($arg0) end document pp -Print a representation of the GCC data structure that is $. +Print a representation of the GCC data structure that is $arg0. Works only when an inferior is executing. end define pr -call debug_rtx ($) +call debug_rtx ($arg0) end document pr -Print the full structure of the rtx that is $. +Print the full structure of the rtx that is $arg0. Works only when an inferior is executing. end define prl -call debug_rtx_list ($, debug_rtx_count) +call debug_rtx_list ($arg0, debug_rtx_count) end document prl -Print the full structure of all rtx insns beginning at $. +Print the full structure of all rtx insns beginning at $arg0. Works only when an inferior is executing. Uses variable debug_rtx_count to control number of insns printed: - debug_rtx_count > 0: print from $ on. - debug_rtx_count < 0: print a window around $. + debug_rtx_count > 0: print from $arg0 on. + debug_rtx_count < 0: print a window around $arg0. There is also debug_rtx_find (rtx, uid) that will scan a list for UID and print it using debug_rtx_list. Usage example: set $foo=debug_rtx_find(first, 42) end define pt -call debug_tree ($) +call debug_tree ($arg0) end document pt -Print the full structure of the tree that is $. +Print the full structure of the tree that is $arg0. Works only when an inferior is executing. end define pct -call debug_c_tree ($) +call debug_c_tree ($arg0) end document pct -Print the tree that is $ in C syntax. +Print the tree that is $arg0 in C syntax. Works only when an inferior is executing. end define pgg -call debug_gimple_stmt ($) +call debug_gimple_stmt ($arg0) end document pgg -Print the Gimple statement that is $ in C syntax. +Print the Gimple statement that is $arg0 in C syntax. Works only when an inferior is executing. end define pgq -call debug_gimple_seq ($) +call debug_gimple_seq ($arg0) end document pgq -Print the Gimple sequence that is $ in C syntax. +Print the Gimple sequence that is $arg0 in C syntax. Works only when an inferior is executing. end define pgs -call debug_generic_stmt ($) +call debug_generic_stmt ($arg0) end document pgs -Print the statement that is $ in C syntax. +Print the statement that is $arg0 in C syntax. Works only when an inferior is executing. end define pge -call debug_generic_expr ($) +call debug_generic_expr ($arg0) end document pge -Print the expression that is $ in C syntax. +Print the expression that is $arg0 in C syntax. Works only when an inferior is executing. end define pmz -call mpz_out_str(stderr, 10, $) +call mpz_out_str(stderr, 10, $arg0) end document pmz -Print the mpz value that is $ +Print the mpz value that is $arg0 Works only when an inferior is executing. end define ptc -output (enum tree_code) $.base.code +output (enum tree_code) $arg0.base.code echo \n end document ptc -Print the tree-code of the tree node that is $. +Print the tree-code of the tree node that is $arg0. end define pdn -output $.decl_minimal.name->identifier.id.str +output $arg0.decl_minimal.name->identifier.id.str echo \n end document pdn -Print the name of the decl-node that is $. +Print the name of the decl-node that is $arg0. end define ptn -output $.type.name->decl_minimal.name->identifier.id.str +output $arg0.type.name->decl_minimal.name->identifier.id.str echo \n end document ptn -Print the name of the type-node that is $. +Print the name of the type-node that is $arg0. end define pdd -call debug_dwarf_die ($) +call debug_dwarf_die ($arg0) end document pdd -Print the dw_die_ref that is in $. +Print the dw_die_ref that is in $arg0. end define prc -output (enum rtx_code) $.code +output (enum rtx_code) $arg0.code echo \ ( -output $.mode +output $arg0.mode echo )\n end document prc -Print the rtx-code and machine mode of the rtx that is $. +Print the rtx-code and machine mode of the rtx that is $arg0. end define pi -print $.u.fld[0].rt_rtx@7 +print $arg0.u.fld[0].rt_rtx@7 end document pi -Print the fields of an instruction that is $. +Print the fields of an instruction that is $arg0. end define pbs @@ -176,20 +176,20 @@ including the global binding level. end define pbm -call bitmap_print (stderr, $, "", "\n") +call bitmap_print (stderr, $arg0, "", "\n") end document pbm -Dump the bitmap that is in $ as a comma-separated list of numbers. +Dump the bitmap that is in $arg0 as a comma-separated list of numbers. end define pel -output expand_location ($) +output expand_location ($arg0) echo \n end document pel -Print expanded location of $. +Print expanded location of $arg0. end define pcfun @@ -202,11 +202,11 @@ Print current function. end define trt -print ($.typed.type) +print ($arg0.typed.type) end document trt -Print TREE_TYPE of the tree node that is $ +Print TREE_TYPE of the tree node that is $arg0 end define break-on-diagnostic -- 2.24.0 ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 2/2] gdbinit.in: fix wrong reference to function argument 2019-11-12 12:07 ` [PATCH 2/2] gdbinit.in: fix wrong reference to function argument Konstantin Kharlamov @ 2019-11-12 12:57 ` Andreas Schwab 2019-11-12 13:03 ` Konstantin Kharlamov 0 siblings, 1 reply; 14+ messages in thread From: Andreas Schwab @ 2019-11-12 12:57 UTC (permalink / raw) To: Konstantin Kharlamov; +Cc: gcc-patches On Nov 12 2019, Konstantin Kharlamov wrote: > Gdb documentation says that gdb-defined functions refer to their args as > $arg0â¦$argN. The just "$" that gdbinit is using here refers to something > else, That's the last thing printed. > which results in gdb errors, or even crashes of debuggee. Let's > fix that. That breaks all users of these macros, since you are now required to pass an argument. Andreas. -- Andreas Schwab, SUSE Labs, schwab@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different." ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 2/2] gdbinit.in: fix wrong reference to function argument 2019-11-12 12:57 ` Andreas Schwab @ 2019-11-12 13:03 ` Konstantin Kharlamov 2019-11-12 13:15 ` Andreas Schwab 0 siblings, 1 reply; 14+ messages in thread From: Konstantin Kharlamov @ 2019-11-12 13:03 UTC (permalink / raw) To: Andreas Schwab; +Cc: gcc-patches On Вт, ноя 12, 2019 at 13:50, Andreas Schwab <schwab@suse.de> wrote: > On Nov 12 2019, Konstantin Kharlamov wrote: > >> Gdb documentation says that gdb-defined functions refer to their >> args as >> $arg0…$argN. The just "$" that gdbinit is using here refers to >> something >> else, > > That's the last thing printed. Hmm, okay… Am I missing something…? As I'm reading, this looks definitely wrong, because the "last thing printed" is just a random value. To illustrate: I can do a calculation, like `p 2 + 2`, and then I execute, say, `pgg stmt`, and debuggee crashes because it calls `debug_gimple_stmt(4)`. That's what happened to me a lot of times until I figured the problem is in gdbinit. >> which results in gdb errors, or even crashes of debuggee. Let's >> fix that. > > That breaks all users of these macros, since you are now required to > pass an argument. I'm definitely missing something. Who are these users, and how can they make anything useful of these functions if they don't even pass an argument? > Andreas. > > -- > Andreas Schwab, SUSE Labs, schwab@suse.de > GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA > B9D7 > "And now for something completely different." ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 2/2] gdbinit.in: fix wrong reference to function argument 2019-11-12 13:03 ` Konstantin Kharlamov @ 2019-11-12 13:15 ` Andreas Schwab 2019-11-12 13:27 ` Konstantin Kharlamov 0 siblings, 1 reply; 14+ messages in thread From: Andreas Schwab @ 2019-11-12 13:15 UTC (permalink / raw) To: Konstantin Kharlamov; +Cc: gcc-patches On Nov 12 2019, Konstantin Kharlamov wrote: > I'm definitely missing something. Who are these users, and how can they > make anything useful of these functions if they don't even pass an > argument? By printing the desired value. Andreas. -- Andreas Schwab, SUSE Labs, schwab@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different." ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 2/2] gdbinit.in: fix wrong reference to function argument 2019-11-12 13:15 ` Andreas Schwab @ 2019-11-12 13:27 ` Konstantin Kharlamov 2019-11-12 13:40 ` Andreas Schwab 2019-11-13 11:39 ` Segher Boessenkool 0 siblings, 2 replies; 14+ messages in thread From: Konstantin Kharlamov @ 2019-11-12 13:27 UTC (permalink / raw) To: Andreas Schwab; +Cc: gcc-patches On Вт, ноя 12, 2019 at 14:08, Andreas Schwab <schwab@suse.de> wrote: > On Nov 12 2019, Konstantin Kharlamov wrote: > >> I'm definitely missing something. Who are these users, and how can >> they >> make anything useful of these functions if they don't even pass an >> argument? > > By printing the desired value. Hah, okay. Well, in this case their workflow now gonna be 2 times simpler since they don't have to type in two commands, but only one :) Besides, I suspect, the number of actual users of this gdbinit is around zero, otherwise someone would have noticed the warning that gdb prints on every usage of these functions while the PATCH 1/2 is not applied. ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 2/2] gdbinit.in: fix wrong reference to function argument 2019-11-12 13:27 ` Konstantin Kharlamov @ 2019-11-12 13:40 ` Andreas Schwab 2019-11-13 11:39 ` Segher Boessenkool 1 sibling, 0 replies; 14+ messages in thread From: Andreas Schwab @ 2019-11-12 13:40 UTC (permalink / raw) To: Konstantin Kharlamov; +Cc: gcc-patches On Nov 12 2019, Konstantin Kharlamov wrote: > Besides, I suspect, the number of actual users of this gdbinit is around > zero, otherwise someone would have noticed the warning that gdb prints on > every usage of these functions while the PATCH 1/2 is not applied. It's easy to ignore it. Andreas. -- Andreas Schwab, SUSE Labs, schwab@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different." ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 2/2] gdbinit.in: fix wrong reference to function argument 2019-11-12 13:27 ` Konstantin Kharlamov 2019-11-12 13:40 ` Andreas Schwab @ 2019-11-13 11:39 ` Segher Boessenkool 2019-11-13 15:24 ` Jason Merrill 1 sibling, 1 reply; 14+ messages in thread From: Segher Boessenkool @ 2019-11-13 11:39 UTC (permalink / raw) To: Konstantin Kharlamov; +Cc: Andreas Schwab, gcc-patches On Tue, Nov 12, 2019 at 04:17:17PM +0300, Konstantin Kharlamov wrote: > On ÐÑ, Ð½Ð¾Ñ 12, 2019 at 14:08, Andreas Schwab <schwab@suse.de> > wrote: > >On Nov 12 2019, Konstantin Kharlamov wrote: > >> I'm definitely missing something. Who are these users, and how can > >>they > >> make anything useful of these functions if they don't even pass an > >> argument? > > > >By printing the desired value. > > Hah, okay. Well, in this case their workflow now gonna be 2 times > simpler since they don't have to type in two commands, but only one :) Do we have to type parentheses now? That more than undoes that gain :-/ > Besides, I suspect, the number of actual users of this gdbinit is > around zero, otherwise someone would have noticed the warning that gdb > prints on every usage of these functions while the PATCH 1/2 is not > applied. There are users. There are users who have been used to this behaviour for many many many years. People just do (say I have an "rtx insn"): p insn pr A new version where you just say pr insn would be nice; something that requires pr(insn) is less nice. It would be great if you could come up with something that keeps the old syntax working as well, especially since many of us have to work with older versions of the gdbinit as well, for years to come. People can adjust their work habits of course, but that causes a lot of friction ;-) Segher ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 2/2] gdbinit.in: fix wrong reference to function argument 2019-11-13 11:39 ` Segher Boessenkool @ 2019-11-13 15:24 ` Jason Merrill 2019-11-14 7:01 ` Konstantin Kharlamov 0 siblings, 1 reply; 14+ messages in thread From: Jason Merrill @ 2019-11-13 15:24 UTC (permalink / raw) To: Segher Boessenkool; +Cc: Konstantin Kharlamov, Andreas Schwab, gcc-patches List On Wed, Nov 13, 2019 at 6:39 AM Segher Boessenkool < segher@kernel.crashing.org> wrote: > On Tue, Nov 12, 2019 at 04:17:17PM +0300, Konstantin Kharlamov wrote: > > On Вт, ноя 12, 2019 at 14:08, Andreas Schwab <schwab@suse.de> > > wrote: > > >On Nov 12 2019, Konstantin Kharlamov wrote: > > >> I'm definitely missing something. Who are these users, and how can > > >>they > > >> make anything useful of these functions if they don't even pass an > > >> argument? > > > > > >By printing the desired value. > > > > Hah, okay. Well, in this case their workflow now gonna be 2 times > > simpler since they don't have to type in two commands, but only one :) > > Do we have to type parentheses now? That more than undoes that gain :-/ > > > Besides, I suspect, the number of actual users of this gdbinit is > > around zero, otherwise someone would have noticed the warning that gdb > > prints on every usage of these functions while the PATCH 1/2 is not > > applied. > > There are users. There are users who have been used to this behaviour > for many many many years. > > People just do (say I have an "rtx insn"): > p insn > pr > Indeed. I use this constantly. Jason ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 2/2] gdbinit.in: fix wrong reference to function argument 2019-11-13 15:24 ` Jason Merrill @ 2019-11-14 7:01 ` Konstantin Kharlamov 2019-11-14 11:57 ` Segher Boessenkool 0 siblings, 1 reply; 14+ messages in thread From: Konstantin Kharlamov @ 2019-11-14 7:01 UTC (permalink / raw) To: Jason Merrill; +Cc: Segher Boessenkool, Andreas Schwab, gcc-patches List On Ср, ноя 13, 2019 at 15:23, Jason Merrill <jason@redhat.com> wrote: > On Wed, Nov 13, 2019 at 6:39 AM Segher Boessenkool > <segher@kernel.crashing.org> wrote: >> On Tue, Nov 12, 2019 at 04:17:17PM +0300, Konstantin Kharlamov wrote: >> > On Вт, ноя 12, 2019 at 14:08, Andreas Schwab <schwab@suse.de> >> > wrote: >> > >On Nov 12 2019, Konstantin Kharlamov wrote: >> > >> I'm definitely missing something. Who are these users, and how >> can >> > >>they >> > >> make anything useful of these functions if they don't even >> pass an >> > >> argument? >> > > >> > >By printing the desired value. >> > >> > Hah, okay. Well, in this case their workflow now gonna be 2 times >> > simpler since they don't have to type in two commands, but only >> one :) >> >> Do we have to type parentheses now? That more than undoes that >> gain :-/ >> >> > Besides, I suspect, the number of actual users of this gdbinit is >> > around zero, otherwise someone would have noticed the warning >> that gdb >> > prints on every usage of these functions while the PATCH 1/2 is >> not >> > applied. >> >> There are users. There are users who have been used to this >> behaviour >> for many many many years. >> >> People just do (say I have an "rtx insn"): >> p insn >> pr > > Indeed. I use this constantly. Thanks everyone for answers. No, you don't have to type parentheses. Gdb has it like in Haskell, i.e. arguments are separated by just whitespace. So you type `pr insn` You know what, I came up with an alternative solution that won't break anyone's workflow neither confuse newbies: I can add a check for number of arguments, and to branch on that to use either $ or $arg0. I'll resend then a bit later the patchset with the fixed changelog for the 1st patch, and these alternative changes for the 2nd patch. ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 2/2] gdbinit.in: fix wrong reference to function argument 2019-11-14 7:01 ` Konstantin Kharlamov @ 2019-11-14 11:57 ` Segher Boessenkool 0 siblings, 0 replies; 14+ messages in thread From: Segher Boessenkool @ 2019-11-14 11:57 UTC (permalink / raw) To: Konstantin Kharlamov; +Cc: Jason Merrill, Andreas Schwab, gcc-patches List On Thu, Nov 14, 2019 at 09:45:28AM +0300, Konstantin Kharlamov wrote: > On СÑ, Ð½Ð¾Ñ 13, 2019 at 15:23, Jason Merrill <jason@redhat.com> > wrote: > >On Wed, Nov 13, 2019 at 6:39 AM Segher Boessenkool > ><segher@kernel.crashing.org> wrote: > >> There are users. There are users who have been used to this > >>behaviour > >> for many many many years. > >> > >> People just do (say I have an "rtx insn"): > >> p insn > >> pr > > > >Indeed. I use this constantly. > > Thanks everyone for answers. No, you don't have to type parentheses. > Gdb has it like in Haskell, i.e. arguments are separated by just > whitespace. So you type `pr insn` > > You know what, I came up with an alternative solution that won't break > anyone's workflow neither confuse newbies: I can add a check for number > of arguments, and to branch on that to use either $ or $arg0. That sounds great! Thank you :-) Segher ^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2019-11-14 11:55 UTC | newest] Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2019-11-12 11:47 [PATCH 0/2] gdbinit.in fixes Konstantin Kharlamov 2019-11-12 11:47 ` [PATCH 1/2] gdbinit.in: call a function with "call", not "set" Konstantin Kharlamov 2019-11-13 11:22 ` Segher Boessenkool 2019-11-13 20:03 ` Jeff Law 2019-11-12 12:07 ` [PATCH 2/2] gdbinit.in: fix wrong reference to function argument Konstantin Kharlamov 2019-11-12 12:57 ` Andreas Schwab 2019-11-12 13:03 ` Konstantin Kharlamov 2019-11-12 13:15 ` Andreas Schwab 2019-11-12 13:27 ` Konstantin Kharlamov 2019-11-12 13:40 ` Andreas Schwab 2019-11-13 11:39 ` Segher Boessenkool 2019-11-13 15:24 ` Jason Merrill 2019-11-14 7:01 ` Konstantin Kharlamov 2019-11-14 11:57 ` Segher Boessenkool
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).