Rev 2927 | Rev 3153 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2927 | Rev 3149 | ||
---|---|---|---|
Line 104... | Line 104... | ||
104 | /** Print table of active breakpoints */ |
104 | /** Print table of active breakpoints */ |
105 | int cmd_print_breakpoints(cmd_arg_t *argv __attribute__((unused))) |
105 | int cmd_print_breakpoints(cmd_arg_t *argv __attribute__((unused))) |
106 | { |
106 | { |
107 | unsigned int i; |
107 | unsigned int i; |
108 | char *symbol; |
108 | char *symbol; |
109 | 109 | ||
110 | if (sizeof(void *) == 4) { |
110 | #ifdef __32_BITS__ |
111 | printf("# Count Address In symbol\n"); |
111 | printf("# Count Address In symbol\n"); |
112 | printf("-- ----- ---------- ---------\n"); |
112 | printf("-- ----- ---------- ---------\n"); |
113 | } else { |
113 | #endif |
- | 114 | ||
- | 115 | #ifdef __64_BITS__ |
|
114 | printf("# Count Address In symbol\n"); |
116 | printf("# Count Address In symbol\n"); |
115 | printf("-- ----- ------------------ ---------\n"); |
117 | printf("-- ----- ------------------ ---------\n"); |
116 | } |
118 | #endif |
117 | 119 | ||
118 | for (i = 0; i < BKPOINTS_MAX; i++) |
120 | for (i = 0; i < BKPOINTS_MAX; i++) |
119 | if (breakpoints[i].address) { |
121 | if (breakpoints[i].address) { |
120 | symbol = get_symtab_entry(breakpoints[i].address); |
122 | symbol = get_symtab_entry(breakpoints[i].address); |
121 | 123 | ||
122 | if (sizeof(void *) == 4) |
124 | #ifdef __32_BITS__ |
123 | printf("%-2u %-5d %#10zx %s\n", i, breakpoints[i].counter, |
125 | printf("%-2u %-5d %#10zx %s\n", i, breakpoints[i].counter, |
124 | breakpoints[i].address, symbol); |
126 | breakpoints[i].address, symbol); |
125 | else |
127 | #endif |
- | 128 | ||
- | 129 | #ifdef __64_BITS__ |
|
126 | printf("%-2u %-5d %#18zx %s\n", i, breakpoints[i].counter, |
130 | printf("%-2u %-5d %#18zx %s\n", i, breakpoints[i].counter, |
127 | breakpoints[i].address, symbol); |
131 | breakpoints[i].address, symbol); |
- | 132 | #endif |
|
- | 133 | ||
128 | } |
134 | } |
129 | return 1; |
135 | return 1; |
130 | } |
136 | } |
131 | 137 | ||
132 | /* Setup DR register according to table */ |
138 | /* Setup DR register according to table */ |
Line 160... | Line 166... | ||
160 | dr7 &= ~ (0x3 << (16 + 4*curidx)); |
166 | dr7 &= ~ (0x3 << (16 + 4*curidx)); |
161 | dr7 &= ~ (0x3 << (18 + 4*curidx)); |
167 | dr7 &= ~ (0x3 << (18 + 4*curidx)); |
162 | if ((flags & BKPOINT_INSTR)) { |
168 | if ((flags & BKPOINT_INSTR)) { |
163 | ; |
169 | ; |
164 | } else { |
170 | } else { |
- | 171 | ||
165 | if (sizeof(int) == 4) |
172 | #ifdef __32_BITS__ |
166 | dr7 |= ((unative_t) 0x3) << (18 + 4*curidx); |
173 | dr7 |= ((unative_t) 0x3) << (18 + 4 * curidx); |
- | 174 | #endif |
|
- | 175 | ||
167 | else /* 8 */ |
176 | #ifdef __64_BITS__ |
168 | dr7 |= ((unative_t) 0x2) << (18 + 4*curidx); |
177 | dr7 |= ((unative_t) 0x2) << (18 + 4 * curidx); |
- | 178 | #endif |
|
169 | 179 | ||
170 | if ((flags & BKPOINT_WRITE)) |
180 | if ((flags & BKPOINT_WRITE)) |
171 | dr7 |= ((unative_t) 0x1) << (16 + 4*curidx); |
181 | dr7 |= ((unative_t) 0x1) << (16 + 4 * curidx); |
172 | else if ((flags & BKPOINT_READ_WRITE)) |
182 | else if ((flags & BKPOINT_READ_WRITE)) |
173 | dr7 |= ((unative_t) 0x3) << (16 + 4*curidx); |
183 | dr7 |= ((unative_t) 0x3) << (16 + 4 * curidx); |
174 | } |
184 | } |
175 | 185 | ||
176 | /* Enable global breakpoint */ |
186 | /* Enable global breakpoint */ |
177 | dr7 |= 0x2 << (curidx*2); |
187 | dr7 |= 0x2 << (curidx*2); |
178 | 188 |