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