On Thu, Aug 31, 2017 at 11:54:14AM +0200, Philippe De Muyter wrote: > Hi all > > I try to use libunwind (on arm linux) and I need a clarification. > > I use libunwind to get call stacks of a running multithreaded process. > > Do I need to call 'UPT_create' for each thread pid, as the documentation > of unw_init_remote() seems to imply, or only once for the process pid ? > > I looked at libunwind sources and /proc on my current linux machine, > and see that 'maps_init' in src/os-linux.h opens /proc/pid/maps, > while on my machine that file exists only with the pid of a process, > but not for any of its threads, so _UPT_get_proc_info, as called by > unw_step often fails, IIRC. > > Do I need to create my own find_proc_info accessor that will call > _UPT_find_proc_info replacing the thread (void *arg) by one > created for the process ?
I have tried that, and it shows no progress : libunwind retrieves some infos but misses also other ones, that gdb can retrieve on the same running process or core file : using libunwind : _UPT_find_proc_info(0x73bd48d4) ret = -10 _UPT_find_proc_info(0x73bd48e0) ret = -10 _UPT_find_proc_info(0x73b58644) ret = -10 _UPT_find_proc_info(0x6e0540bc) ret = -10 _UPT_find_proc_info(0x6e050868) ret = -10 _UPT_find_proc_info(0x6e050720) ret = -10 _UPT_find_proc_info(0x6e0580ac) ret = -10 gdb on the core file (gdb) x /i 0x6e0580ac 0x6e0580ac <convert_image_to_from+272>: subs r11, r0, #0 (gdb) x /i 0x6e050720 0x6e050720 <single_line_file_read+40>: subs r5, r0, #0 (gdb) x /i 0x6e050868 0x6e050868 <single_line_file_update+32>: subs r5, r0, #0 (gdb) x /i 0x6e0540bc 0x6e0540bc <put_header+332>: mov r4, r0 (gdb) x /i 0x73b58644 0x73b58644 <melpiResultGetPlateAttr+128>: str r0, [r6] (gdb) x /i 0x73bd48e0 0x73bd48e0 <gst_melpi_com+424>: ; <UNDEFINED> instruction: 0xe7f001f0 (gdb) x /i 0x73bd48d4 0x73bd48d4 <gst_melpi_com+412>: ; <UNDEFINED> instruction: 0xe7f001f0 (gdb) -- Philippe De Muyter +32 2 6101532 Macq SA rue de l'Aeronef 2 B-1140 Bruxelles _______________________________________________ Libunwind-devel mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/libunwind-devel
