Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Kevin Buettner <kevinb@cygnus.com>
To: gdb-patches@sources.redhat.com
Subject: Re: [PATCH RFC] abort() to internal_error()
Date: Tue, 20 Feb 2001 23:14:00 -0000	[thread overview]
Message-ID: <1010221071355.ZM27256@ocotillo.lan> (raw)
In-Reply-To: <1010221065142.ZM27191@ocotillo.lan>

On Feb 20, 11:51pm, Kevin Buettner wrote:

> ...  As is often the case for this sort of job, I used a Perl script
> to perform the substitutions.  I'll post the script as a reply to
> this message.

Below is the script that I used to create the patch consisting of the
abort () -> internal_error () substitutions.  This patch may be found
at

    http://sources.redhat.com/ml/gdb-patches/2001-02/msg00415.html

To run the script, simply cd to your gdb source directory (*not* the
top level directory though) and do:

    subst-abort-internal_error .

Note the dot.  If you like, you can skip the ``cd'' step and simply
provide the path to your gdb sources in place of the dot.  Again, the
path in question should be to your gdb directory, i.e, the one that
contains the file "infptrace.c".

Also note that most of you reading this message will not need to run
this script as I will commit the changes to the FSF repository in the
usual fashion.  Those of you with diverging source trees may wish to
run it on your sources to make your merging with the FSF repository
easier.

--- subst-abort-internal_error ---
#!/usr/bin/perl -w

use File::Find;
use FileHandle;
use IPC::Open3;
use English;

my ($root) = @ARGV;

if (!defined($root)) {
    die "Usage: $0 root\n";
}

@ARGV = ();

find(
    sub { 
	if ($_ eq 'testsuite' || $_ eq 'gdbserver' || (-d && /-share$/)) {
	    $File::Find::prune = 1;
	} elsif (-f && -T && /\.[hc]$/ && $_ ne "gnu-regex.c") {
	    push @ARGV, $File::Find::name;
	}
    },
    $root
);

$INPLACE_EDIT = '';
undef $/;			# slurp entire files

while (<>) {
    s/\babort\ ?\(\);/internal_error (__FILE__, __LINE__, "failed internal consistency check");/gx;
    print;
}
--- end subst-abort-internal_error ---


  reply	other threads:[~2001-02-20 23:14 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-02-20 22:51 Kevin Buettner
2001-02-20 23:14 ` Kevin Buettner [this message]
2001-02-21  2:07 ` Eli Zaretskii
2001-02-21  7:54   ` Kevin Buettner
2001-02-21  8:03     ` Eli Zaretskii
2001-02-21  8:46       ` Kevin Buettner
2001-02-21  9:09         ` Eli Zaretskii
2001-02-24 20:46         ` Kevin Buettner

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=1010221071355.ZM27256@ocotillo.lan \
    --to=kevinb@cygnus.com \
    --cc=gdb-patches@sources.redhat.com \
    /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