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: RFC: Access TLS symbols without DWARF debuginfo v2


On Mon, Aug 28, 2006 at 11:08:11AM -0700, Jim Blandy wrote:
> Jan Kratochvil <jan.kratochvil@redhat.com> writes:
> > Forgot again, last time, sorry.  Isn't there some tool to generate this
> > changelog type templates from the diff?
> 
> If you write one, let me know.  :)

Several exit, I think.  I'm pretty sure I originally got this from
Diego Novillo, and then maybe fixed a bug in it.  Or this might be one
I didn't get from Diego; I didn't leave myself any notes about it :-)

#!/usr/bin/perl

use strict;

my $file = shift @ARGV;
open FILE, $file;

my $dfile;
my $ldfile;
my $ltext;

$ldfile = "";
$ltext = "";
while (<FILE>)
{
  chomp;
  if (/^--- ([^\t]+)\t/) {
    $dfile = $1;
  } elsif (/^@@.*@@ (.*)$/) {
    my $text = $1;
    if ($text !~ /^struct /) {
      $text =~ s/ *\(.*$//;
      $text =~ s/.*  *//;
    }
    next if $text eq $ltext;
    if ($dfile ne $ldfile) {
      print "\t* $dfile ";
      $ldfile = $dfile;
    } else {
      print "\t";
    }
    print "($text):\n";
    $ltext = $text;
  }
}

close OUT;


-- 
Daniel Jacobowitz
CodeSourcery


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