(handle_load_dll): Change DLL name to lower case.
(handle_exception): Add a second argument indicating whether a breakpoint
should be ignored. Return a 0 if the breakpoint was ignored.
(get_child_debug_event): Pass argument to handle_exception to control whether a
breakpoint should be ignored.
(child_create_inferior): Use modern cygwin API. Explicitly clear last_sig.
Pass FIRST_EXCEPTION to get_child_debug_event for detection of first
breakpoint.
* configure.in: Eliminate unneeded WINDRES/DLLTOOL tests left over after last change.
* configure: Regenerate.
2000-06-02 Christopher Faylor <cgf@cygnus.com>
- * configure.in: Detect correct versions of ranlib and windres when
+ * win32-nat.c: Fix up gcc warnings throughout.
+ (handle_load_dll): Change DLL name to lower case.
+ (handle_exception): Add a second argument indicating whether a
+ breakpoint should be ignored. Return a 0 if the breakpoint was
+ ignored.
+ (get_child_debug_event): Pass argument to handle_exception to control
+ whether a breakpoint should be ignored.
+ (child_create_inferior): Use modern cygwin API. Explicitly clear
+ last_sig. Pass FIRST_EXCEPTION to get_child_debug_event for detection
+ of first breakpoint.
+
+2000-06-02 Christopher Faylor <cgf@cygnus.com>
+
+ * configure.in: Detect correct versions of dlltool and windres when
cross-compiling.
* configure: Regenerate.
echo "$ac_t""$gdb_cv_os_cygwin" 1>&6
-DLLTOOL=${DLLTOOL-dlltool}
-WINDRES=${WINDRES-windres}
-
-
-
if test x$gdb_host = xgo32; then
TERM_LIB=
else
else
TERM_LIB=
echo $ac_n "checking for tgetent in -lncurses""... $ac_c" 1>&6
-echo "configure:5808: checking for tgetent in -lncurses" >&5
+echo "configure:5803: checking for tgetent in -lncurses" >&5
ac_lib_var=`echo ncurses'_'tgetent | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-lncurses $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 5816 "configure"
+#line 5811 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
tgetent()
; return 0; }
EOF
-if { (eval echo configure:5827: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5822: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for tgetent in -lHcurses""... $ac_c" 1>&6
-echo "configure:5846: checking for tgetent in -lHcurses" >&5
+echo "configure:5841: checking for tgetent in -lHcurses" >&5
ac_lib_var=`echo Hcurses'_'tgetent | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-lHcurses $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 5854 "configure"
+#line 5849 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
tgetent()
; return 0; }
EOF
-if { (eval echo configure:5865: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5860: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for tgetent in -ltermlib""... $ac_c" 1>&6
-echo "configure:5884: checking for tgetent in -ltermlib" >&5
+echo "configure:5879: checking for tgetent in -ltermlib" >&5
ac_lib_var=`echo termlib'_'tgetent | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-ltermlib $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 5892 "configure"
+#line 5887 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
tgetent()
; return 0; }
EOF
-if { (eval echo configure:5903: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5898: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for tgetent in -ltermcap""... $ac_c" 1>&6
-echo "configure:5922: checking for tgetent in -ltermcap" >&5
+echo "configure:5917: checking for tgetent in -ltermcap" >&5
ac_lib_var=`echo termcap'_'tgetent | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-ltermcap $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 5930 "configure"
+#line 5925 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
tgetent()
; return 0; }
EOF
-if { (eval echo configure:5941: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5936: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for tgetent in -lcurses""... $ac_c" 1>&6
-echo "configure:5960: checking for tgetent in -lcurses" >&5
+echo "configure:5955: checking for tgetent in -lcurses" >&5
ac_lib_var=`echo curses'_'tgetent | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-lcurses $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 5968 "configure"
+#line 5963 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
tgetent()
; return 0; }
EOF
-if { (eval echo configure:5979: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5974: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for tgetent in -lterminfo""... $ac_c" 1>&6
-echo "configure:5998: checking for tgetent in -lterminfo" >&5
+echo "configure:5993: checking for tgetent in -lterminfo" >&5
ac_lib_var=`echo terminfo'_'tgetent | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-lterminfo $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 6006 "configure"
+#line 6001 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
tgetent()
; return 0; }
EOF
-if { (eval echo configure:6017: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6012: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
fi
echo $ac_n "checking for Tcl configuration""... $ac_c" 1>&6
-echo "configure:6175: checking for Tcl configuration" >&5
+echo "configure:6170: checking for Tcl configuration" >&5
if eval "test \"`echo '$''{'ac_cv_c_tclconfig'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
fi
echo $ac_n "checking for Tk configuration""... $ac_c" 1>&6
-echo "configure:6283: checking for Tk configuration" >&5
+echo "configure:6278: checking for Tk configuration" >&5
if eval "test \"`echo '$''{'ac_cv_c_tkconfig'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
no_tcl=true
echo $ac_n "checking for Tcl private headers. dir=${configdir}""... $ac_c" 1>&6
-echo "configure:6379: checking for Tcl private headers. dir=${configdir}" >&5
+echo "configure:6374: checking for Tcl private headers. dir=${configdir}" >&5
# Check whether --with-tclinclude or --without-tclinclude was given.
if test "${with_tclinclude+set}" = set; then
withval="$with_tclinclude"
if test x"${ac_cv_c_tclh}" = x ; then
ac_safe=`echo "tclInt.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for tclInt.h""... $ac_c" 1>&6
-echo "configure:6445: checking for tclInt.h" >&5
+echo "configure:6440: checking for tclInt.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6450 "configure"
+#line 6445 "configure"
#include "confdefs.h"
#include <tclInt.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6455: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6450: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
#
no_tk=true
echo $ac_n "checking for Tk private headers""... $ac_c" 1>&6
-echo "configure:6515: checking for Tk private headers" >&5
+echo "configure:6510: checking for Tk private headers" >&5
# Check whether --with-tkinclude or --without-tkinclude was given.
if test "${with_tkinclude+set}" = set; then
withval="$with_tkinclude"
if test x"${ac_cv_c_tkh}" = x ; then
ac_safe=`echo "tk.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for tk.h""... $ac_c" 1>&6
-echo "configure:6581: checking for tk.h" >&5
+echo "configure:6576: checking for tk.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6586 "configure"
+#line 6581 "configure"
#include "confdefs.h"
#include <tk.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6591: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6586: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
echo $ac_n "checking for Itcl private headers. srcdir=${srcdir}""... $ac_c" 1>&6
-echo "configure:6637: checking for Itcl private headers. srcdir=${srcdir}" >&5
+echo "configure:6632: checking for Itcl private headers. srcdir=${srcdir}" >&5
if test x"${ac_cv_c_itclh}" = x ; then
for i in ${srcdir}/../itcl ${srcdir}/../../itcl ${srcdir}/../../../itcl ${srcdir}/../itcl/itcl; do
if test -f $i/generic/itcl.h ; then
echo $ac_n "checking for Itk private headers. srcdir=${srcdir}""... $ac_c" 1>&6
-echo "configure:6660: checking for Itk private headers. srcdir=${srcdir}" >&5
+echo "configure:6655: checking for Itk private headers. srcdir=${srcdir}" >&5
if test x"${ac_cv_c_itkh}" = x ; then
for i in ${srcdir}/../itcl ${srcdir}/../../itcl ${srcdir}/../../../itcl ${srcdir}/../itcl/itk; do
if test -f $i/generic/itk.h ; then
echo $ac_n "checking for Tix private headers. srcdir=${srcdir}""... $ac_c" 1>&6
-echo "configure:6683: checking for Tix private headers. srcdir=${srcdir}" >&5
+echo "configure:6678: checking for Tix private headers. srcdir=${srcdir}" >&5
if test x"${ac_cv_c_tixh}" = x ; then
for i in ${srcdir}/../tix ${srcdir}/../../tix ${srcdir}/../../../tix ; do
if test -f $i/generic/tix.h ; then
fi
echo $ac_n "checking for Itcl configuration""... $ac_c" 1>&6
-echo "configure:6721: checking for Itcl configuration" >&5
+echo "configure:6716: checking for Itcl configuration" >&5
if eval "test \"`echo '$''{'ac_cv_c_itclconfig'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
fi
echo $ac_n "checking for Itk configuration""... $ac_c" 1>&6
-echo "configure:6833: checking for Itk configuration" >&5
+echo "configure:6828: checking for Itk configuration" >&5
if eval "test \"`echo '$''{'ac_cv_c_itkconfig'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
fi
echo $ac_n "checking for Tix configuration""... $ac_c" 1>&6
-echo "configure:6945: checking for Tix configuration" >&5
+echo "configure:6940: checking for Tix configuration" >&5
if eval "test \"`echo '$''{'ac_cv_c_tixconfig'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# Uses ac_ vars as temps to allow command line to override cache and checks.
# --without-x overrides everything else, but does not touch the cache.
echo $ac_n "checking for X""... $ac_c" 1>&6
-echo "configure:7084: checking for X" >&5
+echo "configure:7079: checking for X" >&5
# Check whether --with-x or --without-x was given.
if test "${with_x+set}" = set; then
# First, try using that file with no special directory specified.
cat > conftest.$ac_ext <<EOF
-#line 7146 "configure"
+#line 7141 "configure"
#include "confdefs.h"
#include <$x_direct_test_include>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7151: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7146: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
ac_save_LIBS="$LIBS"
LIBS="-l$x_direct_test_library $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 7220 "configure"
+#line 7215 "configure"
#include "confdefs.h"
int main() {
${x_direct_test_function}()
; return 0; }
EOF
-if { (eval echo configure:7227: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7222: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
LIBS="$ac_save_LIBS"
# We can link X programs with no special library path.
links="${links} nm.h"
fi
echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
-echo "configure:7509: checking whether ln -s works" >&5
+echo "configure:7504: checking whether ln -s works" >&5
if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
-echo "configure:7533: checking for Cygwin environment" >&5
+echo "configure:7528: checking for Cygwin environment" >&5
if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 7538 "configure"
+#line 7533 "configure"
#include "confdefs.h"
int main() {
return __CYGWIN__;
; return 0; }
EOF
-if { (eval echo configure:7549: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7544: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_cygwin=yes
else
CYGWIN=
test "$ac_cv_cygwin" = yes && CYGWIN=yes
echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
-echo "configure:7566: checking for mingw32 environment" >&5
+echo "configure:7561: checking for mingw32 environment" >&5
if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 7571 "configure"
+#line 7566 "configure"
#include "confdefs.h"
int main() {
return __MINGW32__;
; return 0; }
EOF
-if { (eval echo configure:7578: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7573: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_mingw32=yes
else
echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
-echo "configure:7597: checking for executable suffix" >&5
+echo "configure:7592: checking for executable suffix" >&5
if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
rm -f conftest*
echo 'int main () { return 0; }' > conftest.$ac_ext
ac_cv_exeext=
- if { (eval echo configure:7607: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
+ if { (eval echo configure:7602: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
for file in conftest.*; do
case $file in
*.c | *.o | *.obj | *.ilk | *.pdb) ;;
lose
#endif],[gdb_cv_os_cygwin=yes],[gdb_cv_os_cygwin=no])])
-DLLTOOL=${DLLTOOL-dlltool}
-WINDRES=${WINDRES-windres}
-AC_SUBST(DLLTOOL)
-AC_SUBST(WINDRES)
-
dnl Figure out which term library to use.
if test x$gdb_host = xgo32; then
TERM_LIB=
#include <sys/types.h>
#include <fcntl.h>
#include <stdlib.h>
-
-#ifdef _MSC_VER
-#include "windefs.h"
-#else /* other WIN32 compiler */
#include <windows.h>
#include <imagehlp.h>
-#endif
+#include <sys/cygwin.h>
#include "buildsym.h"
#include "symfile.h"
#define CONTEXT_DEBUGGER (CONTEXT_FULL | CONTEXT_FLOATING_POINT)
#endif
+#define FIRST_EXCEPTION 0xffffffff
+
/* The string sent by cygwin when it processes a signal.
FIXME: This should be in a cygwin include file. */
#define CYGWIN_SIGNAL_STRING "cygwin: signal"
-#define CHECK(x) check (x, __FILE__,__LINE__)
+#define CHECK(x) check (x, __FILE__,__LINE__)
#define DEBUG_EXEC(x) if (debug_exec) printf x
#define DEBUG_EVENTS(x) if (debug_events) printf x
#define DEBUG_MEM(x) if (debug_memory) printf x
static int last_sig = 0; /* Set if a signal was received from the
debugged process */
-
/* Thread information structure used to track information that is
not available in gdb's thread structure. */
typedef struct thread_info_struct
STACKFRAME sf;
} thread_info;
-static thread_info thread_head = {NULL};
+static thread_info thread_head;
/* The process and thread handles for the above context. */
static HANDLE current_process_handle; /* Currently executing process */
static thread_info *current_thread; /* Info on currently selected thread */
static DWORD main_thread_id; /* Thread ID of the main thread */
-static int ignore_first_first_chance = 0; /* True if we should ignore the
- first first chance exception that we get. */
/* Counts of things. */
static int exception_count = 0;
check (BOOL ok, const char *file, int line)
{
if (!ok)
- printf_filtered ("error return %s:%d was %d\n", file, line, GetLastError ());
+ printf_filtered ("error return %s:%d was %lu\n", file, line, GetLastError ());
}
static void
if (!ok)
goto failed;
- for (i = 0; i < cbNeeded / sizeof (HMODULE); i++)
+ for (i = 0; i < (int) (cbNeeded / sizeof (HMODULE)); i++)
{
if (!(*psapi_GetModuleInformation) (current_process_handle,
DllHandle [i],
dll_name_ret,
MAX_PATH);
if (len == 0)
- error ("Error getting dll name: %u\n", GetLastError ());
+ error ("Error getting dll name: %u\n", GetLastError ());
if ((DWORD) (mi.lpBaseOfDll) == BaseAddress)
return 1;
of error; store status through argument pointer OURSTATUS. */
static int
-handle_load_dll (PTR dummy)
+handle_load_dll (PTR dummy ATTRIBUTE_UNUSED)
{
LOAD_DLL_DEBUG_INFO *event = ¤t_event.u.LoadDll;
DWORD dll_name_ptr;
DWORD done;
char dll_buf[MAX_PATH + 1];
char *p, *dll_name = NULL;
- struct objfile *objfile;
- MEMORY_BASIC_INFORMATION minfo;
struct section_addr_info section_addrs;
memset (§ion_addrs, 0, sizeof (section_addrs));
a program. It will not work for attached processes. */
if (dll_name == NULL || *dll_name == '\0')
{
- int size = event->fUnicode ? sizeof (WCHAR) : sizeof (char);
+ DWORD size = event->fUnicode ? sizeof (WCHAR) : sizeof (char);
int len = 0;
char b[2];
if (!dll_name)
return 1;
+ (void) strlwr (dll_name);
+
while ((p = strchr (dll_name, '\\')))
*p = '/';
section_addrs.other[0].name = ".text";
section_addrs.other[0].addr = (int) event->lpBaseOfDll + 0x1000;
safe_symbol_file_add (dll_name, 0, §ion_addrs, 0, OBJF_SHARED);
- printf_unfiltered ("%x:%s\n", event->lpBaseOfDll, dll_name);
+ printf_unfiltered ("%lx:%s\n", (DWORD) event->lpBaseOfDll, dll_name);
return 1;
}
if (strncmp (s, CYGWIN_SIGNAL_STRING, sizeof (CYGWIN_SIGNAL_STRING) - 1) != 0)
{
if (strncmp (s, "cYg", 3) != 0)
- warning (s);
+ warning ("%s", s);
}
else
{
}
static int
-handle_exception (struct target_waitstatus *ourstatus)
+handle_exception (struct target_waitstatus *ourstatus, int ignore_trap)
{
- int i;
- int done = 0;
thread_info *th;
- int fc = ignore_first_first_chance;
+ DWORD code = current_event.u.Exception.ExceptionRecord.ExceptionCode;
- ourstatus->kind = TARGET_WAITKIND_STOPPED;
+ if (ignore_trap && code == EXCEPTION_BREAKPOINT)
+ return 0;
- ignore_first_first_chance = 0;
+ ourstatus->kind = TARGET_WAITKIND_STOPPED;
/* Record the context of the current thread */
th = thread_rec (current_event.dwThreadId, -1);
last_sig = 0;
- switch (current_event.u.Exception.ExceptionRecord.ExceptionCode)
+ switch (code)
{
case EXCEPTION_ACCESS_VIOLATION:
- DEBUG_EXCEPT (("gdb: Target exception ACCESS_VIOLATION at 0x%08x\n",
- current_event.u.Exception.ExceptionRecord.ExceptionAddress));
+ DEBUG_EXCEPT (("gdb: Target exception ACCESS_VIOLATION at 0x%08lx\n",
+ (DWORD) current_event.u.Exception.ExceptionRecord.ExceptionAddress));
ourstatus->value.sig = TARGET_SIGNAL_SEGV;
last_sig = SIGSEGV;
break;
case STATUS_FLOAT_DIVIDE_BY_ZERO:
case STATUS_FLOAT_OVERFLOW:
case STATUS_INTEGER_DIVIDE_BY_ZERO:
- DEBUG_EXCEPT (("gdb: Target exception STACK_OVERFLOW at 0x%08x\n",
- current_event.u.Exception.ExceptionRecord.ExceptionAddress));
+ DEBUG_EXCEPT (("gdb: Target exception STACK_OVERFLOW at 0x%08lx\n",
+ (DWORD) current_event.u.Exception.ExceptionRecord.ExceptionAddress));
ourstatus->value.sig = TARGET_SIGNAL_FPE;
+ last_sig = SIGFPE;
break;
case STATUS_STACK_OVERFLOW:
- DEBUG_EXCEPT (("gdb: Target exception STACK_OVERFLOW at 0x%08x\n",
- current_event.u.Exception.ExceptionRecord.ExceptionAddress));
+ DEBUG_EXCEPT (("gdb: Target exception STACK_OVERFLOW at 0x%08lx\n",
+ (DWORD) current_event.u.Exception.ExceptionRecord.ExceptionAddress));
ourstatus->value.sig = TARGET_SIGNAL_SEGV;
break;
case EXCEPTION_BREAKPOINT:
- if (fc && current_event.u.Exception.dwFirstChance &&
- ((DWORD) current_event.u.Exception.ExceptionRecord.ExceptionAddress & 0xc0000000))
- {
- last_sig = -1;
- return 0;
- }
- DEBUG_EXCEPT (("gdb: Target exception BREAKPOINT at 0x%08x\n",
- current_event.u.Exception.ExceptionRecord.ExceptionAddress));
+ DEBUG_EXCEPT (("gdb: Target exception BREAKPOINT at 0x%08lx\n",
+ (DWORD) current_event.u.Exception.ExceptionRecord.ExceptionAddress));
ourstatus->value.sig = TARGET_SIGNAL_TRAP;
break;
case DBG_CONTROL_C:
- DEBUG_EXCEPT (("gdb: Target exception CONTROL_C at 0x%08x\n",
- current_event.u.Exception.ExceptionRecord.ExceptionAddress));
+ DEBUG_EXCEPT (("gdb: Target exception CONTROL_C at 0x%08lx\n",
+ (DWORD) current_event.u.Exception.ExceptionRecord.ExceptionAddress));
ourstatus->value.sig = TARGET_SIGNAL_INT;
last_sig = SIGINT; /* FIXME - should check pass state */
break;
case EXCEPTION_SINGLE_STEP:
- DEBUG_EXCEPT (("gdb: Target exception SINGLE_STEP at 0x%08x\n",
- current_event.u.Exception.ExceptionRecord.ExceptionAddress));
+ DEBUG_EXCEPT (("gdb: Target exception SINGLE_STEP at 0x%08lx\n",
+ (DWORD) current_event.u.Exception.ExceptionRecord.ExceptionAddress));
ourstatus->value.sig = TARGET_SIGNAL_TRAP;
break;
case EXCEPTION_ILLEGAL_INSTRUCTION:
- DEBUG_EXCEPT (("gdb: Target exception SINGLE_ILL at 0x%08x\n",
- current_event.u.Exception.ExceptionRecord.ExceptionAddress));
+ DEBUG_EXCEPT (("gdb: Target exception SINGLE_ILL at 0x%08lx\n",
+ (DWORD) current_event.u.Exception.ExceptionRecord.ExceptionAddress));
ourstatus->value.sig = TARGET_SIGNAL_ILL;
last_sig = SIGILL;
break;
default:
- printf_unfiltered ("gdb: unknown target exception 0x%08x at 0x%08x\n",
+ printf_unfiltered ("gdb: unknown target exception 0x%08lx at 0x%08lx\n",
current_event.u.Exception.ExceptionRecord.ExceptionCode,
- current_event.u.Exception.ExceptionRecord.ExceptionAddress);
+ (DWORD) current_event.u.Exception.ExceptionRecord.ExceptionAddress);
ourstatus->value.sig = TARGET_SIGNAL_UNKNOWN;
break;
}
thread_info *th;
BOOL res;
- DEBUG_EVENTS (("ContinueDebugEvent (cpid=%d, ctid=%d, DBG_CONTINUE);\n",
+ DEBUG_EVENTS (("ContinueDebugEvent (cpid=%ld, ctid=%ld, DBG_CONTINUE);\n",
current_event.dwProcessId, current_event.dwThreadId));
res = ContinueDebugEvent (current_event.dwProcessId,
current_event.dwThreadId,
continue_status = 0;
if (res)
for (th = &thread_head; (th = th->next) != NULL;)
- if (((id == -1) || (id == th->id)) && th->suspend_count)
+ if (((id == -1) || (id == (int) th->id)) && th->suspend_count)
{
for (i = 0; i < th->suspend_count; i++)
(void) ResumeThread (th->h);
handling by WFI (or whatever).
*/
static int
-get_child_debug_event (int pid, struct target_waitstatus *ourstatus,
+get_child_debug_event (int pid ATTRIBUTE_UNUSED, struct target_waitstatus *ourstatus,
DWORD target_event_code, int *retval)
{
int breakout = 0;
thread_info *th = NULL;
static thread_info dummy_thread_info;
+ *retval = 0;
if (!(debug_event = WaitForDebugEvent (¤t_event, 1000)))
- {
- *retval = 0;
- goto out;
- }
+ goto out;
event_count++;
continue_status = DBG_CONTINUE;
- *retval = 0;
event_code = current_event.dwDebugEventCode;
breakout = event_code == target_event_code;
(unsigned) current_event.dwProcessId,
(unsigned) current_event.dwThreadId,
"EXCEPTION_DEBUG_EVENT"));
- if (handle_exception (ourstatus))
+ if (handle_exception (ourstatus, target_event_code == FIRST_EXCEPTION))
*retval = current_event.dwThreadId;
else
- {
- if (last_sig >= 0)
- continue_status = DBG_EXCEPTION_NOT_HANDLED;
- breakout = 0;
- }
+ breakout = -1;
break;
case OUTPUT_DEBUG_STRING_EVENT: /* message from the kernel */
handle_output_debug_string ( ourstatus);
break;
default:
- printf_unfiltered ("gdb: kernel event for pid=%d tid=%d\n",
- current_event.dwProcessId,
- current_event.dwThreadId);
- printf_unfiltered (" unknown event code %d\n",
+ printf_unfiltered ("gdb: kernel event for pid=%ld tid=%ld\n",
+ (DWORD) current_event.dwProcessId,
+ (DWORD) current_event.dwThreadId);
+ printf_unfiltered (" unknown event code %ld\n",
current_event.dwDebugEventCode);
break;
}
- if (breakout)
+ if (breakout > 0)
current_thread = th ?: thread_rec (current_event.dwThreadId, TRUE);
- else
+ else if (!breakout)
CHECK (child_continue (continue_status, -1));
out:
static int
child_wait (int pid, struct target_waitstatus *ourstatus)
{
- DWORD event_code;
int retval;
/* We loop when we get a non-standard exception rather than return
}
static void
-child_detach (args, from_tty)
- char *args;
- int from_tty;
+child_detach (char *args ATTRIBUTE_UNUSED, int from_tty)
{
if (from_tty)
{
/* Print status information about what we're accessing. */
static void
-child_files_info (ignore)
- struct target_ops *ignore;
+child_files_info (struct target_ops *ignore ATTRIBUTE_UNUSED)
{
printf_unfiltered ("\tUsing the running image of %s %s.\n",
attach_flag ? "attached" : "child", target_pid_to_str (inferior_pid));
/* ARGSUSED */
static void
-child_open (arg, from_tty)
- char *arg;
- int from_tty;
+child_open (char *arg ATTRIBUTE_UNUSED, int from_tty ATTRIBUTE_UNUSED)
{
error ("Use the \"run\" command to start a Unix child process.");
}
BOOL ret;
DWORD flags;
char *args;
- DWORD event_code;
if (!exec_file)
{
memset (&si, 0, sizeof (si));
si.cb = sizeof (si);
- cygwin32_conv_to_win32_path (exec_file, real_path);
+ cygwin_conv_to_win32_path (exec_file, real_path);
flags = DEBUG_ONLY_THIS_PROCESS;
len = strlen (conv_path_names[j]);
if (strncmp (conv_path_names[j], env[i], len) == 0)
{
- if (cygwin32_posix_path_list_p (env[i] + len))
+ if (cygwin_posix_path_list_p (env[i] + len))
envlen += len
- + cygwin32_posix_to_win32_path_list_buf_size (env[i] + len);
+ + cygwin_posix_to_win32_path_list_buf_size (env[i] + len);
else
envlen += strlen (env[i]) + 1;
break;
len = strlen (conv_path_names[j]);
if (strncmp (conv_path_names[j], env[i], len) == 0)
{
- if (cygwin32_posix_path_list_p (env[i] + len))
+ if (cygwin_posix_path_list_p (env[i] + len))
{
memcpy (temp, env[i], len);
- cygwin32_posix_to_win32_path_list (env[i] + len, temp + len);
+ cygwin_posix_to_win32_path_list (env[i] + len, temp + len);
}
else
strcpy (temp, env[i]);
clear_proceed_status ();
target_terminal_init ();
target_terminal_inferior ();
-
- ignore_first_first_chance = 1;
+ last_sig = 0;
/* Run until process and threads are loaded */
while (!get_child_debug_event (inferior_pid, &dummy,
- CREATE_PROCESS_DEBUG_EVENT, &ret))
+ FIRST_EXCEPTION, &ret))
continue;
/* child_continue (DBG_CONTINUE, -1);*/
int
child_xfer_memory (CORE_ADDR memaddr, char *our, int len,
- int write, struct target_ops *target)
+ int write, struct target_ops *target ATTRIBUTE_UNUSED)
{
DWORD done;
if (write)
{
- DEBUG_MEM (("gdb: write target memory, %d bytes at 0x%08x\n",
- len, memaddr));
+ DEBUG_MEM (("gdb: write target memory, %d bytes at 0x%08lx\n",
+ len, (DWORD) memaddr));
WriteProcessMemory (current_process_handle, (LPVOID) memaddr, our,
len, &done);
FlushInstructionCache (current_process_handle, (LPCVOID) memaddr, len);
}
else
{
- DEBUG_MEM (("gdb: read target memory, %d bytes at 0x%08x\n",
- len, memaddr));
+ DEBUG_MEM (("gdb: read target memory, %d bytes at 0x%08lx\n",
+ len, (DWORD) memaddr));
ReadProcessMemory (current_process_handle, (LPCVOID) memaddr, our, len,
&done);
}
cygwin_pid_to_str (int pid)
{
static char buf[80];
- if (pid == current_event.dwProcessId)
+ if ((DWORD) pid == current_event.dwProcessId)
sprintf (buf, "process %d", pid);
else
- sprintf (buf, "thread %d.0x%x", current_event.dwProcessId, pid);
+ sprintf (buf, "thread %ld.0x%x", current_event.dwProcessId, pid);
return buf;
}
#include <sys/types.h>
#include <fcntl.h>
#include <stdlib.h>
-
-#ifdef _MSC_VER
-#include "windefs.h"
-#else /* other WIN32 compiler */
#include <windows.h>
#include <imagehlp.h>
-#endif
+#include <sys/cygwin.h>
#include "buildsym.h"
#include "symfile.h"
#define CONTEXT_DEBUGGER (CONTEXT_FULL | CONTEXT_FLOATING_POINT)
#endif
+#define FIRST_EXCEPTION 0xffffffff
+
/* The string sent by cygwin when it processes a signal.
FIXME: This should be in a cygwin include file. */
#define CYGWIN_SIGNAL_STRING "cygwin: signal"
-#define CHECK(x) check (x, __FILE__,__LINE__)
+#define CHECK(x) check (x, __FILE__,__LINE__)
#define DEBUG_EXEC(x) if (debug_exec) printf x
#define DEBUG_EVENTS(x) if (debug_events) printf x
#define DEBUG_MEM(x) if (debug_memory) printf x
static int last_sig = 0; /* Set if a signal was received from the
debugged process */
-
/* Thread information structure used to track information that is
not available in gdb's thread structure. */
typedef struct thread_info_struct
STACKFRAME sf;
} thread_info;
-static thread_info thread_head = {NULL};
+static thread_info thread_head;
/* The process and thread handles for the above context. */
static HANDLE current_process_handle; /* Currently executing process */
static thread_info *current_thread; /* Info on currently selected thread */
static DWORD main_thread_id; /* Thread ID of the main thread */
-static int ignore_first_first_chance = 0; /* True if we should ignore the
- first first chance exception that we get. */
/* Counts of things. */
static int exception_count = 0;
check (BOOL ok, const char *file, int line)
{
if (!ok)
- printf_filtered ("error return %s:%d was %d\n", file, line, GetLastError ());
+ printf_filtered ("error return %s:%d was %lu\n", file, line, GetLastError ());
}
static void
if (!ok)
goto failed;
- for (i = 0; i < cbNeeded / sizeof (HMODULE); i++)
+ for (i = 0; i < (int) (cbNeeded / sizeof (HMODULE)); i++)
{
if (!(*psapi_GetModuleInformation) (current_process_handle,
DllHandle [i],
dll_name_ret,
MAX_PATH);
if (len == 0)
- error ("Error getting dll name: %u\n", GetLastError ());
+ error ("Error getting dll name: %u\n", GetLastError ());
if ((DWORD) (mi.lpBaseOfDll) == BaseAddress)
return 1;
of error; store status through argument pointer OURSTATUS. */
static int
-handle_load_dll (PTR dummy)
+handle_load_dll (PTR dummy ATTRIBUTE_UNUSED)
{
LOAD_DLL_DEBUG_INFO *event = ¤t_event.u.LoadDll;
DWORD dll_name_ptr;
DWORD done;
char dll_buf[MAX_PATH + 1];
char *p, *dll_name = NULL;
- struct objfile *objfile;
- MEMORY_BASIC_INFORMATION minfo;
struct section_addr_info section_addrs;
memset (§ion_addrs, 0, sizeof (section_addrs));
a program. It will not work for attached processes. */
if (dll_name == NULL || *dll_name == '\0')
{
- int size = event->fUnicode ? sizeof (WCHAR) : sizeof (char);
+ DWORD size = event->fUnicode ? sizeof (WCHAR) : sizeof (char);
int len = 0;
char b[2];
if (!dll_name)
return 1;
+ (void) strlwr (dll_name);
+
while ((p = strchr (dll_name, '\\')))
*p = '/';
section_addrs.other[0].name = ".text";
section_addrs.other[0].addr = (int) event->lpBaseOfDll + 0x1000;
safe_symbol_file_add (dll_name, 0, §ion_addrs, 0, OBJF_SHARED);
- printf_unfiltered ("%x:%s\n", event->lpBaseOfDll, dll_name);
+ printf_unfiltered ("%lx:%s\n", (DWORD) event->lpBaseOfDll, dll_name);
return 1;
}
if (strncmp (s, CYGWIN_SIGNAL_STRING, sizeof (CYGWIN_SIGNAL_STRING) - 1) != 0)
{
if (strncmp (s, "cYg", 3) != 0)
- warning (s);
+ warning ("%s", s);
}
else
{
}
static int
-handle_exception (struct target_waitstatus *ourstatus)
+handle_exception (struct target_waitstatus *ourstatus, int ignore_trap)
{
- int i;
- int done = 0;
thread_info *th;
- int fc = ignore_first_first_chance;
+ DWORD code = current_event.u.Exception.ExceptionRecord.ExceptionCode;
- ourstatus->kind = TARGET_WAITKIND_STOPPED;
+ if (ignore_trap && code == EXCEPTION_BREAKPOINT)
+ return 0;
- ignore_first_first_chance = 0;
+ ourstatus->kind = TARGET_WAITKIND_STOPPED;
/* Record the context of the current thread */
th = thread_rec (current_event.dwThreadId, -1);
last_sig = 0;
- switch (current_event.u.Exception.ExceptionRecord.ExceptionCode)
+ switch (code)
{
case EXCEPTION_ACCESS_VIOLATION:
- DEBUG_EXCEPT (("gdb: Target exception ACCESS_VIOLATION at 0x%08x\n",
- current_event.u.Exception.ExceptionRecord.ExceptionAddress));
+ DEBUG_EXCEPT (("gdb: Target exception ACCESS_VIOLATION at 0x%08lx\n",
+ (DWORD) current_event.u.Exception.ExceptionRecord.ExceptionAddress));
ourstatus->value.sig = TARGET_SIGNAL_SEGV;
last_sig = SIGSEGV;
break;
case STATUS_FLOAT_DIVIDE_BY_ZERO:
case STATUS_FLOAT_OVERFLOW:
case STATUS_INTEGER_DIVIDE_BY_ZERO:
- DEBUG_EXCEPT (("gdb: Target exception STACK_OVERFLOW at 0x%08x\n",
- current_event.u.Exception.ExceptionRecord.ExceptionAddress));
+ DEBUG_EXCEPT (("gdb: Target exception STACK_OVERFLOW at 0x%08lx\n",
+ (DWORD) current_event.u.Exception.ExceptionRecord.ExceptionAddress));
ourstatus->value.sig = TARGET_SIGNAL_FPE;
+ last_sig = SIGFPE;
break;
case STATUS_STACK_OVERFLOW:
- DEBUG_EXCEPT (("gdb: Target exception STACK_OVERFLOW at 0x%08x\n",
- current_event.u.Exception.ExceptionRecord.ExceptionAddress));
+ DEBUG_EXCEPT (("gdb: Target exception STACK_OVERFLOW at 0x%08lx\n",
+ (DWORD) current_event.u.Exception.ExceptionRecord.ExceptionAddress));
ourstatus->value.sig = TARGET_SIGNAL_SEGV;
break;
case EXCEPTION_BREAKPOINT:
- if (fc && current_event.u.Exception.dwFirstChance &&
- ((DWORD) current_event.u.Exception.ExceptionRecord.ExceptionAddress & 0xc0000000))
- {
- last_sig = -1;
- return 0;
- }
- DEBUG_EXCEPT (("gdb: Target exception BREAKPOINT at 0x%08x\n",
- current_event.u.Exception.ExceptionRecord.ExceptionAddress));
+ DEBUG_EXCEPT (("gdb: Target exception BREAKPOINT at 0x%08lx\n",
+ (DWORD) current_event.u.Exception.ExceptionRecord.ExceptionAddress));
ourstatus->value.sig = TARGET_SIGNAL_TRAP;
break;
case DBG_CONTROL_C:
- DEBUG_EXCEPT (("gdb: Target exception CONTROL_C at 0x%08x\n",
- current_event.u.Exception.ExceptionRecord.ExceptionAddress));
+ DEBUG_EXCEPT (("gdb: Target exception CONTROL_C at 0x%08lx\n",
+ (DWORD) current_event.u.Exception.ExceptionRecord.ExceptionAddress));
ourstatus->value.sig = TARGET_SIGNAL_INT;
last_sig = SIGINT; /* FIXME - should check pass state */
break;
case EXCEPTION_SINGLE_STEP:
- DEBUG_EXCEPT (("gdb: Target exception SINGLE_STEP at 0x%08x\n",
- current_event.u.Exception.ExceptionRecord.ExceptionAddress));
+ DEBUG_EXCEPT (("gdb: Target exception SINGLE_STEP at 0x%08lx\n",
+ (DWORD) current_event.u.Exception.ExceptionRecord.ExceptionAddress));
ourstatus->value.sig = TARGET_SIGNAL_TRAP;
break;
case EXCEPTION_ILLEGAL_INSTRUCTION:
- DEBUG_EXCEPT (("gdb: Target exception SINGLE_ILL at 0x%08x\n",
- current_event.u.Exception.ExceptionRecord.ExceptionAddress));
+ DEBUG_EXCEPT (("gdb: Target exception SINGLE_ILL at 0x%08lx\n",
+ (DWORD) current_event.u.Exception.ExceptionRecord.ExceptionAddress));
ourstatus->value.sig = TARGET_SIGNAL_ILL;
last_sig = SIGILL;
break;
default:
- printf_unfiltered ("gdb: unknown target exception 0x%08x at 0x%08x\n",
+ printf_unfiltered ("gdb: unknown target exception 0x%08lx at 0x%08lx\n",
current_event.u.Exception.ExceptionRecord.ExceptionCode,
- current_event.u.Exception.ExceptionRecord.ExceptionAddress);
+ (DWORD) current_event.u.Exception.ExceptionRecord.ExceptionAddress);
ourstatus->value.sig = TARGET_SIGNAL_UNKNOWN;
break;
}
thread_info *th;
BOOL res;
- DEBUG_EVENTS (("ContinueDebugEvent (cpid=%d, ctid=%d, DBG_CONTINUE);\n",
+ DEBUG_EVENTS (("ContinueDebugEvent (cpid=%ld, ctid=%ld, DBG_CONTINUE);\n",
current_event.dwProcessId, current_event.dwThreadId));
res = ContinueDebugEvent (current_event.dwProcessId,
current_event.dwThreadId,
continue_status = 0;
if (res)
for (th = &thread_head; (th = th->next) != NULL;)
- if (((id == -1) || (id == th->id)) && th->suspend_count)
+ if (((id == -1) || (id == (int) th->id)) && th->suspend_count)
{
for (i = 0; i < th->suspend_count; i++)
(void) ResumeThread (th->h);
handling by WFI (or whatever).
*/
static int
-get_child_debug_event (int pid, struct target_waitstatus *ourstatus,
+get_child_debug_event (int pid ATTRIBUTE_UNUSED, struct target_waitstatus *ourstatus,
DWORD target_event_code, int *retval)
{
int breakout = 0;
thread_info *th = NULL;
static thread_info dummy_thread_info;
+ *retval = 0;
if (!(debug_event = WaitForDebugEvent (¤t_event, 1000)))
- {
- *retval = 0;
- goto out;
- }
+ goto out;
event_count++;
continue_status = DBG_CONTINUE;
- *retval = 0;
event_code = current_event.dwDebugEventCode;
breakout = event_code == target_event_code;
(unsigned) current_event.dwProcessId,
(unsigned) current_event.dwThreadId,
"EXCEPTION_DEBUG_EVENT"));
- if (handle_exception (ourstatus))
+ if (handle_exception (ourstatus, target_event_code == FIRST_EXCEPTION))
*retval = current_event.dwThreadId;
else
- {
- if (last_sig >= 0)
- continue_status = DBG_EXCEPTION_NOT_HANDLED;
- breakout = 0;
- }
+ breakout = -1;
break;
case OUTPUT_DEBUG_STRING_EVENT: /* message from the kernel */
handle_output_debug_string ( ourstatus);
break;
default:
- printf_unfiltered ("gdb: kernel event for pid=%d tid=%d\n",
- current_event.dwProcessId,
- current_event.dwThreadId);
- printf_unfiltered (" unknown event code %d\n",
+ printf_unfiltered ("gdb: kernel event for pid=%ld tid=%ld\n",
+ (DWORD) current_event.dwProcessId,
+ (DWORD) current_event.dwThreadId);
+ printf_unfiltered (" unknown event code %ld\n",
current_event.dwDebugEventCode);
break;
}
- if (breakout)
+ if (breakout > 0)
current_thread = th ?: thread_rec (current_event.dwThreadId, TRUE);
- else
+ else if (!breakout)
CHECK (child_continue (continue_status, -1));
out:
static int
child_wait (int pid, struct target_waitstatus *ourstatus)
{
- DWORD event_code;
int retval;
/* We loop when we get a non-standard exception rather than return
}
static void
-child_detach (args, from_tty)
- char *args;
- int from_tty;
+child_detach (char *args ATTRIBUTE_UNUSED, int from_tty)
{
if (from_tty)
{
/* Print status information about what we're accessing. */
static void
-child_files_info (ignore)
- struct target_ops *ignore;
+child_files_info (struct target_ops *ignore ATTRIBUTE_UNUSED)
{
printf_unfiltered ("\tUsing the running image of %s %s.\n",
attach_flag ? "attached" : "child", target_pid_to_str (inferior_pid));
/* ARGSUSED */
static void
-child_open (arg, from_tty)
- char *arg;
- int from_tty;
+child_open (char *arg ATTRIBUTE_UNUSED, int from_tty ATTRIBUTE_UNUSED)
{
error ("Use the \"run\" command to start a Unix child process.");
}
BOOL ret;
DWORD flags;
char *args;
- DWORD event_code;
if (!exec_file)
{
memset (&si, 0, sizeof (si));
si.cb = sizeof (si);
- cygwin32_conv_to_win32_path (exec_file, real_path);
+ cygwin_conv_to_win32_path (exec_file, real_path);
flags = DEBUG_ONLY_THIS_PROCESS;
len = strlen (conv_path_names[j]);
if (strncmp (conv_path_names[j], env[i], len) == 0)
{
- if (cygwin32_posix_path_list_p (env[i] + len))
+ if (cygwin_posix_path_list_p (env[i] + len))
envlen += len
- + cygwin32_posix_to_win32_path_list_buf_size (env[i] + len);
+ + cygwin_posix_to_win32_path_list_buf_size (env[i] + len);
else
envlen += strlen (env[i]) + 1;
break;
len = strlen (conv_path_names[j]);
if (strncmp (conv_path_names[j], env[i], len) == 0)
{
- if (cygwin32_posix_path_list_p (env[i] + len))
+ if (cygwin_posix_path_list_p (env[i] + len))
{
memcpy (temp, env[i], len);
- cygwin32_posix_to_win32_path_list (env[i] + len, temp + len);
+ cygwin_posix_to_win32_path_list (env[i] + len, temp + len);
}
else
strcpy (temp, env[i]);
clear_proceed_status ();
target_terminal_init ();
target_terminal_inferior ();
-
- ignore_first_first_chance = 1;
+ last_sig = 0;
/* Run until process and threads are loaded */
while (!get_child_debug_event (inferior_pid, &dummy,
- CREATE_PROCESS_DEBUG_EVENT, &ret))
+ FIRST_EXCEPTION, &ret))
continue;
/* child_continue (DBG_CONTINUE, -1);*/
int
child_xfer_memory (CORE_ADDR memaddr, char *our, int len,
- int write, struct target_ops *target)
+ int write, struct target_ops *target ATTRIBUTE_UNUSED)
{
DWORD done;
if (write)
{
- DEBUG_MEM (("gdb: write target memory, %d bytes at 0x%08x\n",
- len, memaddr));
+ DEBUG_MEM (("gdb: write target memory, %d bytes at 0x%08lx\n",
+ len, (DWORD) memaddr));
WriteProcessMemory (current_process_handle, (LPVOID) memaddr, our,
len, &done);
FlushInstructionCache (current_process_handle, (LPCVOID) memaddr, len);
}
else
{
- DEBUG_MEM (("gdb: read target memory, %d bytes at 0x%08x\n",
- len, memaddr));
+ DEBUG_MEM (("gdb: read target memory, %d bytes at 0x%08lx\n",
+ len, (DWORD) memaddr));
ReadProcessMemory (current_process_handle, (LPCVOID) memaddr, our, len,
&done);
}
cygwin_pid_to_str (int pid)
{
static char buf[80];
- if (pid == current_event.dwProcessId)
+ if ((DWORD) pid == current_event.dwProcessId)
sprintf (buf, "process %d", pid);
else
- sprintf (buf, "thread %d.0x%x", current_event.dwProcessId, pid);
+ sprintf (buf, "thread %ld.0x%x", current_event.dwProcessId, pid);
return buf;
}