From a71625261972960776d7602a2673fcd98fddae62 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Fri, 17 Jun 2011 08:30:27 +0000 Subject: [PATCH] * dcrt0.cc (dll_crt0_1): Call strace.dll_info after call to pinfo_init. * strace.cc (strace::hello): Drop printing DLL information here since application info is not always available at this point. (strace::dll_info): New method to print DLL info. * include/sys/strace.h (strace::dll_info): Declare. --- winsup/cygwin/ChangeLog | 8 ++++++++ winsup/cygwin/dcrt0.cc | 1 + winsup/cygwin/include/sys/strace.h | 1 + winsup/cygwin/strace.cc | 16 ++++++++++++---- 4 files changed, 22 insertions(+), 4 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index d9ca4e551..3b9b57bde 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,11 @@ +2011-06-17 Corinna Vinschen + + * dcrt0.cc (dll_crt0_1): Call strace.dll_info after call to pinfo_init. + * strace.cc (strace::hello): Drop printing DLL information here since + application info is not always available at this point. + (strace::dll_info): New method to print DLL info. + * include/sys/strace.h (strace::dll_info): Declare. + 2011-06-17 Corinna Vinschen * dtable.cc (handle_to_fn): Accommodate name change of pty named pipes, diff --git a/winsup/cygwin/dcrt0.cc b/winsup/cygwin/dcrt0.cc index af8fcfe4c..e9ac04a21 100644 --- a/winsup/cygwin/dcrt0.cc +++ b/winsup/cygwin/dcrt0.cc @@ -806,6 +806,7 @@ dll_crt0_1 (void *) } #endif pinfo_init (envp, envc); + strace.dll_info (); /* Allocate cygheap->fdtab */ dtable_init (); diff --git a/winsup/cygwin/include/sys/strace.h b/winsup/cygwin/include/sys/strace.h index 2eeea992e..5f9ce7628 100644 --- a/winsup/cygwin/include/sys/strace.h +++ b/winsup/cygwin/include/sys/strace.h @@ -46,6 +46,7 @@ public: int lmicrosec; bool execing; void hello () __attribute__ ((regparm (1))); + void dll_info () __attribute__ ((regparm (1))); void prntf (unsigned, const char *func, const char *, ...) /*__attribute__ ((regparm(3)))*/; void vprntf (unsigned, const char *func, const char *, va_list ap) /*__attribute__ ((regparm(3)))*/; void wm (int message, int word, int lon) __attribute__ ((regparm(3))); diff --git a/winsup/cygwin/strace.cc b/winsup/cygwin/strace.cc index 19b6e5050..bd54bfb7c 100644 --- a/winsup/cygwin/strace.cc +++ b/winsup/cygwin/strace.cc @@ -57,6 +57,18 @@ strace::hello () } prntf (1, NULL, "**********************************************"); prntf (1, NULL, "Program name: %W %s", myself->progname, pidbuf); + prntf (1, NULL, "OS version: Windows %s", wincap.osname ()); + if (cygheap) + prntf (1, NULL, "Heap size: %u", cygheap->user_heap.chunk); + prntf (1, NULL, "**********************************************"); + } +} + +void +strace::dll_info () +{ + if (active ()) + { prntf (1, NULL, "App version: %d.%d, api: %d.%d", user_data->dll_major, user_data->dll_minor, user_data->api_major, user_data->api_minor); @@ -64,10 +76,6 @@ strace::hello () cygwin_version.dll_major, cygwin_version.dll_minor, cygwin_version.api_major, cygwin_version.api_minor); prntf (1, NULL, "DLL build: %s", cygwin_version.dll_build_date); - prntf (1, NULL, "OS version: Windows %s", wincap.osname ()); - if (cygheap) - prntf (1, NULL, "Heap size: %u", cygheap->user_heap.chunk); - prntf (1, NULL, "**********************************************"); } }