The current desire is to jump to a function definition when I have the cursor on the line that calls it. So, if I have my cursor on the following line, I want to do a search for "/^ *0x38e6"
0x2bcd 0x16f:0x14dd E8160D call 0x38e6I accompished this by mapping the "comma" key as follows:
function Jumper()
let word = expand('<cword>')
call search ( "^ *" . word )
endfun
noremap , :call Jumper()<cr>
This works fine, and I am itching for more.
Using much the same method, I also set up "-d" to chase references to things in the data segment, so if you see a line like this:
0xed59 0xdb8:0x11d9 803EE21500 cmp byte [0x15e2],0x0You can put your cursor on 0x1532 and you will be taken to where that is defined in. Note that initialized data ends at 0x3056, so don't try using this on values beyond this.
Currently I have 4 vim mappings to help this project:
, -- go to address under cursor (handy for calls) -d -- go to data item under cursor -s -- fetch string at address referenced in this line -t -- swap bytesThe idea with swapping bytes is that we have items like this:
Data 000111c2 15e2: 0020 Data 000111c2 15e2: 0020 ; 0x2000 (8192)Typing "-t" with the cursor on the first line will turn it into the second.
Here the two byte value is little endian and is really 0x2000 = 8192 decimal
Both -s and -t use external python programs as helpers.
Tom's Electronics pages / tom@mmto.org