* enable seperate debug info testing with stabs
@ 2007-10-29 22:55 Pedro Alves
2007-12-09 2:19 ` Pedro Alves
0 siblings, 1 reply; 4+ messages in thread
From: Pedro Alves @ 2007-10-29 22:55 UTC (permalink / raw)
To: gdb-patches
[-- Attachment #1: Type: text/plain, Size: 183 bytes --]
Hi,
The problems described in the comment I'm removing seem to
be solved already. I can run the tests successfully on
Cygwin, where stabs is still the default.
Cheers,
Pedro Alves
[-- Attachment #2: sepdebug_stabs.diff --]
[-- Type: text/x-diff, Size: 2310 bytes --]
2007-10-29 Pedro Alves <pedro_alves@portugalmail.pt>
* lib/gdb.exp (gdb_gnu_strip_debug): Remove debug format test.
---
gdb/testsuite/lib/gdb.exp | 34 ----------------------------------
1 file changed, 34 deletions(-)
Index: src/gdb/testsuite/lib/gdb.exp
===================================================================
--- src.orig/gdb/testsuite/lib/gdb.exp 2007-10-29 20:15:00.000000000 +0000
+++ src/gdb/testsuite/lib/gdb.exp 2007-10-29 20:23:32.000000000 +0000
@@ -2520,40 +2520,6 @@ proc build_id_debug_filename_get { exec
proc gdb_gnu_strip_debug { dest args } {
- # First, make sure that we can do this. This is nasty. We need to
- # check for the stabs debug format. To do this we must run gdb on
- # the unstripped executable, list 'main' (as to have a default
- # source file), use get_debug_format (which does 'info source')
- # and then see if the debug info is stabs. If so, we bail out. We
- # cannot do this any other way because get_debug_format finds out
- # the debug format using gdb itself, and in case of stabs we get
- # an error loading the program if it is already stripped. An
- # alternative would be to find out the debug info from the flags
- # passed to dejagnu when the test is run.
-
- gdb_exit
- gdb_start
- gdb_load ${dest}
- gdb_test "list main" "" ""
- get_debug_format
- if { [test_debug_format "stabs"] } then {
- # The separate debug info feature doesn't work well in
- # binutils with stabs. It produces a corrupted debug info
- # only file, and gdb chokes on it. It is almost impossible to
- # capture the failing message out of gdb, because it happens
- # inside gdb_load. At that point any error message is
- # intercepted by dejagnu itself, and, because of the error
- # threshold, any faulty test result is changed into an
- # UNRESOLVED. (see dejagnu/lib/framework.exp)
- unsupported "no separate debug info handling with stabs"
- return -1
- } elseif { [test_debug_format "unknown"] } then {
- # gdb doesn't know what the debug format is. We are out of luck here.
- unsupported "unknown debugging format"
- return -1
- }
- gdb_exit
-
set debug_file [separate_debug_filename $dest]
set strip_to_file_program [transform strip]
set objcopy_program [transform objcopy]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: enable seperate debug info testing with stabs
2007-10-29 22:55 enable seperate debug info testing with stabs Pedro Alves
@ 2007-12-09 2:19 ` Pedro Alves
2007-12-09 11:29 ` Daniel Jacobowitz
0 siblings, 1 reply; 4+ messages in thread
From: Pedro Alves @ 2007-12-09 2:19 UTC (permalink / raw)
To: gdb-patches
Pedro Alves wrote:
> The problems described in the comment I'm removing seem to
> be solved already. I can run the tests successfully on
> Cygwin, where stabs is still the default.
>
Any comments on the patch below?
The stabs skipping came originally [1] from gdb.base/sepdebug.exp,
to address stabs+ problems reported here [2] and Daniel moved it later
to lib/gdb.exp [3].
[1] http://www.sourceware.org/ml/gdb-patches/2004-01/msg00317.html
[2] http://www.sourceware.org/ml/gdb-patches/2003-11/msg00275.html
[3] http://www.sourceware.org/ml/gdb-patches/2006-10/msg00066.html
To give it broader testing, I've tested it on i686-pc-linux-gnu/stabs+
and on i686-pc-cygwin/stabs+ with this board file, based on sepdebug.exp
and on a board file Jim posted on the list to use with elfutils.
This one's to use with binutils. Its purpose is to run the
whole testsuite in "separate debug info" mode.
load_base_board_description "unix"
#load_base_board_description "cygwin"
proc ${current_target_name}_compile {source dest type options} {
global strip_to_file_program
global EXEEXT
# 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
}
if {[string compare $type executable] == 0} {
# Note: the procedure gdb_gnu_strip_debug will produce an
# executable called ${dest}, which is just like the
# executable ($dest) but without the debuginfo. Instead
# $dest has a .gnudebuglink section which contains the name
# of a debuginfo only file. This file will be stored in the
# .debug subdirectory.
# Since strip and objdump don't add $EXEEXT automatically like
# gcc does, gdb_gnu_strip_debug will fail when $dest doesn't
# have $EXEEXT. We workaround that by adding $EXEEXT here if
# needed. This is to avoid adding it throughout the
# testsuite.
set loc_dest $dest
set exeext_len [string length $EXEEXT]
set dest_len [string length $dest]
if { $exeext_len > 0 && $dest_len > $exeext_len } {
set suf_pos [expr $dest_len - $exeext_len]
set suf [string range $dest $suf_pos $dest_len]
if {[string compare $EXEEXT $suf] != 0} {
set loc_dest $dest$EXEEXT
}
}
if [gdb_gnu_strip_debug ${loc_dest}] {
# check that you have a recent version of strip and
# objcopy installed
unsupported "cannot produce separate debug info files"
return -1
}
}
return ""
}
proc ${board}_init { whole_name } {
global board_info
set baseboard [lindex [split $whole_name "/"] 0]
set board_info($baseboard,isremote) 0
}
>
> ------------------------------------------------------------------------
>
> 2007-10-29 Pedro Alves <pedro_alves@portugalmail.pt>
>
> * lib/gdb.exp (gdb_gnu_strip_debug): Remove debug format test.
>
> ---
> gdb/testsuite/lib/gdb.exp | 34 ----------------------------------
> 1 file changed, 34 deletions(-)
>
> Index: src/gdb/testsuite/lib/gdb.exp
> ===================================================================
> --- src.orig/gdb/testsuite/lib/gdb.exp 2007-10-29 20:15:00.000000000 +0000
> +++ src/gdb/testsuite/lib/gdb.exp 2007-10-29 20:23:32.000000000 +0000
> @@ -2520,40 +2520,6 @@ proc build_id_debug_filename_get { exec
>
> proc gdb_gnu_strip_debug { dest args } {
>
> - # First, make sure that we can do this. This is nasty. We need to
> - # check for the stabs debug format. To do this we must run gdb on
> - # the unstripped executable, list 'main' (as to have a default
> - # source file), use get_debug_format (which does 'info source')
> - # and then see if the debug info is stabs. If so, we bail out. We
> - # cannot do this any other way because get_debug_format finds out
> - # the debug format using gdb itself, and in case of stabs we get
> - # an error loading the program if it is already stripped. An
> - # alternative would be to find out the debug info from the flags
> - # passed to dejagnu when the test is run.
> -
> - gdb_exit
> - gdb_start
> - gdb_load ${dest}
> - gdb_test "list main" "" ""
> - get_debug_format
> - if { [test_debug_format "stabs"] } then {
> - # The separate debug info feature doesn't work well in
> - # binutils with stabs. It produces a corrupted debug info
> - # only file, and gdb chokes on it. It is almost impossible to
> - # capture the failing message out of gdb, because it happens
> - # inside gdb_load. At that point any error message is
> - # intercepted by dejagnu itself, and, because of the error
> - # threshold, any faulty test result is changed into an
> - # UNRESOLVED. (see dejagnu/lib/framework.exp)
> - unsupported "no separate debug info handling with stabs"
> - return -1
> - } elseif { [test_debug_format "unknown"] } then {
> - # gdb doesn't know what the debug format is. We are out of luck here.
> - unsupported "unknown debugging format"
> - return -1
> - }
> - gdb_exit
> -
> set debug_file [separate_debug_filename $dest]
> set strip_to_file_program [transform strip]
> set objcopy_program [transform objcopy]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: enable seperate debug info testing with stabs
2007-12-09 2:19 ` Pedro Alves
@ 2007-12-09 11:29 ` Daniel Jacobowitz
2007-12-09 19:40 ` Pedro Alves
0 siblings, 1 reply; 4+ messages in thread
From: Daniel Jacobowitz @ 2007-12-09 11:29 UTC (permalink / raw)
To: Pedro Alves; +Cc: gdb-patches
On Sun, Dec 09, 2007 at 01:18:27AM +0000, Pedro Alves wrote:
> Pedro Alves wrote:
> > The problems described in the comment I'm removing seem to
> > be solved already. I can run the tests successfully on
> > Cygwin, where stabs is still the default.
>
> Any comments on the patch below?
The patch is OK.
I suspect the necessary bits were added to binutils separately from
the original debuglink support.
--
Daniel Jacobowitz
CodeSourcery
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: enable seperate debug info testing with stabs
2007-12-09 11:29 ` Daniel Jacobowitz
@ 2007-12-09 19:40 ` Pedro Alves
0 siblings, 0 replies; 4+ messages in thread
From: Pedro Alves @ 2007-12-09 19:40 UTC (permalink / raw)
To: gdb-patches
>2007-12-09 Pedro Alves <pedro_alves@portugalmail.pt>
>
> * lib/gdb.exp (gdb_gnu_strip_debug): Remove debug format test.
Daniel Jacobowitz wrote:
>
> The patch is OK.
>
Thanks, checked in.
--
Pedro Alves
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2007-12-09 11:29 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-10-29 22:55 enable seperate debug info testing with stabs Pedro Alves
2007-12-09 2:19 ` Pedro Alves
2007-12-09 11:29 ` Daniel Jacobowitz
2007-12-09 19:40 ` Pedro Alves
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox