]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
backends/: fixup stray uint32_t n_regs_mapping
authorSerhei Makarov <serhei@serhei.io>
Fri, 6 Mar 2026 20:25:16 +0000 (15:25 -0500)
committerSerhei Makarov <serhei@serhei.io>
Fri, 20 Mar 2026 18:12:42 +0000 (14:12 -0400)
These should have been size_t.

{changelog TBA}

backends/aarch64_initreg_sample.c
backends/i386_initreg_sample.c
backends/libebl_PERF_FLAGS.h
backends/x86_64_initreg_sample.c
libebl/ebl-hooks.h

index 23341f198efd5bc9b169bd0e44bd679981d929ae..d9b8a49bbeb1cd8fabf33691c85fc2719420213b 100644 (file)
@@ -40,7 +40,7 @@
 
 bool
 aarch64_sample_sp_pc (const Dwarf_Word *regs, uint32_t n_regs,
-                     const int *regs_mapping, uint32_t n_regs_mapping,
+                     const int *regs_mapping, size_t n_regs_mapping,
                      Dwarf_Word *sp, Dwarf_Word *pc)
 {
   return generic_sample_sp_pc (regs, n_regs, regs_mapping, n_regs_mapping,
index ae3ab11e9183d6b4d8708eee453c3b4a41f993b0..1e194146e4ec0df3950b6a029decfa307cc61b72 100644 (file)
@@ -47,7 +47,7 @@
 
 bool
 i386_sample_sp_pc (const Dwarf_Word *regs, uint32_t n_regs,
-                  const int *regs_mapping, uint32_t n_regs_mapping,
+                  const int *regs_mapping, size_t n_regs_mapping,
                   Dwarf_Word *sp, Dwarf_Word *pc)
 {
   /* XXX for dwarf_regs indices, compare i386_initreg.c */
index fe35adb71a2dc038fd530675d1e040efe4698545..f6d4715f847f4c29d2812741c17649177baf7031 100644 (file)
@@ -76,7 +76,7 @@
 /* TODO(REVIEW) Replaces x86_sample_sp_pc -- is this header the right location for it? */
 static inline bool
 generic_sample_sp_pc (const Dwarf_Word *regs, uint32_t n_regs,
-                     const int *regs_mapping, uint32_t n_regs_mapping,
+                     const int *regs_mapping, size_t n_regs_mapping,
                      Dwarf_Word *sp, uint sp_index /* into dwarf_regs */,
                      Dwarf_Word *pc, uint pc_index /* into dwarf_regs */)
 {
@@ -84,8 +84,8 @@ generic_sample_sp_pc (const Dwarf_Word *regs, uint32_t n_regs,
   if (pc != NULL) *pc = 0;
   /* TODO(REVIEW): Register locations could be cached and rechecked on
      a fastpath without needing to loop? */
-  int j, need_sp = (sp != NULL), need_pc = (pc != NULL);
-  for (j = 0; (need_sp || need_pc) && n_regs_mapping > (uint32_t)j; j++)
+  int need_sp = (sp != NULL), need_pc = (pc != NULL);
+  for (size_t j = 0; (need_sp || need_pc) && n_regs_mapping > j; j++)
     {
       if (n_regs < (uint32_t)j) break;
       if (need_sp && regs_mapping[j] == (int)sp_index)
index 83966ff9e38b79b7f769a9b7cef13c63d1e64e88..48a365f50a0910d4a97657e311b29fc695fc9e6e 100644 (file)
@@ -47,7 +47,7 @@
 
 bool
 x86_64_sample_sp_pc (const Dwarf_Word *regs, uint32_t n_regs,
-                    const int *regs_mapping, uint32_t n_regs_mapping,
+                    const int *regs_mapping, size_t n_regs_mapping,
                     Dwarf_Word *sp, Dwarf_Word *pc)
 {
   /* XXX for dwarf_regs indices, compare x86_64_initreg.c */
index 29ce96494ee8f7783fff183b71c724a9d2f51a1a..054284d8a160d3d0364aa43fdce6820914cbdc3a 100644 (file)
@@ -172,7 +172,7 @@ bool EBLHOOK(set_initial_registers_sample) (const Dwarf_Word *regs,
 /* Extract the stack address and instruction pointer from a register sample.  */
 bool EBLHOOK(sample_sp_pc) (const Dwarf_Word *regs, uint32_t n_regs,
                            const int *regs_mapping,
-                           uint32_t n_regs_mapping,
+                           size_t n_regs_mapping,
                            Dwarf_Word *sp, Dwarf_Word *pc);
 
 /* Translate from linux perf_events PERF_REGS_MASK and ABI to a generic