This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: gdbserver relocation?
- From: Daniel Jacobowitz <drow at mvista dot com>
- To: Miles Bader <miles at gnu dot org>
- Cc: Andrew Cagney <ac131313 at redhat dot com>, gdb at sources dot redhat dot com
- Date: Mon, 3 Mar 2003 22:03:18 -0500
- Subject: Re: gdbserver relocation?
- References: <buok7fqqdzi.fsf@mcspd15.ucom.lsi.nec.co.jp> <20030224142831.GB24793@nevyn.them.org> <20030224152608.GB2206@gnu.org> <3E5A3E20.5040706@redhat.com> <buoheaj3ly5.fsf@mcspd15.ucom.lsi.nec.co.jp>
On Tue, Mar 04, 2003 at 11:27:46AM +0900, Miles Bader wrote:
> Andrew Cagney <ac131313 at redhat dot com> writes:
> > I suspect you want to send something back using qOffsets.
>
> Yes, that's exactly what I needed.
>
> What do you think of the following patch (I added the `handle_query'
> target callback, and then provided a linux-low.c implementation)?
It looks reasonable to me. Do you have GDB copyright papers on file?
Content-Description: gdb-5.3-qoffsets-20030304.patch
> + if (errno == 0)
> + {
> + /* Both text and data offsets produced at compile-time (and so
> + used by gdb) are relative to the beginning of the program,
> + with the data segment immediately following the text segment.
> + However, the actual runtime layout in memory may put the data
> + somewhere else, so when we send gdb a data base-address, we
> + use the real data base address and subtract the compile-time
> + data base-address from it (which is just the length of the
> + text segment). BSS immediately follows data in both cases. */
Hmm, this only works if the executable is linked at 0 with data right
after text. Is that the case for all/most uClinux targets? I don't
know anything about uClinux.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer