Commit 53fa0d54 authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

- Fixed broken winedbg compilation on BSD.

- Fixed some corner case handling in ELF list walking (reported by Robert Shearman).
parent d6847771
#! /bin/sh #! /bin/sh
# Guess values for system-dependent variables and create Makefiles. # Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.58 for Wine 20040121. # Generated by GNU Autoconf 2.59 for Wine 20040121.
# #
# Report bugs to <wine-devel@winehq.org>. # Report bugs to <wine-devel@winehq.org>.
# #
...@@ -852,37 +852,26 @@ if test -n "$ac_init_help"; then ...@@ -852,37 +852,26 @@ if test -n "$ac_init_help"; then
Optional Features: Optional Features:
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
--enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
--disable-win16 --disable-win16 do not include Win16 support
do not include Win16 support --disable-debug compile out all debugging messages
--disable-debug --disable-trace compile out TRACE messages
compile out all debugging messages
--disable-trace
compile out TRACE messages
Optional Packages: Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
--without-opengl --without-opengl do not use OpenGL
do not use OpenGL --without-curses do not use curses
--without-curses --with-wine-tools=<dir> use Wine tools from directory <dir>
do not use curses
--with-wine-tools=<dir>
use Wine tools from directory <dir>
--with-x use the X Window System --with-x use the X Window System
Some influential environment variables: Some influential environment variables:
CC CC C compiler command
C compiler command CFLAGS C compiler flags
CFLAGS LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
C compiler flags nonstandard directory <lib dir>
LDFLAGS CPPFLAGS C/C++ preprocessor flags, e.g. -I<include dir> if you have
linker flags, e.g. -L<lib dir> if you have headers in a nonstandard directory <include dir>
libraries in a nonstandard directory <lib dir> CPP C preprocessor
CPPFLAGS
C/C++ preprocessor flags, e.g. -I<include dir> if you
have headers in a nonstandard directory <include dir>
CPP
C preprocessor
Use these variables to override the choices made by `configure' or to help Use these variables to override the choices made by `configure' or to help
it to find libraries and programs with nonstandard names/locations. it to find libraries and programs with nonstandard names/locations.
...@@ -984,7 +973,7 @@ test -n "$ac_init_help" && exit 0 ...@@ -984,7 +973,7 @@ test -n "$ac_init_help" && exit 0
if $ac_init_version; then if $ac_init_version; then
cat <<\_ACEOF cat <<\_ACEOF
Wine configure 20040121 Wine configure 20040121
generated by GNU Autoconf 2.58 generated by GNU Autoconf 2.59
Copyright (C) 2003 Free Software Foundation, Inc. Copyright (C) 2003 Free Software Foundation, Inc.
This configure script is free software; the Free Software Foundation This configure script is free software; the Free Software Foundation
...@@ -998,7 +987,7 @@ This file contains any messages produced by compilers while ...@@ -998,7 +987,7 @@ This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake. running configure, to aid debugging if configure makes a mistake.
It was created by Wine $as_me 20040121, which was It was created by Wine $as_me 20040121, which was
generated by GNU Autoconf 2.58. Invocation command line was generated by GNU Autoconf 2.59. Invocation command line was
$ $0 $@ $ $0 $@
...@@ -15761,6 +15750,8 @@ done ...@@ -15761,6 +15750,8 @@ done
for ac_header in \ for ac_header in \
arpa/inet.h \ arpa/inet.h \
arpa/nameser.h \ arpa/nameser.h \
...@@ -15804,7 +15795,9 @@ for ac_header in \ ...@@ -15804,7 +15795,9 @@ for ac_header in \
stdint.h \ stdint.h \
strings.h \ strings.h \
sys/cdio.h \ sys/cdio.h \
sys/elf32.h \
sys/errno.h \ sys/errno.h \
sys/exec_elf.h \
sys/file.h \ sys/file.h \
sys/filio.h \ sys/filio.h \
sys/inttypes.h \ sys/inttypes.h \
...@@ -19436,7 +19429,7 @@ _ASBOX ...@@ -19436,7 +19429,7 @@ _ASBOX
cat >&5 <<_CSEOF cat >&5 <<_CSEOF
This file was extended by Wine $as_me 20040121, which was This file was extended by Wine $as_me 20040121, which was
generated by GNU Autoconf 2.58. Invocation command line was generated by GNU Autoconf 2.59. Invocation command line was
CONFIG_FILES = $CONFIG_FILES CONFIG_FILES = $CONFIG_FILES
CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_HEADERS = $CONFIG_HEADERS
...@@ -19499,7 +19492,7 @@ _ACEOF ...@@ -19499,7 +19492,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\ ac_cs_version="\\
Wine config.status 20040121 Wine config.status 20040121
configured by $0, generated by GNU Autoconf 2.58, configured by $0, generated by GNU Autoconf 2.59,
with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
Copyright (C) 2003 Free Software Foundation, Inc. Copyright (C) 2003 Free Software Foundation, Inc.
......
...@@ -1087,7 +1087,9 @@ AC_CHECK_HEADERS(\ ...@@ -1087,7 +1087,9 @@ AC_CHECK_HEADERS(\
stdint.h \ stdint.h \
strings.h \ strings.h \
sys/cdio.h \ sys/cdio.h \
sys/elf32.h \
sys/errno.h \ sys/errno.h \
sys/exec_elf.h \
sys/file.h \ sys/file.h \
sys/filio.h \ sys/filio.h \
sys/inttypes.h \ sys/inttypes.h \
......
...@@ -41,17 +41,29 @@ ...@@ -41,17 +41,29 @@
#define __ELF__ #define __ELF__
#endif #endif
#ifdef __ELF__
#ifdef HAVE_ELF_H #ifdef HAVE_ELF_H
# include <elf.h> # include <elf.h>
#endif #endif
#ifdef HAVE_SYS_ELF32_H
# include <sys/elf32.h>
#endif
#ifdef HAVE_SYS_EXEC_ELF_H
# include <sys/exec_elf.h>
#endif
#if !defined(DT_NUM)
# if defined(DT_COUNT)
# define DT_NUM DT_COUNT
# else
/* this seems to be a satisfactory value on Solaris, which doesn't support this AFAICT */
# define DT_NUM 24
# endif
#endif
#ifdef HAVE_LINK_H #ifdef HAVE_LINK_H
# include <link.h> # include <link.h>
#endif #endif
#ifdef HAVE_SYS_LINK_H #ifdef HAVE_SYS_LINK_H
# include <sys/link.h> # include <sys/link.h>
#endif #endif
#endif
#include "wine/debug.h" #include "wine/debug.h"
...@@ -249,6 +261,24 @@ leave: ...@@ -249,6 +261,24 @@ leave:
return dil; return dil;
} }
static unsigned is_dt_flag_valid(unsigned d_tag)
{
#ifndef DT_PROCNUM
#define DT_PROCNUM 0
#endif
#ifndef DT_EXTRANUM
#define DT_PROCNUM 0
#endif
return (d_tag >= 0 && d_tag < DT_NUM + DT_PROCNUM + DT_EXTRANUM)
#if defined(DT_LOOS) && defined(DT_HIOS)
|| (d_tag >= DT_LOOS && d_tag < DT_HIOS)
#endif
#if defined(DT_LOPROC) && defined(DT_HIPROC)
|| (d_tag >= DT_LOPROC && d_tag < DT_HIPROC)
#endif
;
}
/* /*
* Loads the information for ELF module stored in 'filename' * Loads the information for ELF module stored in 'filename'
* the module has been loaded at 'load_offset' address * the module has been loaded at 'load_offset' address
...@@ -339,12 +369,7 @@ static enum DbgInfoLoad DEBUG_ProcessElfFile(HANDLE hProcess, ...@@ -339,12 +369,7 @@ static enum DbgInfoLoad DEBUG_ProcessElfFile(HANDLE hProcess,
do do
{ {
if (!ReadProcessMemory(hProcess, ptr, &dyn, sizeof(dyn), &len) || if (!ReadProcessMemory(hProcess, ptr, &dyn, sizeof(dyn), &len) ||
len != sizeof(dyn) || len != sizeof(dyn) || !is_dt_flag_valid(dyn.d_tag))
!((dyn.d_tag >= 0 &&
dyn.d_tag < DT_NUM+DT_PROCNUM+DT_EXTRANUM) ||
(dyn.d_tag >= DT_LOOS && dyn.d_tag < DT_HIOS) ||
(dyn.d_tag >= DT_LOPROC && dyn.d_tag < DT_HIPROC))
)
dyn.d_tag = DT_NULL; dyn.d_tag = DT_NULL;
ptr += sizeof(dyn); ptr += sizeof(dyn);
} while (dyn.d_tag != DT_DEBUG && dyn.d_tag != DT_NULL); } while (dyn.d_tag != DT_DEBUG && dyn.d_tag != DT_NULL);
...@@ -402,7 +427,7 @@ static enum DbgInfoLoad DEBUG_ProcessElfFileFromPath(HANDLE hProcess, ...@@ -402,7 +427,7 @@ static enum DbgInfoLoad DEBUG_ProcessElfFileFromPath(HANDLE hProcess,
char *s, *t, *fn; char *s, *t, *fn;
char* paths = NULL; char* paths = NULL;
if (!path) return -1; if (!path) return dil;
for (s = paths = DBG_strdup(path); s && *s; s = (t) ? (t+1) : NULL) for (s = paths = DBG_strdup(path); s && *s; s = (t) ? (t+1) : NULL)
{ {
...@@ -430,7 +455,7 @@ static enum DbgInfoLoad DEBUG_ProcessElfObject(HANDLE hProcess, ...@@ -430,7 +455,7 @@ static enum DbgInfoLoad DEBUG_ProcessElfObject(HANDLE hProcess,
{ {
enum DbgInfoLoad dil = DIL_ERROR; enum DbgInfoLoad dil = DIL_ERROR;
if (filename == NULL) return DIL_ERROR; if (filename == NULL || *filename == '\0') return DIL_ERROR;
if (DEBUG_FindModuleByName(filename, DMT_ELF)) if (DEBUG_FindModuleByName(filename, DMT_ELF))
{ {
assert(!(elf_info->flags & ELF_INFO_PATH)); assert(!(elf_info->flags & ELF_INFO_PATH));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment