This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 2/3 v4] Refactor and expose core-dumping functionality
- From: Doug Evans <xdje42 at gmail dot com>
- To: Gary Benson <gbenson at redhat dot com>
- Cc: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>, Andrew Burgess <aburgess at broadcom dot com>, Eli Zaretskii <eliz at gnu dot org>, Florian Weimer <fw at deneb dot enyo dot de>, Mark Kettenis <mark dot kettenis at xs4all dot nl>, Pedro Alves <palves at redhat dot com>, Tom Tromey <tromey at redhat dot com>
- Date: Thu, 5 Jun 2014 09:28:06 -0700
- Subject: Re: [PATCH 2/3 v4] Refactor and expose core-dumping functionality
- Authentication-results: sourceware.org; auth=none
- References: <20140605130140 dot GA20572 at blade dot nx> <20140605130322 dot GC20572 at blade dot nx>
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).