This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: How to share code between [gdb]/gnu-nat.c with [gdb]/gdbserver/gnu-hurd-low.c?
- From: Luis Machado <lgustavo at codesourcery dot com>
- To: Yue Lu <hacklu dot newborn at gmail dot com>
- Cc: gdb at sourceware dot org, Thomas Schwinge <thomas at codesourcery dot com>
- Date: Mon, 12 Aug 2013 09:25:22 -0300
- Subject: Re: How to share code between [gdb]/gnu-nat.c with [gdb]/gdbserver/gnu-hurd-low.c?
- References: <CAB8fV=jzv_rPHP3-HQVBA-pCNZNat6PNbh+OJEU7tZgQdKX3+w at mail dot gmail dot com>
- Reply-to: lgustavo at codesourcery dot com
On 08/12/2013 05:36 AM, Yue Lu wrote:
Hi all,
When I working with porting gdbserver to GNU/Hurd I found I alway need
to duplicate code from [gdb]/gnu-nat.c to my new file
[gdb]/gdb/server/gnu-hurd.low.c. There are too many functions and
structures can be shared between the two file only need a little
change or even without any change.
I don't have good ideal to share the code, can you give me any
suggestions? Thank you.
Any common code you come up with can potentially be included inside
gdb/common. Then you need to make sure both gdb's and gdbserver's
Makefile's are adjusted to match that.
The more you can share, the better. It helps keep things organized that way.
There is an ongoing discussion related to proper naming of files and
paths, but that should not stop you from sharing code anyway.
Luis