This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Patch]: Little Cleanup


Markus Deuling wrote:
@@ -2909,8 +2902,7 @@
if (!breakpoints_inserted && !ecs->another_trap)
{
- breakpoints_failed = insert_breakpoints ();
- if (breakpoints_failed)
+ if (insert_breakpoints ())
{
stop_stepping (ecs);
return;



Actually, I find your version harder to read for someone not knowing the insert_breakpoints
API by heart. To me, it looks like you are testing a function that returns a boolean.
I read it as: "if insert_breakpoints succeeded". It looks like the de facto standard is to use:


if (insert_breakpoints () != 0)

The current version doesn't do it either, but 'breakpoints_failed'
gives a pretty good hint.
It may actually by a GNU coding convention, but I'm not sure.

(Just being picky on a Saturday morning, ignore at will.)

Cheers,
Pedro Alves



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]