Hi!
test-coredump-unwind.c was not working for me because all addresses bigger
than 0x80000000 were read as 0x7FFFffff. This happens because strtol returns
LONG_MAX if the number is bigger than LONG_MAX.
BR,
  Petr
commit fc55f386de46aef2c96789f0e7cb2e53a7816d7d
Author: Petr Malat <o...@malat.biz>
Date:   Thu Dec 15 14:19:58 2016 +0100

    Read the address using strtoul(). If strtol() is used and the number is
    bigger than LONG_MAX, LONG_MAX is returned instead, which leads to a failure
    if the mapping address is 0x80000000 or larger on 32-bit platforms (and
    similarly for 64-bit platforms).

diff --git a/tests/test-coredump-unwind.c b/tests/test-coredump-unwind.c
index 5254708..22fe9e4 100644
--- a/tests/test-coredump-unwind.c
+++ b/tests/test-coredump-unwind.c
@@ -314,7 +314,7 @@ main(int argc UNUSED, char **argv)
   while (*argv)
     {
       char *colon;
-      long vaddr = strtol(*argv, &colon, 16);
+      unsigned long vaddr = strtoul(*argv, &colon, 16);
       if (*colon != ':')
         error_msg_and_die("Bad format: '%s'", *argv);
       if (_UCD_add_backing_file_at_vaddr(ui, vaddr, colon + 1) < 0)
_______________________________________________
Libunwind-devel mailing list
Libunwind-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/libunwind-devel

Reply via email to