This is the mail archive of the
mailing list for the GDB project.
Re: [rfc][2/3] Remote core file generation: register notes
- From: "Ulrich Weigand" <uweigand at de dot ibm dot com>
- To: pedro at codesourcery dot com (Pedro Alves)
- Cc: gdb-patches at sourceware dot org
- Date: Wed, 9 Nov 2011 19:18:51 +0100 (CET)
- Subject: Re: [rfc][2/3] Remote core file generation: register notes
Pedro Alves wrote:
> On Friday 21 October 2011 19:56:39, Ulrich Weigand wrote:
> > write_gcore_file today uses a target hook target_make_corefile_notes in
> > order to generate the core file note section. Having this as a target
> > hook is really inappropriate when we want to support remote core file
> > generation; it should really be a gdbarch callback instead.
> > Note that this is the same transition we had with *reading* core files;
> > that was intially supported on native targets only, but is now usually
> > supported for remote targets via gdbarch hooks.
> > To avoid having to complete that transition in one go across all
> > targets, the patch for now adds a gdbarch_make_corefile_notes routine
> > in addition to target_make_corefile_notes. For architectures that
> > do not yet provide a gdbarch_make_corefile_notes routine, common
> > code will fall back on the target hook.
> > The patch implements this routine for all Linux targets in linux-tdep.c,
> > moving code from linux-nat.c there. Note that not even all Linux targets
> > can be converted at this point, only those that already implement the
> > gdbarch_core_regset_sections hook -- if we don't have that, we do not
> > know the sizes of core file register sections, and have to fall back
> > on using regset data types from native system headers.
> > Therefore, I'm keeping a fall-back native-only implementation in
> > linux-nat.c for now; to avoid duplication this uses a helper routine
> > in linux-tdep.c for everything except the core register sets.
> > Note that the previous BFD patch is a prerequiste; otherwise, we might
> > get link failures due to unresolved symbols for cross GDB builds.
> This looks very good to me.
Thanks for the review!
Dr. Ulrich Weigand
GNU Toolchain for Linux on System z and Cell BE