This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: Question about test gdb remotely using gdbserver on uClinux
- From: Daniel Jacobowitz <drow at false dot org>
- To: Jie Zhang <jzhang918 at gmail dot com>
- Cc: gdb at sources dot redhat dot com
- Date: Wed, 15 Jun 2005 10:15:31 -0400
- Subject: Re: Question about test gdb remotely using gdbserver on uClinux
- References: <6f48278f050614234121c19fcb@mail.gmail.com>
On Wed, Jun 15, 2005 at 02:41:33PM +0800, Jie Zhang wrote:
> Hi,
>
> I'm trying to test gdb remotely using gdbserver on uClinux. The cross
> toolchain for uClinux generates two target files, for example, foo and
> foo.gdb. File foo is in bFLT format, which uClinux can load. File
> foo.gdb is in ELF format, which is usuallly used as the symbol file
> for debugging.
>
> So we have to pass foo to gdb_load to load it using gdbserver remotely
> on the target board. And pass foo.gdb to gdb_file_cmd to load it as
> symbol file on host.
>
> Currently, I add ".gdb" to the argument of each gdb_file_cmd or
> similar procedures in gdb testsuite. This is ugly. My plan is to add a
> field to target board, like "symbol_file_name_extension" or a more
> powerful transform helper procedure "infer_symbol_file_name". At each
> place calling gdb_file_cmd or similar procedures, concatenate
> "symbol_file_name_extension" to the its argument or use the result of
> "infer_symbol_file_name" as its argument if they are defined in the
> target board configuration.
No, don't do this at call sites. Then it's still scattered all over
the testsuite.
> I don't know if there are any such like mechanism. There are
> gdbsever_host_exec and gdbserver_server_exec in gdbserver-support.exp.
> I'm not clear if and how they can be used for my specific purpose.
Not as is. They are just used for remote downloading. But couldn't
you call your new board method inside gdbserver_load and get 95% of
cases that way?
--
Daniel Jacobowitz
CodeSourcery, LLC