This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA] x86 - jump instruction after the prologue


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."
 }
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]