public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: John Baldwin <jhb@FreeBSD.org>
To: gdb-patches@sourceware.org
Subject: Re: [PATCH 2/2] Include count of unexpected core files in gdb.sum summary
Date: Thu, 23 Jun 2022 15:09:07 -0700	[thread overview]
Message-ID: <9c1ff5a8-a08f-3994-f25e-416ad0b483bd@FreeBSD.org> (raw)
In-Reply-To: <2d2f3af3-a9d2-b84e-d0db-14585a6ae3db@palves.net>

On 6/23/22 12:12 PM, Pedro Alves wrote:
> On 2022-06-23 19:30, Pedro Alves wrote:
> 
>> +# Add our line to the summary line.
>> +sed "/=== gdb Summary ===/{
>> +n
>> +a\
>> +# of unexpected core files	$cores
>> +}" -i gdb.sum
> 
> I knew this -i wasn't portable as is, but then forgot to fix it before posting.  I now tried
> the script on a FreeBSD machine on the gcc compile farm, and tweaked this so it works with BSD
> seds too.  That sed invocation now looks like:
> 
>   # Add our line to the summary line.
>   sed -i'' -e "/=== gdb Summary ===/{
>   n
>   a\\
>   # of unexpected core files     $cores
>   }" gdb.sum
> 
> If -i doesn't work elsewhere, we can just do:
> 
>   sed .... < gdb.sum > gdb.sum.tmp
>   mv gdb.sum.tmp gdb.sum
> 
> Here's the updated patch.

Thanks for testing on FreeBSD. :)

I like the idea.  The only thing I see is that you might want to use a
pattern of '*core*' to look for cores instead of 'core*.'.  On BSD's at
least core files by default are named <program>.core (e.g. gdb.core) and
don't match the 'core*' glob.  If '*core*' has too many false positives
perhaps you can use 'core* *.core' as the patterns to look for?

-- 
John Baldwin

  reply	other threads:[~2022-06-23 22:09 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-23 18:30 [PATCH 0/2] " Pedro Alves
2022-06-23 18:30 ` [PATCH 1/2] Improve core file path detection & put cores in output dir Pedro Alves
2022-06-24  9:50   ` Andrew Burgess
2022-06-24 10:59     ` Pedro Alves
2022-06-23 18:30 ` [PATCH 2/2] Include count of unexpected core files in gdb.sum summary Pedro Alves
2022-06-23 19:12   ` Pedro Alves
2022-06-23 22:09     ` John Baldwin [this message]
2022-06-24 11:13       ` Pedro Alves
2022-06-24 11:17         ` Pedro Alves
2022-06-24 10:07     ` Andrew Burgess

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9c1ff5a8-a08f-3994-f25e-416ad0b483bd@FreeBSD.org \
    --to=jhb@freebsd.org \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).