Re: [PATCH 2/3 v4] Refactor and expose core-dumping functionality

Doug Evans
2014-06-05T16:28:28Z

On Thu, Jun 5, 2014 at 6:03 AM, Gary Benson <gbenson@redhat.com> wrote:
> This patch exposes the functions that dump core outside utils.c.
> The function can_dump_core has been split into two new functions,
> check_can_dump_core and warn_cant_dump_core so that the check and
> the printed warning can be separated. A new function
> check_can_dump_core_warn replaces the original can_dump_core.
>
>
> gdb/
> 2014-06-05 Gary Benson <gbenson@redhat.com>
>
> * utils.h (check_can_dump_core): New declaration.
> (warn_cant_dump_core): Likewise.
> (dump_core): Likewise.
> * utils.c (dump_core): Made nonstatic.
> (can_dump_core): Removed function.
> (check_can_dump_core): New function.
> (warn_cant_dump_core): Likewise.
> (check_can_dump_core_warn): Likewise.
> (internal_vproblem): Replace calls to can_dump_core with
> calls to check_can_dump_core_warn.

check_can_dump_core feels a bit clumsy over the original can_dump_core.
can_dump_core (or can_dump_core_p) reads better to me.
[And now it does what it says it does, without the side-effect of the printf.]

Not sure if I'd rename check_can_dump_core_warn (or delete it).