This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [RFA] x86 - jump instruction after the prologue
- From: Daniel Jacobowitz <drow at false dot org>
- To: Jerome Guitton <guitton at act-europe dot fr>
- Cc: Mark Kettenis <kettenis at chello dot nl>, gdb-patches at sources dot redhat dot com,Michael Chastain <mec dot gnu at mindspring dot com>
- Date: Sun, 8 Aug 2004 17:36:15 -0400
- Subject: Re: [RFA] x86 - jump instruction after the prologue
- References: <20040419173249.GA22201@act-europe.fr> <20040427163725.GA7319@act-europe.fr> <200404291624.i3TGO7PP003462@elgar.kettenis.dyndns.org> <20040510202721.GB15632@nevyn.them.org> <20040512113101.GA1996@act-europe.fr>
On Wed, May 12, 2004 at 01:31:01PM +0200, Jerome Guitton wrote:
> Daniel Jacobowitz (drow@false.org):
>
> > Also, should we write i386-prologue.c in assembly to avoid this
> > problem? That's what Fred did for SH to avoid a similar difficulty.
>
> Can't we compile this file without debug info?
Yes indeed, and that fixes it.
Background analysis of the problem: GCC uses the .loc directive to emit
line number information when using dwarf2 and a recent GNU assembler.
There is no way for GCC to force the emission of a DW_LNE_end_sequence
marker, so the last .loc directive is assumed to continue until the end
of the .text section, which includes all of the assembly functions in
i386-prologue.c which are written out using asm().
I've made a note that gas should support a way to emit the EOS marker,
and GCC should use it. Not hard to implement but I haven't got the
time right now.
In the mean time, this is a test of a prologue analyzer. Compiling it
without debug information seems reasonable to me. Tested on
i686-pc-linux-gnu, OK?
--
Daniel Jacobowitz
2004-08-08 Daniel Jacobowitz <dan@debian.org>
* gdb.arch/i386-prologue.exp: Compile without debug information.
Index: testsuite/gdb.arch/i386-prologue.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.arch/i386-prologue.exp,v
retrieving revision 1.8
diff -u -p -r1.8 i386-prologue.exp
--- testsuite/gdb.arch/i386-prologue.exp 1 Aug 2004 14:28:51 -0000 1.8
+++ testsuite/gdb.arch/i386-prologue.exp 8 Aug 2004 21:31:57 -0000
@@ -44,7 +44,9 @@ if [istarget "i?86-*-cygwin*"] then {
set additional_flags "additional_flags=-DSYMBOL_PREFIX=\"_\""
}
-if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug $additional_flags]] != "" } {
+# Don't use "debug", so that we don't have line information for the assembly
+# fragments.
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list $additional_flags]] != "" } {
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
}