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: How to implement gcore on pa-hpux ?


> On Fri, Jan 06, 2006 at 02:28:24PM +0400, Joel Brobecker wrote:
> > It's not as elegant as having a gdbarch or target method, but it's
> > probably easier to implement. We defer a bit the work that makes this
> > a method of some vector, but it's not necessary right now. Perhaps
> > the pragmatic thing to do would be to wait until we need it before
> > we start worrying about it. Even then, the work is slightly prepared
> > because we already have the genericity based on the hook.
> > 
> > What do you guys think?
> 
> I think that if you need to add new files and rely on magic function
> names, then you're already past the time when you needed to add things
> to a vector.

Magic function name? Ouch, my heart ;-).

OK, will try to play with the target vector. For the record, here is
what I had in mind. I implemented it because it's not that far off the
road to using the target vector. In this case, it's the gcore module
itself that holds the method pointer rather than the target vector.
It's not as powerful, because it is not dynamic the way target vectors
are, but it's not worse than before.

2006-01-09  Joel Brobecker  <brobecker@adacore.com>

        * gcore.c: Extract all the code writing the core file and move
        it to a new file gcore-elf.c. Update list of #include's.
        (write_core_p): New static variable.
        (gcore_command): Call write_core_p to write the core file.
        (gcore_set_write_core): New function.
        * defs.h (write_core_ftype): New typdef.
        (gcore_set_write_core): Add declaration.
        * Makefile.in (COMMON_OBS): Add gcore.o
        (gcore.o): Update dependencies.
        (gcore-elf.o): Add rule.
        * config/alpha/alpha-linux.mh (NATDEPFILES): Replace gcore.o by
        gcore-elf.o.
        * 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.
        * inf-ttrace.c (inf_ttrace_write_core): New function.
        (_initialize_inf_ttrace): Set gcore write_core method
        to inf_ttrace_write_core.

Tested on x86-linux and pa32-hpux, no regression.

-- 
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]