Diff for /gforth/dis-gdb.fs between versions 1.10 and 1.14

version 1.10, 2010/12/31 18:09:02 version 1.14, 2011/12/31 15:29:25
Line 1 Line 1
 \ dis-gdb.fs    disassembler using gdb  \ dis-gdb.fs    disassembler using gdb
 \  \
 \ Copyright (C) 2004,2007,2008,2010 Free Software Foundation, Inc.  \ Copyright (C) 2004,2007,2008,2010,2011 Free Software Foundation, Inc.
   
 \ This file is part of Gforth.  \ This file is part of Gforth.
   
Line 22 Line 22
     swap >r dup >r extend-mem ( to addr3 u1+u2 r: addr2 u2 )      swap >r dup >r extend-mem ( to addr3 u1+u2 r: addr2 u2 )
     rot r> r> rot rot chars move ;      rot r> r> rot rot chars move ;
   
   defer gdb-addr-sep-char ( -- c )
   
   ',' constant #comma
   
   : check-gdb-syntax ( -- c )
       \ gdb-7.0 and earlier do what we want with "disassemble addr1 addr2"
       \ gdb-7.1 and later only work with         "disaesemble addr1,addr2"
       \ try the old syntax to see if it works
       s" gdb -ex 'disassemble 0 1' -ex 'quit' 2>/dev/null" r/o open-pipe throw
       dup slurp-fid rot close-pipe throw drop
       s" Dump of assembler code from" search nip nip if
           ['] bl
       else
           ['] #comma
       then
       dup is gdb-addr-sep-char
       execute ;
   
   ' check-gdb-syntax is gdb-addr-sep-char
   
 : disasm-gdb { addr u -- }  : disasm-gdb { addr u -- }
     base @ >r hex      base @ >r hex
     s\" type mktemp >/dev/null && type gdb >/dev/null && file=`mktemp -t gforthdis.XXXXXXXXXX` && file2=`mktemp -t gforthdis.XXXXXXXXXX` && echo \"set verbose off\nset logging file $file\nset logging on\ndisas " save-mem ( addr u addr1 u1 )      s\" type mktemp >/dev/null && type gdb >/dev/null && file=`mktemp -t gforthdis.XXXXXXXXXX` && file2=`mktemp -t gforthdis.XXXXXXXXXX` && echo \"set verbose off\nset logging file $file\nset logging on\ndisas " save-mem ( addr u addr1 u1 )
     addr 0 <<# ',' hold # #s 'x hold # #> append-extend-string #>>      addr 0 <<# gdb-addr-sep-char hold # #s 'x hold # #> append-extend-string #>>
     addr u + 0 <<# # #s 'x hold # #> append-extend-string #>>      addr u + 0 <<# # #s 'x hold # #> append-extend-string #>>
     r> base ! cr      r> base ! cr
     s\" \nset logging off\nquit\n\" >$file2 && gdb -nx -q -p `ps -p $$ -o ppid=` -x $file2 2>/dev/null >/dev/null && rm $file2 && grep -v \"of assembler\" $file && rm $file" append-extend-string      s\" \nset logging off\nquit\n\" >$file2 && gdb -nx -q -p `ps -p $$ -o ppid=` -x $file2 2>/dev/null >/dev/null && rm $file2 && grep -v \"of assembler\" $file && rm $file" append-extend-string

Removed from v.1.10  
changed lines
  Added in v.1.14


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>