Pedro Alves wrote: > On Monday 01 June 2009 16:55:43, Aleksandar Ristovski wrote: > >> In corelow.c we have several architecture specific lines for >> determining ptid from core section. The same for getting >> section name given inferior_ptid. >> >> This patch moves architecture specific parts into two new >> functions: gdbarch_ptid_from_core_section and >> gdbarch_core_section_name_from_ptid. >> >> They replace Pedro's gdbarch_core_reg_section_encodes_pid >> since predicate is now redundant. >> >> I haven't added diffs for generated gdbarch.h/c, I would >> like to get your thoughts about this first. > > As we talked about on IRC the other day, a better solution > could require a redesign and normalization of how bfd exposes these > thread/lwp/process ids. In principle, this change is fine > with me, but it seems you forgot to attach the patch. :-) > > It would be nice if you included the nto bits in the > patch, so we can see how this helps in your case, so > that people can check upfront if this change is > sufficient and good. > oops... and you couldn't guess??? :-D Sorry about that. nto bits are actually included since otherwise gdb wouldn't properly add threads. We add threads like this: ptid_build(pid, 0, thread_id) as opposed to default ptid_build(pid, lwp, 0); Changelog again: * corelow.c (add_to_thread_list): Use new gdbarch_ptid_from_core_section. (get_core_register_section): Use new gdbarch_core_section_name_from_ptid. * gdbarch.sh (core_reg_section_encodes_pid): Deleted. (ptid_from_core_section, core_section_name_from_ptid): New functions. (default_ptid_from_core_section, default_core_section_name_from_ptid): New functions. * sol2-tdep.h (sol2_ptid_from_core_section, sol2_core_section_name_from_ptid): New declarations. * sol2-tdep.c (sol2_ptid_from_core_section, sol2_core_section_name_from_ptid): New functions. * amd64-sol2-tdep.c (amd64_sol2_init_abi): Register the two functions. * sparc-sol2-tdep.c (sparc32_sol2_init_abi): Likewise. * sparc64-sol2-tdep.c (sparc64_sol2_init_abi): Likewise. * i386-sol2-tdep.c (i386_sol2_init_abi): Likewise. -- Aleksandar Ristovski QNX Software Systems