[PATCH V6 1/3] gdb: support for eBPF

Jose E. Marchesi jose.marchesi@oracle.com
Tue Aug 4 14:57:51 GMT 2020


>> Hello.
>> 
>> > On Monday, August 3, 2020 4:03 PM, Jose E. Marchesi wrote:
>> >> This patch adds basic support for the eBPF target: tdep and build
>> >> machinery.  The accompanying simulator is introduced in subsequent
>> >> patches.
>> >>
>> >> +/* Internal debugging facilities.  */
>> >> +
>> >> +/* When this is set to non-zero debugging information will be
>> >> +   printed.  */
>> >> +
>> >> +static unsigned int bpf_debug_flag = 0;
>> >> +
>> >> +/* The show callback for 'show debug bpf'.  */
>> >> +
>> >> +static void
>> >> +show_bpf_debug (struct ui_file *file, int from_tty,
>> >> +	        struct cmd_list_element *c, const char *value)
>> >
>> > Just my two cents.  The 'struct' keyword can be removed in numerous places
>> > throughout the file.  Also, NULL can be replaced with nullptr.
>> 
>> I prefer to write (and maintain) C.
>
> GDB is written in C++.  Though it's C history shows in many places,
> the code base is ever moving towards C++, IMHO new code should be
> quality C++.

I don't think anything in the proposed patch is invalid C++.  I was just
expressing a personal preference in style, call it Cish C++ if not C.

Of course, if the global maintainers decide that "quality" C++ requires
avoiding `struct' keywords and using nullptr instead of NULL, and that
it is important for new code to stick to it, then sure I will just
change it without further discussion :)


More information about the Gdb-patches mailing list