sewardj | 3b29048 | 2011-05-06 21:02:55 +0000 | [diff] [blame^] | 1 | # connect gdb to Valgrind gdbserver: |
| 2 | target remote | ./vgdb --wait=60 --vgdb-prefix=./vgdb-prefix-mcvabits |
| 3 | monitor vg.set vgdb-error 999999 |
| 4 | # |
| 5 | # |
| 6 | # insert break: |
| 7 | break breakme |
| 8 | # |
| 9 | # continue till //1break: |
| 10 | continue |
| 11 | # |
| 12 | # up to main: |
| 13 | up |
| 14 | # |
| 15 | # print local string variables: |
| 16 | print main_name |
| 17 | print undefined |
| 18 | # save address of undefined |
| 19 | set $0xundefined = &undefined |
| 20 | # |
| 21 | # Verif A-bits, V-bits, Get V-bits: A,V,G [0..9] |
| 22 | eval "monitor mc.check_memory addressable 0x%x 10", $0xundefined |
| 23 | eval "monitor mc.check_memory defined 0x%x 10", $0xundefined |
| 24 | eval "monitor mc.get_vbits 0x%x 10", $0xundefined |
| 25 | # |
| 26 | # continue till //2break: |
| 27 | continue |
| 28 | # |
| 29 | # A,V,G [0..9] after the undefinition of some bytes by executable: |
| 30 | eval "monitor mc.check_memory addressable 0x%x 10", $0xundefined |
| 31 | eval "monitor mc.check_memory defined 0x%x 10", $0xundefined |
| 32 | eval "monitor mc.get_vbits 0x%x 10", $0xundefined |
| 33 | # |
| 34 | # Redefine [2..4] |
| 35 | set $0xundefined_2 = (char*)$0xundefined + 2 |
| 36 | eval "monitor mc.make_memory defined 0x%x 3", $0xundefined_2 |
| 37 | # A,V,G |
| 38 | eval "monitor mc.check_memory addressable 0x%x 10", $0xundefined |
| 39 | eval "monitor mc.check_memory defined 0x%x 10", $0xundefined |
| 40 | eval "monitor mc.get_vbits 0x%x 10", $0xundefined |
| 41 | # |
| 42 | # Undefine [2..5] |
| 43 | eval "monitor mc.make_memory undefined 0x%x 4", $0xundefined_2 |
| 44 | # A,V,G [0..9] |
| 45 | eval "monitor mc.check_memory addressable 0x%x 10", $0xundefined |
| 46 | eval "monitor mc.check_memory defined 0x%x 10", $0xundefined |
| 47 | eval "monitor mc.get_vbits 0x%x 10", $0xundefined |
| 48 | # |
| 49 | # noaccess [2..3] |
| 50 | eval "monitor mc.make_memory noaccess 0x%x 2", $0xundefined_2 |
| 51 | # A,V,G [0..1] |
| 52 | eval "monitor mc.check_memory addressable 0x%x 2", $0xundefined |
| 53 | eval "monitor mc.check_memory defined 0x%x 2", $0xundefined |
| 54 | eval "monitor mc.get_vbits 0x%x 2", $0xundefined |
| 55 | # A,V,G [2..3] |
| 56 | eval "monitor mc.check_memory addressable 0x%x 2", $0xundefined_2 |
| 57 | eval "monitor mc.check_memory defined 0x%x 2", $0xundefined_2 |
| 58 | eval "monitor mc.get_vbits 0x%x 2", $0xundefined_2 |
| 59 | # A,V,G [4..9] |
| 60 | set $0xundefined_4 = (char*) $0xundefined_2 + 2 |
| 61 | eval "monitor mc.check_memory addressable 0x%x 6", $0xundefined_4 |
| 62 | eval "monitor mc.check_memory defined 0x%x 6", $0xundefined_4 |
| 63 | eval "monitor mc.get_vbits 0x%x 6", $0xundefined_4 |
| 64 | # |
| 65 | # ifaddressabledefined undefined[0..9] |
| 66 | eval "monitor mc.make_memory ifaddressabledefined 0x%x 10", $0xundefined |
| 67 | # A,V,G |
| 68 | eval "monitor mc.check_memory addressable 0x%x 10", $0xundefined |
| 69 | eval "monitor mc.check_memory defined 0x%x 10", $0xundefined |
| 70 | eval "monitor mc.get_vbits 0x%x 10", $0xundefined |
| 71 | # |
| 72 | monitor vg.kill |
| 73 | quit |