]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Arch-abstraction: introduce constants for min and max instruction sizes.
authorNicholas Nethercote <n.nethercote@gmail.com>
Sat, 4 Sep 2004 15:28:37 +0000 (15:28 +0000)
committerNicholas Nethercote <n.nethercote@gmail.com>
Sat, 4 Sep 2004 15:28:37 +0000 (15:28 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2660

cachegrind/cg_main.c
coregrind/vg_errcontext.c
coregrind/vg_symtab2.c
include/x86/tool_arch.h

index 059df5be1122fd184ee217a804f343fdbc151e1f..e2bd63b662f560db074695d9ef55f5aa1417e662 100644 (file)
@@ -45,7 +45,6 @@ typedef struct {
 /*--- Constants                                            ---*/
 /*------------------------------------------------------------*/
 
-#define MAX_x86_INSTR_SIZE    16    // According to ia32 sw dev manual vol 2
 #define MIN_LINE_SIZE         16
 #define FILE_LEN              256
 #define FN_LEN                256
@@ -431,8 +430,8 @@ void end_of_x86_instr(UCodeBlock* cb, instr_info* i_node, Bool bb_seen_before,
            t_data_addr1 = INVALID_TEMPREG,
            t_data_addr2 = INVALID_TEMPREG;
 
-   sk_assert(instr_size >= 1 && 
-             instr_size <= MAX_x86_INSTR_SIZE);
+   sk_assert(instr_size >= MIN_INSTR_SIZE && 
+             instr_size <= MAX_INSTR_SIZE);
 
 #define IS_(X)      (INVALID_TEMPREG != t_##X##_addr)
 #define INV(qqt)    (INVALID_TEMPREG == (qqt))
index f61668b7f4e0d94332d45f893637168bf4a2e5a8..ae1c2927dd23ea9c807376adf0e2e71a2699dfba 100644 (file)
@@ -361,7 +361,8 @@ static void gen_suppression(Error* err)
    i = 0;
    do {
       Addr eip = ec->eips[i];
-      if (i > 0) eip--;                 /* point to calling line */
+      if (i > 0) 
+         eip -= MIN_INSTR_SIZE;     // point to calling line
       if ( VG_(get_fnname_nodemangle) (eip, buf,  M_VG_ERRTXT) ) {
          // Stop after "main";  if main() is recursive, stop after last main().
 
index a250d4abba4ed2713be60b0205b478bb8179cfc3..9df9f8364ed14f652ea763426b2726b72adcaad4 100644 (file)
@@ -2226,7 +2226,8 @@ void VG_(mini_stack_dump) ( Addr eips[], UInt n_eips )
    i = 0;
    do {
       Addr eip = eips[i];
-      if (i  > 0) eip--;            /* point to calling line */
+      if (i > 0) 
+         eip -= MIN_INSTR_SIZE;     // point to calling line
       VG_(describe_eip)(eip, buf, M_VG_ERRTXT);
 
       if ( ! VG_(clo_show_below_main)) {
index 2e10c75c3b0244daa300b59a46dbe15d88f073a3..272e2fa3947da6fd04e0a40b42925257e72af98f 100644 (file)
 #define FIRST_ARCH_REG  R_EAX
 #define LAST_ARCH_REG   R_EDI
 
-#define N_ARCH_REGS     8
+#define N_ARCH_REGS        8
+
+#define MIN_INSTR_SIZE     1
+#define MAX_INSTR_SIZE    16
 
 #endif   // __X86_TOOL_ARCH_H