Print this page
6068 libdisasm: previnstr arch op should have a sane default
Reviewed by: Robert Mustacchi <rm@joyent.com>


 180         }
 181         free(save);
 182 #endif /* DIS_STANDALONE */
 183         return (0);
 184 }
 185 
 186 /* ARGSUSED */
 187 static int
 188 dis_sparc_max_instrlen(dis_handle_t *dhp)
 189 {
 190         return (4);
 191 }
 192 
 193 /* ARGSUSED */
 194 static int
 195 dis_sparc_min_instrlen(dis_handle_t *dhp)
 196 {
 197         return (4);
 198 }
 199 
 200 /*
 201  * The dis_i386.c comment for this says it returns the previous instruction,
 202  * however, I'm fairly sure it's actually returning the _address_ of the
 203  * nth previous instruction.
 204  */
 205 /* ARGSUSED */
 206 static uint64_t
 207 dis_sparc_previnstr(dis_handle_t *dhp, uint64_t pc, int n)
 208 {
 209         if (n <= 0)
 210                 return (pc);
 211 
 212         if (pc < n)
 213                 return (pc);
 214 
 215         return (pc - n*4);
 216 }
 217 
 218 /* ARGSUSED */
 219 static int
 220 dis_sparc_instrlen(dis_handle_t *dhp, uint64_t pc)
 221 {
 222         return (4);
 223 }
 224 




 180         }
 181         free(save);
 182 #endif /* DIS_STANDALONE */
 183         return (0);
 184 }
 185 
 186 /* ARGSUSED */
 187 static int
 188 dis_sparc_max_instrlen(dis_handle_t *dhp)
 189 {
 190         return (4);
 191 }
 192 
 193 /* ARGSUSED */
 194 static int
 195 dis_sparc_min_instrlen(dis_handle_t *dhp)
 196 {
 197         return (4);
 198 }
 199 





 200 /* ARGSUSED */
 201 static uint64_t
 202 dis_sparc_previnstr(dis_handle_t *dhp, uint64_t pc, int n)
 203 {
 204         if (n <= 0)
 205                 return (pc);
 206 
 207         if (pc < n)
 208                 return (pc);
 209 
 210         return (pc - n*4);
 211 }
 212 
 213 /* ARGSUSED */
 214 static int
 215 dis_sparc_instrlen(dis_handle_t *dhp, uint64_t pc)
 216 {
 217         return (4);
 218 }
 219