Wine-Devel
By thread
wine-devel@list.winehq.org
By month
Messages by month
- ----- 2026 -----
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2003 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2002 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2001 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
August 2004
- 121 participants
- 732 messages
Re: check box in group box regression
by Robert Reif
Zach Gorman wrote:
>Is this a general problem, or just in the hour.exe example? Is there source
>for hour.exe?
>
>Zach
>
>-----Original Message-----
>From: wine-devel-admin(a)winehq.org [mailto:wine-devel-admin(a)winehq.org] On
>Behalf Of Robert Reif
>Sent: Tuesday, August 24, 2004 8:02 AM
>To: Wine Develop
>Subject: check box in group box regression
>
>With current cvs, check boxes in group boxes are no longer displayed.
>See: http://www.winehq.org/hypermail/wine-bugs/2004/08/0136.html
>
>
>
>
>
It is a real problem that I was able to reproduce with a simple program.
It's just a simple MFC program. I don't have the source with me now but
all it does is set the wait cursor in the check box callback, sleep for
5 seconds,
and then restore the cursor. The check box is inside a group box. I
can get it
tomorrow if needed.
Aug. 24, 2004
Re: Non-perfect epoll patch
by Shachar Shemesh
Shachar Shemesh wrote:
> Hi all,
>
> Attached is a non-perfect patch for review. This is a migration of the
> wineserver to use epoll instead of poll (if it's available).
>
> current known issue with this patch:
> 1. Will not compile if HAVE_SYS_EPOLL_H is not 1 (i.e. - won't compile
> if epoll not available at compile time)
> 2. Segfaults on wine exit.
> 3. Lots of debug asserts.
>
> Comments welcome.
> Shachar
>
One more thing. I don't think it matters much, but this patch is against
20040716.
--
Shachar Shemesh
Lingnu Open Source Consulting ltd.
http://www.lingnu.com/
Aug. 24, 2004
Non-perfect epoll patch
by Shachar Shemesh
Hi all,
Attached is a non-perfect patch for review. This is a migration of the
wineserver to use epoll instead of poll (if it's available).
current known issue with this patch:
1. Will not compile if HAVE_SYS_EPOLL_H is not 1 (i.e. - won't compile
if epoll not available at compile time)
2. Segfaults on wine exit.
3. Lots of debug asserts.
Comments welcome.
Shachar
--
Shachar Shemesh
Lingnu Open Source Consulting ltd.
http://www.lingnu.com/
Index: configure
===================================================================
RCS file: /home/sun/sources/cvs/wine/configure,v
retrieving revision 1.573
diff -u -r1.573 configure
--- configure 17 Jul 2004 00:52:37 -0000 1.573
+++ configure 24 Aug 2004 12:03:32 -0000
@@ -6727,6 +6727,79 @@
fi
+echo "$as_me:$LINENO: checking for epoll_create in -lepoll" >&5
+echo $ECHO_N "checking for epoll_create in -lepoll... $ECHO_C" >&6
+if test "${ac_cv_lib_epoll_epoll_create+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lepoll $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char epoll_create ();
+int
+main ()
+{
+epoll_create ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_epoll_epoll_create=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_epoll_epoll_create=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_epoll_epoll_create" >&5
+echo "${ECHO_T}$ac_cv_lib_epoll_epoll_create" >&6
+if test $ac_cv_lib_epoll_epoll_create = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBEPOLL 1
+_ACEOF
+
+ LIBS="-lepoll $LIBS"
+
+fi
+
+
echo "$as_me:$LINENO: checking for res_9_init in -lresolv" >&5
echo $ECHO_N "checking for res_9_init in -lresolv... $ECHO_C" >&6
if test "${ac_cv_lib_resolv_res_9_init+set}" = set; then
@@ -16190,6 +16263,7 @@
+
for ac_func in \
_lwp_create \
_lwp_self \
@@ -16202,6 +16276,7 @@
_vsnprintf \
chsize \
clone \
+ epoll_create \
finite \
fpclass \
fstatfs \
@@ -16435,6 +16510,7 @@
+
for ac_header in \
arpa/inet.h \
arpa/nameser.h \
@@ -16495,6 +16571,7 @@
sys/msg.h \
sys/param.h \
sys/poll.h \
+ sys/epoll.h \
sys/ptrace.h \
sys/reg.h \
sys/scsiio.h \
Index: configure.ac
===================================================================
RCS file: /home/sun/sources/cvs/wine/configure.ac,v
retrieving revision 1.285
diff -u -r1.285 configure.ac
--- configure.ac 6 Jul 2004 21:01:19 -0000 1.285
+++ configure.ac 24 Aug 2004 12:01:22 -0000
@@ -140,6 +140,8 @@
AC_CHECK_LIB(xpg4,_xpg4_setrunelocale)
dnl Check for -lpoll for Mac OS X/Darwin
AC_CHECK_LIB(poll,poll)
+dnl Check for -lepoll
+AC_CHECK_LIB(epoll,epoll_create)
dnl Check for -lresolv for Mac OS X/Darwin
AC_CHECK_LIB(resolv,res_9_init)
dnl Check for -lpthread
@@ -1036,6 +1038,7 @@
_vsnprintf \
chsize \
clone \
+ epoll_create \
finite \
fpclass \
fstatfs \
@@ -1146,6 +1149,7 @@
sys/msg.h \
sys/param.h \
sys/poll.h \
+ sys/epoll.h \
sys/ptrace.h \
sys/reg.h \
sys/scsiio.h \
Index: include/config.h.in
===================================================================
RCS file: /home/sun/sources/cvs/wine/include/config.h.in,v
retrieving revision 1.190
diff -u -r1.190 config.h.in
--- include/config.h.in 18 Jun 2004 19:36:26 -0000 1.190
+++ include/config.h.in 24 Aug 2004 12:05:42 -0000
@@ -80,6 +80,9 @@
/* Define to 1 if you have the <elf.h> header file. */
#undef HAVE_ELF_H
+/* Define to 1 if you have the `epoll_create' function. */
+#undef HAVE_EPOLL_CREATE
+
/* Define to 1 if you have the `finite' function. */
#undef HAVE_FINITE
@@ -248,6 +251,9 @@
/* Define if you have the curses library (-lcurses) */
#undef HAVE_LIBCURSES
+/* Define to 1 if you have the `epoll' library (-lepoll). */
+#undef HAVE_LIBEPOLL
+
/* Define if you have libgif/libungif including devel headers */
#undef HAVE_LIBGIF
@@ -608,6 +614,9 @@
/* Define to 1 if you have the <sys/elf32.h> header file. */
#undef HAVE_SYS_ELF32_H
+/* Define to 1 if you have the <sys/epoll.h> header file. */
+#undef HAVE_SYS_EPOLL_H
+
/* Define to 1 if you have the <sys/errno.h> header file. */
#undef HAVE_SYS_ERRNO_H
Index: server/fd.c
===================================================================
RCS file: /home/sun/sources/cvs/wine/server/fd.c,v
retrieving revision 1.21
diff -u -r1.21 fd.c
--- server/fd.c 22 May 2004 03:15:04 -0000 1.21
+++ server/fd.c 24 Aug 2004 21:20:53 -0000
@@ -33,6 +33,12 @@
#ifdef HAVE_SYS_POLL_H
#include <sys/poll.h>
#endif
+#ifdef HAVE_SYS_EPOLL_H
+#include <sys/epoll.h>
+#endif
+#ifdef HAVE_SYS_SYSCALL_H
+#include <sys/syscall.h>
+#endif
#include <sys/stat.h>
#include <sys/time.h>
#include <sys/types.h>
@@ -48,6 +54,9 @@
#include "winreg.h"
#include "winternl.h"
+#undef NDEBUG
+#include <assert.h>
+
/* Because of the stupid Posix locking semantics, we need to keep
* track of all file descriptors referencing a given file, and not
* close a single one until all the locks are gone (sigh).
@@ -255,51 +264,107 @@
/****************************************************************/
-/* poll support */
+/* poll and epoll support */
+
+/* Vars used by both */
+static int active_users; /* current number of active users */
+/* Vars used by poll */
static struct fd **poll_users; /* users array */
static struct pollfd *pollfd; /* poll fd array */
static int nb_users; /* count of array entries actually in use */
-static int active_users; /* current number of active users */
static int allocated_users; /* count of allocated entries in the array */
static struct fd **freelist; /* list of free entries in the array */
+/* Vars used by epoll */
+static int epoll_fd=-1; /* File descriptor for the epoll */
+static const int EPOLL_SIZE=1024; /* "Maximal size" passed to epoll_create. This is an optimization, not a real maximum */
+static struct epoll_event *epoll_revents; /* Array for event results */
+static int epoll_revents_size; /* Number of elements in epoll_revents */
+
+#if defined(HAVE_EPOLL_CREATE) && defined(HAVE_SYS_SYSCALL_H)
+/* To prevent wine from not loading on non-epoll supporting platforms,
+ * we need to dynamically call the epoll functions */
+static inline int _epoll_create( int size )
+{
+ return syscall(__NR_epoll_create, size);
+}
+
+static inline int _epoll_ctl(int epfd, int op, int fd, struct epoll_event *event)
+{
+ return syscall(__NR_epoll_ctl, epfd, op, fd, event);
+}
+
+static inline int _epoll_wait(int epfd, struct epoll_event *events, int maxevents, int timeout)
+{
+ return syscall(__NR_epoll_wait, epfd, events, maxevents, timeout);
+}
+#else
+static inline int _epoll_create( int size )
+{
+ errno=ENOSYS;
+ return -1;
+}
+
+static inline int _epoll_ctl(int epfd, int op, int fd, struct epoll_event *event)
+{
+ errno=ENOSYS;
+ return -1;
+}
+
+static inline int _epoll_wait(int epfd, struct epoll_event *events, int maxevents, int timeout)
+{
+ errno=ENOSYS;
+ return -1;
+}
+#endif
+
+
/* add a user in the poll array and return its index, or -1 on failure */
static int add_poll_user( struct fd *fd )
{
int ret;
- if (freelist)
+ if( epoll_fd>=0 ) /* We are using the epoll interface */
{
- ret = freelist - poll_users;
- freelist = (struct fd **)poll_users[ret];
+ /* No poll array when using epoll - always return 1 */
+ ret=1;
}
else
- {
- if (nb_users == allocated_users)
+ { /* We are using the poll interface */
+ if (freelist)
{
- struct fd **newusers;
- struct pollfd *newpoll;
- int new_count = allocated_users ? (allocated_users + allocated_users / 2) : 16;
- if (!(newusers = realloc( poll_users, new_count * sizeof(*poll_users) ))) return -1;
- if (!(newpoll = realloc( pollfd, new_count * sizeof(*pollfd) )))
+ ret = freelist - poll_users;
+ freelist = (struct fd **)poll_users[ret];
+ }
+ else
+ {
+ if (nb_users == allocated_users)
{
- if (allocated_users)
- poll_users = newusers;
- else
- free( newusers );
- return -1;
+ struct fd **newusers;
+ struct pollfd *newpoll;
+ int new_count = allocated_users ? (allocated_users + allocated_users / 2) : 16;
+ if (!(newusers = realloc( poll_users, new_count * sizeof(*poll_users) ))) return -1;
+ if (!(newpoll = realloc( pollfd, new_count * sizeof(*pollfd) )))
+ {
+ if (allocated_users)
+ poll_users = newusers;
+ else
+ free( newusers );
+ return -1;
+ }
+ poll_users = newusers;
+ pollfd = newpoll;
+ allocated_users = new_count;
}
- poll_users = newusers;
- pollfd = newpoll;
- allocated_users = new_count;
- }
- ret = nb_users++;
- }
- pollfd[ret].fd = -1;
- pollfd[ret].events = 0;
- pollfd[ret].revents = 0;
- poll_users[ret] = fd;
+ ret = nb_users++;
+ }
+ pollfd[ret].fd = -1;
+ pollfd[ret].events = 0;
+ pollfd[ret].revents = 0;
+ poll_users[ret] = fd;
+ }
active_users++;
+
return ret;
}
@@ -307,15 +372,37 @@
static void remove_poll_user( struct fd *fd, int user )
{
assert( user >= 0 );
- assert( poll_users[user] == fd );
- pollfd[user].fd = -1;
- pollfd[user].events = 0;
- pollfd[user].revents = 0;
- poll_users[user] = (struct fd *)freelist;
- freelist = &poll_users[user];
+ if( epoll_fd>=0 )
+ {
+ if( fd->unix_fd!=-1 )
+ {
+ struct epoll_event event; /* This struct needn't actually contain anything meaningful, as we are merely calling DEL */
+ if(!(_epoll_ctl(epoll_fd, EPOLL_CTL_DEL, fd->unix_fd, &event)==0 || errno==ENOENT))
+ {
+ int err;
+ err=errno;
+ }
+ }
+ }
+ else
+ {
+ assert( poll_users[user] == fd );
+ pollfd[user].fd = -1;
+ pollfd[user].events = 0;
+ pollfd[user].revents = 0;
+ poll_users[user] = (struct fd *)freelist;
+ freelist = &poll_users[user];
+ }
active_users--;
}
+/* initialize the fd related state */
+void init_fd()
+{
+ /* If this function fails, epoll_fd will be -1, which will signal
+ * the rest of the functions to use poll instead */
+ epoll_fd=_epoll_create(EPOLL_SIZE);
+}
/* server main poll() loop */
void main_loop(void)
@@ -341,16 +428,44 @@
}
if (!active_users) break; /* last user removed by a timeout */
}
- ret = poll( pollfd, nb_users, diff );
- if (ret > 0)
+ if( epoll_fd>=0 )
{
- int i;
- for (i = 0; i < nb_users; i++)
+ /* if the event handlers added a lot of new events, we may want to increase the returned
+ * events space */
+ if( epoll_revents_size<active_users )
{
- if (pollfd[i].revents)
+ /* If epoll_revents_size is below active_users, there is a (very slim) potential for starvation.
+ * It is not, strictly speaking, an error though. As such, if the allocation fails, we just go on
+ * with the smaller array size. */
+ struct epoll_event *new_revents=malloc(sizeof(struct epoll_event)*active_users);
+ if( new_revents!=NULL )
{
- fd_poll_event( poll_users[i], pollfd[i].revents );
- if (!--ret) break;
+ free(epoll_revents);
+ epoll_revents=new_revents;
+ epoll_revents_size=active_users;
+ }
+ }
+
+ ret = epoll_wait(epoll_fd, epoll_revents, epoll_revents_size, diff );
+ while( (ret--)>0 )
+ {
+ fd_poll_event((struct fd *)epoll_revents[ret].data.ptr, epoll_revents[ret].events);
+ }
+ }
+ else
+ {
+ /* No epoll support - use poll */
+ ret = poll( pollfd, nb_users, diff );
+ if (ret > 0)
+ {
+ int i;
+ for (i = 0; i < nb_users; i++)
+ {
+ if (pollfd[i].revents)
+ {
+ fd_poll_event( poll_users[i], pollfd[i].revents );
+ if (!--ret) break;
+ }
}
}
}
@@ -835,18 +950,46 @@
/* set the events that select waits for on this fd */
void set_fd_events( struct fd *fd, int events )
{
- int user = fd->poll_index;
- assert( poll_users[user] == fd );
- if (events == -1) /* stop waiting on this fd completely */
+ if( epoll_fd>=0 )
{
- pollfd[user].fd = -1;
- pollfd[user].events = POLLERR;
- pollfd[user].revents = 0;
+ struct epoll_event event;
+ event.events=events;
+ event.data.ptr=fd;
+
+ assert(fd->unix_fd>=0);
+
+ if( events != -1 )
+ {
+ int epoll_res;
+ if( (epoll_res=_epoll_ctl(epoll_fd, EPOLL_CTL_MOD, fd->unix_fd, &event )!=0) && errno==ENOENT )
+ {
+ /* For one reason or another this file descriptor isn't being watched at the moment. Just add it */
+ assert(_epoll_ctl(epoll_fd, EPOLL_CTL_ADD, fd->unix_fd, &event )==0);
+ }
+ else
+ assert(epoll_res==0);
+ }
+ else
+ {
+ /* Stop waiting on this fd completely */
+ assert(_epoll_ctl(epoll_fd, EPOLL_CTL_DEL, fd->unix_fd, &event )==0);
+ }
}
- else if (pollfd[user].fd != -1 || !pollfd[user].events)
+ else
{
- pollfd[user].fd = fd->unix_fd;
- pollfd[user].events = events;
+ int user = fd->poll_index;
+ assert( poll_users[user] == fd );
+ if (events == -1) /* stop waiting on this fd completely */
+ {
+ pollfd[user].fd = -1;
+ pollfd[user].events = POLLERR;
+ pollfd[user].revents = 0;
+ }
+ else if (pollfd[user].fd != -1 || !pollfd[user].events)
+ {
+ pollfd[user].fd = fd->unix_fd;
+ pollfd[user].events = events;
+ }
}
}
Index: server/file.h
===================================================================
RCS file: /home/sun/sources/cvs/wine/server/file.h,v
retrieving revision 1.16
diff -u -r1.16 file.h
--- server/file.h 16 Apr 2004 04:31:35 -0000 1.16
+++ server/file.h 24 Aug 2004 13:34:21 -0000
@@ -44,6 +44,7 @@
/* file descriptor functions */
+extern void init_fd();
extern struct fd *alloc_fd( const struct fd_ops *fd_user_ops, struct object *user );
extern struct fd *open_fd( struct fd *fd, const char *name, int flags, mode_t *mode,
unsigned int access, unsigned int sharing, unsigned int options );
Index: server/main.c
===================================================================
RCS file: /home/sun/sources/cvs/wine/server/main.c,v
retrieving revision 1.31
diff -u -r1.31 main.c
--- server/main.c 26 Mar 2003 01:32:18 -0000 1.31
+++ server/main.c 24 Aug 2004 15:49:33 -0000
@@ -122,6 +122,7 @@
signal( SIGTERM, sigterm_handler );
signal( SIGABRT, sigterm_handler );
+ init_fd();
sock_init();
open_master_socket();
sync_namespace = create_namespace( 37, TRUE );
Aug. 24, 2004
Re: DbgHelp: Fix for Includes with Relative Paths
by Robert Shearman
Eric Pouech wrote:
> Robert Shearman a écrit :
>
>> How does the attached patch look?
>
> better, but you should to nuke srcpath (and no longer currpath) in
> N_SO case, when *ptr is '\0' (it's defensive code, so it shouldn't
> harm on normally formed stabs file). As a side effect, you don't need
> also to memset currpath to 0 at the beginning of func
Is the attached patch correct?
Rob
Index: wine/dlls/dbghelp/stabs.c
===================================================================
RCS file: /home/wine/wine/dlls/dbghelp/stabs.c,v
retrieving revision 1.8
diff -u -p -r1.8 stabs.c
--- wine/dlls/dbghelp/stabs.c 23 Aug 2004 17:56:07 -0000 1.8
+++ wine/dlls/dbghelp/stabs.c 24 Aug 2004 20:49:54 -0000
@@ -1085,8 +1085,8 @@ SYM_TYPE stabs_parse(struct module* modu
struct symt_function* curr_func = NULL;
struct symt_block* block = NULL;
struct symt_compiland* compiland = NULL;
- char currpath[PATH_MAX];
- char srcpath[PATH_MAX];
+ char currpath[PATH_MAX]; /* path to current file */
+ char srcpath[PATH_MAX]; /* path to directory source file is in */
int i, j;
int nstab;
const char* ptr;
@@ -1108,7 +1108,6 @@ SYM_TYPE stabs_parse(struct module* modu
stab_ptr = (const struct stab_nlist*)(addr + staboff);
strs = (const char*)(addr + strtaboff);
- memset(currpath, 0, sizeof(currpath));
memset(srcpath, 0, sizeof(srcpath));
memset(stabs_basic, 0, sizeof(stabs_basic));
@@ -1377,7 +1376,7 @@ SYM_TYPE stabs_parse(struct module* modu
if (*ptr == '\0') /* end of N_SO file */
{
/* Nuke old path. */
- currpath[0] = '\0';
+ srcpath[0] = '\0';
stabs_finalize_function(module, curr_func);
curr_func = NULL;
source_idx = -1;
@@ -1387,20 +1386,17 @@ SYM_TYPE stabs_parse(struct module* modu
}
else
{
- stabs_reset_includes();
- if (*ptr != '/')
+ int len = strlen(ptr);
+ if (ptr[len-1] != '/')
{
strcpy(currpath, srcpath);
strcat(currpath, ptr);
+ stabs_reset_includes();
compiland = symt_new_compiland(module, currpath);
source_idx = source_new(module, currpath);
}
else
- {
strcpy(srcpath, ptr);
- compiland = symt_new_compiland(module, srcpath);
- source_idx = source_new(module, srcpath);
- }
}
break;
case N_SOL:
Aug. 24, 2004
Re: Wine Emulation: Swapping functions
by Alexandre Julliard
"Pierre d'Herbemont" <stegefin(a)free.fr> writes:
> Hi Alexandre,
>
> This patch allows to load a PE exe to memory. You may notice that
> there is no "mass" byte swapping. The technics used here is a bit
> developer here:
> http://stegefin.free.fr/wine/
> You might prefer a more conventional way of doing the byte swapping,
> in this case tell me. We might still need this approach since it could
> efficient for sharing data accross the LE exe and the BE winelib.
It doesn't seem very efficient to trap on every memory access...
Besides, I don't see how this can possibly work, there is no guarantee
that the compiler is going to generate accesses that always match the
size of the requested type, memcpy() being the obvious example.
I think you are going in the wrong direction with this; the right way
IMO is to compile Wine for x86 and run the whole Wine+app under the
CPU emulator. Otherwise you'll have to write wrappers for each of the
15,000 APIs.
--
Alexandre Julliard
julliard(a)winehq.org
Aug. 24, 2004
Re: poll vs. epoll
by Shachar Shemesh
Shachar Shemesh wrote:
> Dan Kegel wrote:
>
>> By all means, let's try epoll.
>> FWIW, I wrote a wrapper layer that illustrates how to detect
>> whether epoll etc. are available. I'm convinced that *runtime*
>> detection is the only way to go.
>
That's fine, except that compiling your library on a machine that has
epoll, and then trying to run it on a machine without will not work. It
will not load if runtime glibc doesn't have epoll. I'm using "syscall"
to work around that problem in wine.
>> Compile time detection is insufficient.
>> My code is at http://kegel.com/rn
>
>
> Sure will have a look.
>
It doesn't compile (rn.c is not including <sys/epoll.h>). When I fix
that, it checks whether epoll_create works. If it does, it sets all
handlers to use sigio. I don't think this library is quite stable enough :-)
In any case, it seems that it's interface is not ideal for wineserver.
Libevent, on the other hand......
Shachar
--
Shachar Shemesh
Lingnu Open Source Consulting ltd.
http://www.lingnu.com/
Aug. 24, 2004
Re: DbgHelp: Fix for Includes with Relative Paths
by Eric Pouech
Robert Shearman a écrit :
> How does the attached patch look?
better, but you should to nuke srcpath (and no longer currpath) in N_SO
case, when *ptr is '\0' (it's defensive code, so it shouldn't harm on
normally formed stabs file). As a side effect, you don't need also to
memset currpath to 0 at the beginning of func
A+
Aug. 24, 2004
Re: CreateRemoteThread and related stuff (patch)
by Alexandre Julliard
Robert Shearman <rob(a)codeweavers.com> writes:
> Mike Hearn wrote:
>
>> Ick. That sounds really really complicated. I'd be tempted to go for
>> bringing back the service thread but I wasn't around when it was
>> busy causing pain so maybe I sound a bit blase about that :)
>
> Perhaps the old-timers can tell us a story around the camp fire about
> this...
The main problem with a service thread is that it basically turns all
apps into multi-threaded apps whether they expect it or not, so it
creates various synchronization issues (for instance apps suddenly
start to receive DLL_THREAD_ATTACH notifications they don't expect,
things like that). And of course it also uses more resources (stack
space etc.); this is acceptable for apps that actually use the
feature, but we don't want to penalize all apps to support such an
uncommon case.
--
Alexandre Julliard
julliard(a)winehq.org
Aug. 24, 2004
Re: DbgHelp: Fix for Includes with Relative Paths
by Robert Shearman
Eric Pouech wrote:
> which means that:
> - we create a new compilation unit (for example) on 2205 => this gives
> the source directory
> - we start the main compilation unit on 2206 =>
> /home/dm/wine/dlls/dbghelp/elf_module.c
> - in this CU, we start a new include file (on xxxx), =>
> /home/dm/wine/dlls/dbghelp/../../include/winbase.h
> - ...
> - we close the CU on 4978
> Basically, as I wrote, you don't need two different beasts: currpath
> and srcpath. They refer to the same object, but the code is wrong.
>
> We should:
> - store the current directory on first SO (or the SO ended by a '/',
> which would be better)
> - on a non NULL SO, not ended by a '/' create a new compilation unit
> by concatening curr dir and the file name (or if file name is
> absolute, use the filename)
> - for each SOL, get the file name by concatening the curr dir with the
> file name (this operation is the same as above).
> - nuke the curr dir when getting a NULL SO
>
> current code is wrong as it creates two compilands for each
> compilation unit (one for each non NULL SO)
How does the attached patch look?
Rob
Index: wine/dlls/dbghelp/stabs.c
===================================================================
RCS file: /home/wine/wine/dlls/dbghelp/stabs.c,v
retrieving revision 1.8
diff -u -p -r1.8 stabs.c
--- wine/dlls/dbghelp/stabs.c 23 Aug 2004 17:56:07 -0000 1.8
+++ wine/dlls/dbghelp/stabs.c 24 Aug 2004 17:33:07 -0000
@@ -1085,8 +1085,8 @@ SYM_TYPE stabs_parse(struct module* modu
struct symt_function* curr_func = NULL;
struct symt_block* block = NULL;
struct symt_compiland* compiland = NULL;
- char currpath[PATH_MAX];
- char srcpath[PATH_MAX];
+ char currpath[PATH_MAX]; /* path to current file */
+ char srcpath[PATH_MAX]; /* path to directory source file is in */
int i, j;
int nstab;
const char* ptr;
@@ -1387,20 +1387,17 @@ SYM_TYPE stabs_parse(struct module* modu
}
else
{
- stabs_reset_includes();
- if (*ptr != '/')
+ int len = strlen(ptr);
+ if (ptr[len-1] != '/')
{
strcpy(currpath, srcpath);
strcat(currpath, ptr);
+ stabs_reset_includes();
compiland = symt_new_compiland(module, currpath);
source_idx = source_new(module, currpath);
}
else
- {
strcpy(srcpath, ptr);
- compiland = symt_new_compiland(module, srcpath);
- source_idx = source_new(module, srcpath);
- }
}
break;
case N_SOL:
Aug. 24, 2004
Re: CreateRemoteThread and related stuff (patch)
by Robert Shearman
Alexander Yaworsky wrote:
>Hello
>
>
>
>>Well, not quite. You can open another handle to the process using
>>DuplicateHandle or something else, so you need to go via the server. The
>>simplest way to do this using Win32 is:
>> if (GetProcessId(handle) == GetCurrentProcessId())
>>
>>
>
>You miss. It seems we really need __wine_is_current_process.
>
>
Sorry, GetProcessId is not available in Wine yet. I'll submit a patch to
add it.
>>Is it really necessary to perform the action required for remote
>>invocation of some operation asynchronously? It seems to add a lot of
>>unneeded complexity.
>>
>>
>
>What shall we do with csVirtual critical section in ntdll/virtual.c?
>
>
Ah, I see now. We may need to make server calls while in the remote
process and they will hang unless the "remote operation call" is done
asynchronously.
Rob
Aug. 24, 2004