]> sourceware.org Git - systemtap.git/commitdiff
Fix _stp_get_arg32_by_number() for RHEL5.
authorDavid Smith <dsmith@redhat.com>
Mon, 19 Nov 2012 20:08:43 +0000 (14:08 -0600)
committerDavid Smith <dsmith@redhat.com>
Mon, 19 Nov 2012 20:08:43 +0000 (14:08 -0600)
* runtime/regs.c (_stp_get_arg32_by_number): Handle i386/x86_64
  differences better for systems without x86 register unification, like
  RHEL5.
 Please enter the commit message for your changes. Lines starting

runtime/regs.c

index f9c8cdda4e841a82662bd62c4a72acfa798c4eff..eece48939df68a6fb3f2f2b8531cf39df693c74c 100644 (file)
@@ -79,6 +79,13 @@ static int64_t __stp_sign_extend32(int64_t val)
  * -1 if the arg number is invalid.
  * We assume that the regs pointer is valid.
  */
+
+#if defined(__i386__)
+#define ERREG(nm, regs) EREG(nm, regs)
+#else  /* x86_64 */
+#define ERREG(nm, regs) RREG(nm, regs)
+#endif
+
 static int _stp_get_arg32_by_number(int n, int nr_regargs,
                                        struct pt_regs *regs, long *val)
 {
@@ -95,9 +102,9 @@ static int _stp_get_arg32_by_number(int n, int nr_regargs,
                return (user_mode(regs) ? 2 : 1);
        } else {
                switch (n) {
-               case 1: *val = EREG(ax, regs); break;
-               case 2: *val = EREG(dx, regs); break;
-               case 3: *val = EREG(cx, regs); break;
+               case 1: *val = (int32_t)(ERREG(ax, regs)); break;
+               case 2: *val = (int32_t)(ERREG(dx, regs)); break;
+               case 3: *val = (int32_t)(ERREG(cx, regs)); break;
                default:
                        /* gcc rejects regparm values > 3. */
                        return -1;
This page took 0.029796 seconds and 5 git commands to generate.