wine/debugger/stabs.c patch breaks FreeBSD

2002-04-02 Thread Gerald Pfeifer

The following patch to wine/debugger/stabs.c breaks FreeBSD:

  revision 1.45
  date: 2002/04/02 02:38:37;  author: julliard;  state: Exp;  lines: +2 -0
  Check ELF signature before processing file.

  stabs.c: In function `DEBUG_ProcessElfFile':
  stabs.c:1232: `ELFMAG' undeclared (first use in this function)
  stabs.c:1232: (Each undeclared identifier is reported only once
  stabs.c:1232: for each function it appears in.)
  stabs.c:1232: `SELFMAG' undeclared (first use in this function)

In /usr/include/sys/elf_common FreeBSD has

  /* Values for the magic number bytes. */
  #define ELFMAG0 0x7f
  #define ELFMAG1 'E'
  #define ELFMAG2 'L'
  #define ELFMAG3 'F'

but not ELFMAG and nothing similiar to SELFMAG.

Gerald
-- 
Gerald Jerry [EMAIL PROTECTED] http://www.dbai.tuwien.ac.at/~pfeifer/





Re: wine/debugger/stabs.c patch breaks FreeBSD

2002-04-02 Thread Eric Pouech

Gerald Pfeifer a écrit :
 
 The following patch to wine/debugger/stabs.c breaks FreeBSD:
 
   revision 1.45
   date: 2002/04/02 02:38:37;  author: julliard;  state: Exp;  lines: +2 -0
   Check ELF signature before processing file.
that should fix it in a portable manner

Index: debugger/stabs.c
===
RCS file: /home/cvs/cvsroot/wine/wine/debugger/stabs.c,v
retrieving revision 1.45
diff -u -r1.45 stabs.c
--- debugger/stabs.c2 Apr 2002 02:38:37 -   1.45
+++ debugger/stabs.c2 Apr 2002 19:29:41 -
 -1229,7 +1229,10 
  * table.
  */
 ehptr = (Elf32_Ehdr*) addr;
-if (memcmp( ehptr-e_ident, ELFMAG, SELFMAG )) goto leave;
+if (ehptr-e_ident[0] != ELFMAG0 ||
+ehptr-e_ident[1] != ELFMAG1 ||
+ehptr-e_ident[2] != ELFMAG2 ||
+ehptr-e_ident[3] != ELFMAG3) goto leave;

 spnt = (Elf32_Shdr*) (addr + ehptr-e_shoff);
 shstrtab = (addr + spnt[ehptr-e_shstrndx].sh_offset);




Re: wine/debugger/stabs.c patch breaks FreeBSD

2002-04-02 Thread Gerald Pfeifer

On Tue, 2 Apr 2002, Eric Pouech wrote:
 The following patch to wine/debugger/stabs.c breaks FreeBSD:
   revision 1.45
   date: 2002/04/02 02:38:37;  author: julliard;  state: Exp;  lines: +2 -0
   Check ELF signature before processing file.
 that should fix it in a portable manner

Thanks!  I verified that this builds fine on FreeBSD, but also noticed
that Alexandre has committed a somewhat different patch.

(Both of these patches work for me, so I don't know which one's
preferrable...)

Gerald
-- 
Gerald Jerry [EMAIL PROTECTED] http://www.dbai.tuwien.ac.at/~pfeifer/