This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: Final separate debug info patch
- From: Jim Blandy <jimb at redhat dot com>
- To: Daniel Jacobowitz <drow at mvista dot com>
- Cc: Alexander Larsson <alexl at redhat dot com>, gdb at sources dot redhat dot com
- Date: 19 Nov 2002 06:36:27 -0500
- Subject: Re: Final separate debug info patch
- References: <Pine.LNX.4.44.0210090447290.29225-200000@devserv.devel.redhat.com><vt2wunajgl9.fsf@zenia.red-bean.com><20021119053344.GA29601@nevyn.them.org>
Daniel Jacobowitz <drow@mvista.com> writes:
> On Tue, Nov 19, 2002 at 12:04:02AM -0500, Jim Blandy wrote:
> > There are some problems at the moment: DejaGNU has the name "unix"
> > hard-coded into it, and thinks that anything with another name is a
> > remote board. Some tests won't run if the target is remote. I think
> > I know how to persuade it that unix-separate-debug is still not a
> > remote target, but I'm just going to post this as is for the time
> > being.
>
> FYI, I do this. Here's how. This is a simple board description file
> which just uses a different C compiler, since GDB wasn't honoring CC:
>
> <quote>
> # The canonical unix board description.
> load_generic_config "unix";
>
> set_board_info compiler "gcc-3.2";
> set_board_info c++compiler "g++-3.2";
>
> global board
> proc ${board}_init { whole_name } {
> global board_info
> set board_info(unix3.2,isremote) 0;
> }
> </quote>
>
> Replace unix3.2 with whatever goes before the .exp. The ${board} bit
> is necessary and becomes something involving the local hostname, IIRC.
Okay --- that works. Here's the latest iteration:
---
load_base_board_description "unix"
set strip_to_file_program "/home/jimb/elfutils/bin/strip"
proc ${current_target_name}_compile {source dest type options} {
global strip_to_file_program
# Run the standard compilation procedure.
set result [default_target_compile $source $dest $type $options]
# If it didn't succeed, return directly.
if {[string compare $result ""] != 0} {
return $result
}
# Otherwise, strip the executable and copy its debug info to a
# separate file, leaving only a pointer behind.
if {[string compare $type executable] == 0} {
exec $strip_to_file_program -f ${dest}.separate-debug ${dest}
}
}
proc ${board}_init { whole_name } {
global board_info
set board_info(unix-separate-debug,isremote) 0
}