This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA] implement gcore on hp/ux


> Date: Tue, 10 Jan 2006 21:17:52 +0400
> From: Joel Brobecker <brobecker@adacore.com>
 
> 2005-01-10  Joel Brobecker  <brobecker@adacore.com>
> 
>         * target.h (target_ops): New method to_write_core_file.
>         (target_write_core_file_p): New macro.
>         (target_write_core_file): New macro.
>         * target.c (update_current_target): Add heritance of to_write_core_file.
>         * exec.c (exec_set_write_core_file): New function.
>         * defs.h (exec_set_write_core_file): Add declaration.
>         * gcore.c: Extract out the code writing the core file and move it
>         to gcore-elf.c.
>         * gcore-elf.c: New file, mostly extracted from gcore.o.
>         * Makefile.in (COMMON_OBS): Add gcore.o.
>         (gcore.o): Update dependencies.
>         (gcore-elf.o): Add rule.
>         * inf-ttrace (inf_ttrace_write_core_file): New function.
>         (inf_ttrace_target): set the to_write_core_file method.
>         * config/alpha/fbsd.mh (NATDEPFILES): Likewise.
>         * config/arm/linux.mh (NATDEPFILES): Likewise.
>         * config/i386/fbsd.mh (NATDEPFILES): Likewise.
>         * config/i386/fbsd64.mh (NATDEPFILES): Likewise.
>         * config/i386/i386sol2.mh (NATDEPFILES): Likewise.
>         * config/i386/i386v42mp.mh (NATDEPFILES): Likewise.
>         * config/i386/linux.mh (NATDEPFILES): Likewise.
>         * config/i386/linux64.mh (NATDEPFILES): Likewise.
>         * config/i386/sol2-64.mh (NATDEPFILES): Likewise.
>         * config/ia64/linux.mh (NATDEPFILES): Likewise.
>         * config/m32r/linux.mh (NATDEPFILES): Likewise.
>         * config/m68k/linux.mh (NATDEPFILES): Likewise.
>         * config/mips/linux.mh (NATDEPFILES): Likewise.
>         * config/pa/linux.mh (NATDEPFILES): Likewise.
>         * config/powerpc/linux.mh (NATDEPFILES): Likewise.
>         * config/powerpc/ppc64-linux.mh (NATDEPFILES): Likewise.
>         * config/s390/s390.mh (NATDEPFILES): Likewise.
>         * config/sparc/fbsd.mh (NATDEPFILES): Likewise.
>         * config/sparc/linux.mh (NATDEPFILES): Likewise.
>         * config/sparc/linux64.mh (NATDEPFILES): Likewise.
>         * config/sparc/sol2.mh (NATDEPFILES): Likewise.
> 
> Tested on x86-linux and pa32-hpux. No regression on the linux
> side. On the hp/ux side, we get improvments from auxv.exp and
> gcore.exp now passes.
> 
> Comments? Ok to apply?

I'm not sure I like the exec_set_write_core_file() hack.  Targets
should really do this the proper way, initializing their target vector
properly.  Can't you get rid of it by setting to_write_core_file in
procfs.c:init_ptoc_ops() and linux-nat.c:linux_target()?

The HP-UX code looks good, but could you please use xsnprintf()
instead of sprintf()?

Mark


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]