Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.com>
To: Michael Snyder <msnyder@redhat.com>
Cc: Daniel Jacobowitz <drow@false.org>, 	gdb-patches@sources.redhat.com
Subject: Re: How to implement gcore on pa-hpux ?
Date: Thu, 05 Jan 2006 03:24:00 -0000	[thread overview]
Message-ID: <20060105032232.GB4734@adacore.com> (raw)
In-Reply-To: <43BC1DFF.2080501@redhat.com>

> The "gcore" command is actually defined in gcore.c.  If someone
> (hpux) wanted to define it differently, it should be as simple as
> linking in your own (eg.) hpux-gcore.c module, *instead of* the
> generic gcore.c module.
> 
> Current targets that implement gcore in the generic way
> do so by adding gcore.o to the NATDEPFILES.

That's almost the approach I took. The problem with the above
is that you end up rewriting a bunch of code that could have
been reused (namely the code that adds the "gcore" command,
and the part of gcore_command that deals with arguments).

If you really want to know, I did

gcore_command (...)
{
  [part that deals with arguments]

#ifdef HAVE_TTRACE
  dump_core_file (...);
  return;
#endif

  [rest of the regular gcore_command]
}

This is why I'm suggesting that the part that writes the core file
become a method. That way, we can have several types of gcore
implementations.

One variation of your proposal is maybe to extract out the part
that writes the core file from gcore.c, move it to gcore-elf.c
(is this elf only????), and then have a gcore-hpux.c. I'm not too
fond of this approach, though, because eventually we want to be
able to have support for multiple targets in the same debugger.
Say we have a HP/UX native debugger that also supports a target
that the current gcore module supports. We'd have to choose one
or the other, but we couldn't have both.

-- 
Joel



  reply	other threads:[~2006-01-05  3:24 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-04 17:40 Joel Brobecker
2006-01-04 18:40 ` Daniel Jacobowitz
2006-01-04 19:12   ` Michael Snyder
2006-01-05  3:24     ` Joel Brobecker [this message]
2006-01-06  4:40       ` Michael Snyder
2006-01-06 10:28         ` Joel Brobecker
2006-01-06 13:43           ` Daniel Jacobowitz
2006-01-09  5:59             ` Joel Brobecker
2006-01-22 20:43               ` Daniel Jacobowitz
2006-01-05  4:03   ` Joel Brobecker
2006-01-05  5:02     ` Daniel Jacobowitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060105032232.GB4734@adacore.com \
    --to=brobecker@adacore.com \
    --cc=drow@false.org \
    --cc=gdb-patches@sources.redhat.com \
    --cc=msnyder@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox