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]

[RFA] implement gcore on hp/ux


Hello,

The attached patch aims at implementing the gcore command on hp/ux.
Contrary to the current gcore implementation where we write the core
file ourselves, the implementation on hp/ux relies on the TT_PROC_CORE
ttrace command.

In order to make the gcore command a bit more generic, I added a new
method in the target vector which, when set, is responsible for writing
the core file.

The core of gcore.c that used to write the core file has been moved
to gcore-elf.c, and the exec_ops target vector is updated there.
Since there is now a second method to update (the one we just added),
I added a new function in exec.c with a corresponding declaration in
defs.h (besides the one we already have).

gcore.o is now always part of the build. When the target does not
support core files, the debugger now prints that this command is
not supported on this platform.

All builds that were including gcore.o are now including gcore-elf.o.
Including this file causes us to update the exec target ops as we used
to, and hence hooks up the "elf" implementation.

For the ttrace target, it's straighforward...

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?

Thanks,
-- 
Joel

Attachment: gcore-hpux.diff
Description: Text document

Attachment: gcore-elf.c
Description: Text document


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