[PATCH 1/3] Use ui-out tables in some "maint print" commands

Tom Tromey tom@tromey.com
Wed Dec 4 00:49:40 GMT 2024


>>>>> Schimpe, Christina <christina.schimpe@intel.com> writes:

> I am used to also improve existing code if I touch a line. However, if
> you ident it only it's probably a different story and you're right: It
> should be a separate patch.  And of course I don't insist that you'll
> do it, I am still ramping up with doing upstream reviews. 😊

Yeah, normally in gdb cleanups like this are a separate patch.
It depends a bit, sometimes if you're already touching a line you might
s/NULL/nullptr/.  But for re-indentation it's better to touch as little
of the body as possible IMO.

>> +    out->message ("*%d: Register type's name NULL.\n",
>> +		  footnote_register_type_name_null);

> Nit: As the if blocks cover more than one line, should we use brackets here?

No, the general rule is more than one statement.  However, a comment
sort of counts as a statement.  And in some situations, a compound
statement should be braced as well, like it would be unusual to see
"if () while" without braces.

>> /* Dump the register REGNUM contents.  If REGNUM is -1, print the
>> header.  */
>> -  virtual void dump_reg (ui_file *file, int regnum) = 0;
>> +  virtual void dump_reg (ui_out *out, int regnum) = 0;

> "If REGNUM is -1, print the ... " Does this part of the comment still apply ? 

Nope, I removed that part of the comment, thanks.

Tom


More information about the Gdb-patches mailing list