diff options
| author | Kai Germaschewski <kai@tp1.ruhr-uni-bochum.de> | 2002-06-05 02:17:10 -0500 |
|---|---|---|
| committer | Kai Germaschewski <kai@tp1.ruhr-uni-bochum.de> | 2002-06-05 02:17:10 -0500 |
| commit | 4a2fa6ce790dd9291e83e121fe6a6eb4c8fa1450 (patch) | |
| tree | 2e63485d4fcf345cc8c3846ed0f63c8f847f98c1 /scripts/makelst | |
| parent | 00b454db90622ce85e11be0ec60f53dd375d6d0a (diff) | |
kbuild: Fix 'make some/dir/foo.lst'
Just use 'make some/dir/foo.lst' to produce mixed source code and
assembly for debugging. (If the object gets linked in and you have
a System.map, it'll relocate appropriately)
Apart from the needed Makefile bits, also clean up the script
"makelst".
Diffstat (limited to 'scripts/makelst')
| -rwxr-xr-x[-rw-r--r--] | scripts/makelst | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/scripts/makelst b/scripts/makelst index a76ca78b34ac..3c04512728f2 100644..100755 --- a/scripts/makelst +++ b/scripts/makelst @@ -6,17 +6,26 @@ # William Stearns <wstearns@pobox.com> #%.lst: %.c # $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(CFLAGS_$@) -g -c -o $*.o $< -# $(TOPDIR)/scripts/makelst $* $(TOPDIR) $(OBJDUMP) +# $(TOPDIR)/scripts/makelst $*.o $(TOPDIR)/System.map $(OBJDUMP) # # Copyright (C) 2000 IBM Corporation # Author(s): DJ Barrow (djbarrow@de.ibm.com,barrow_dj@yahoo.com) # -t1=`$3 --syms $2/$1.o | grep .text | grep " F " | head -n 1` -t2=`echo $t1 | gawk '{ print $6 }'` -t3=`grep $t2 $2/System.map` -t4=`echo $t3 | gawk '{ print $1 }'` -t5=`echo $t1 | gawk '{ print $1 }'` -t6=`echo $t4 - $t5 | sed -e s/a/A/g -e s/b/B/g -e s/c/C/g -e s/d/D/g -e s/e/E/g -e s/f/F/g` -t7=`( echo ibase=16 ; echo $t6 ) | bc` -$3 --source --adjust-vma=$t7 $2/$1.o > $2/$1.lst +t1=`$3 --syms $1 | grep .text | grep " F " | head -n 1` +if [ -n "$t1" ]; then + t2=`echo $t1 | gawk '{ print $6 }'` + if [ ! -r $2 ]; then + echo "No System.map" >&2 + t7=0 + else + t3=`grep $t2 $2` + t4=`echo $t3 | gawk '{ print $1 }'` + t5=`echo $t1 | gawk '{ print $1 }'` + t6=`echo $t4 - $t5 | tr a-f A-F` + t7=`( echo ibase=16 ; echo $t6 ) | bc` + fi +else + t7=0 +fi +$3 --source --adjust-vma=$t7 $1 |
