From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15447 invoked by alias); 17 Aug 2005 15:48:27 -0000 Mailing-List: contact insight-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: insight-owner@sourceware.org Received: (qmail 15408 invoked by uid 22791); 17 Aug 2005 15:48:21 -0000 Received: from host217-40-213-68.in-addr.btopenworld.com (HELO SERRANO.CAM.ARTIMI.COM) (217.40.213.68) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Wed, 17 Aug 2005 15:48:20 +0000 Received: from mace ([192.168.1.25]) by SERRANO.CAM.ARTIMI.COM with Microsoft SMTPSVC(6.0.3790.1830); Wed, 17 Aug 2005 16:48:17 +0100 From: "Dave Korn" To: "'Jingzhao Ou'" Cc: Subject: RE: Compiling the latest GDB on cygwin Date: Wed, 17 Aug 2005 15:48:00 -0000 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_0028_01C5A34B.789AE920" In-Reply-To: <43025127.7020407@gmail.com> Message-ID: X-SW-Source: 2005-q3/txt/msg00065.txt.bz2 This is a multi-part message in MIME format. ------=_NextPart_000_0028_01C5A34B.789AE920 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Content-length: 2844 ----Original Message---- >From: Jingzhao Ou >Sent: 16 August 2005 21:49 > Hi, Dave, > > I downloaded the following version of Insight from the ftp website: > > ftp://sources.redhat.com:/pub/insight/snapshots/current/insight-weekly-6.30. 50.20050808.tar.bz2 > > When I tried to compile the source in cygwin on a WinXP box, I got the > following error message: > tclWin32Dll.o: In function `TclpCheckStackSpace': > /cygdrive/d/src/tcl/win/tclWin32Dll.c:364: undefined reference to > `__except_checkstackspace_handler' [ ... snip several similar ... ] > collect2: ld returned 1 exit status > I changed tcl/win/Makefile and undefined "-DHAVE_NO_SEH=1". Then I got > errors reporting that "__try" are undefined, etc. I commented out all > the "__try" and "__except" and get tcl compiled without further > complaints. This is a known problem, but the solution isn't to change the HAVE_NO_SEH flag. The functions are being compiled but they're only referenced from asm (...) statements and the optimiser thinks they're unused. (The optimiser has become more aggressive in more recent versions of gcc, which is why this problem didn't show up before; it's only started happening recently because cygwin went from a 3.3.x series compiler to a 3.4.x series compiler a few months back). It's fixed in CVS, or you could apply the patch at http://sourceware.org/ml/insight/2005-q3/msg00021.html > After that, I still encountered the following errors in the "gdb" > directory: > > libgdb.a(solib.o): In function `solib_address': > /cygdrive/d/src/gdb/solib.c:771: multiple definition of `_solib_address' > libgdb.a(win32-nat.o):/cygdrive/d/src/gdb/win32-nat.c:728: first defined > here Ah, this is a new one on me too. It seems that the win32 native version of solib_address is now clashing with the generic version from solib.c; I don't know why this shouldn't have always been the case, perhaps the visibility of one of the symbols has changed recently, maybe it's a side-effect of some of the multi-arch work. ISTM that the correct thing to do is use the win32 native version of the functions, which seems to override the generic solib functionality with dll-related functionality. Which makes sense. > I got lost here and don't know how I should proceed. Can any one kindly > tell me what I am missing in the compilation process? I am only > interested in using gdb to debug C/C++ code. I don't need the Java or > Fortran stuffs if they are giving me trouble. You're doing fine so far. Attached is my current patchset; this fixes both problems and results in a working gdb, but I've not looked to thoroughly at it for correctness. Apply it to the snapshout you're working with and have another go, and let me know if it works/doesn't work for you. cheers, DaveK -- Can't think of a witty .sigline today.... ------=_NextPart_000_0028_01C5A34B.789AE920 Content-Type: application/octet-stream; name="gdb-cygwin-patches.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="gdb-cygwin-patches.diff" Content-length: 7900 Index: gdb/win32-nat.c=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= RCS file: /cvs/src/src/gdb/win32-nat.c,v=0A= retrieving revision 1.112=0A= diff -p -u -r1.112 win32-nat.c=0A= --- gdb/win32-nat.c 6 Jul 2005 14:54:34 -0000 1.112=0A= +++ gdb/win32-nat.c 17 Aug 2005 15:21:12 -0000=0A= @@ -724,7 +724,7 @@ handle_unload_dll (void *dummy)=0A= }=0A= =20=0A= char *=0A= -solib_address (CORE_ADDR address)=0A= +win32_nat_solib_address (CORE_ADDR address)=0A= {=0A= struct so_stuff *so;=0A= for (so =3D &solib_start; so->next !=3D NULL; so =3D so->next)=0A= @@ -735,14 +735,14 @@ solib_address (CORE_ADDR address)=0A= =20=0A= /* Return name of last loaded DLL. */=0A= char *=0A= -child_solib_loaded_library_pathname (int pid)=0A= +win32_nat_child_solib_loaded_library_pathname (int pid)=0A= {=0A= return !solib_end || !solib_end->name[0] ? NULL : solib_end->name;=0A= }=0A= =20=0A= /* Clear list of loaded DLLs. */=0A= void=0A= -child_clear_solibs (void)=0A= +win32_nat_child_clear_solibs (void)=0A= {=0A= struct so_stuff *so, *so1 =3D solib_start.next;=0A= =20=0A= @@ -868,7 +868,7 @@ solib_symbols_add (char *name, int from_=0A= =20=0A= /* Load DLL symbol info. */=0A= void=0A= -dll_symbol_command (char *args, int from_tty)=0A= +win32_nat_dll_symbol_command (char *args, int from_tty)=0A= {=0A= int n;=0A= dont_repeat ();=0A= @@ -1453,7 +1453,7 @@ do_initial_child_stuff (DWORD pid)=0A= memset (¤t_event, 0, sizeof (current_event));=0A= push_target (&deprecated_child_ops);=0A= disable_breakpoints_in_shlibs (1);=0A= - child_clear_solibs ();=0A= + win32_nat_child_clear_solibs ();=0A= clear_proceed_status ();=0A= init_wait_for_inferior ();=0A= =20=0A= @@ -2129,7 +2129,7 @@ _initialize_win32_nat (void)=0A= =20=0A= init_child_ops ();=0A= =20=0A= - c =3D add_com ("dll-symbols", class_files, dll_symbol_command,=0A= + c =3D add_com ("dll-symbols", class_files, win32_nat_dll_symbol_command,= =0A= _("Load dll library symbols from FILE."));=0A= set_cmd_completer (c, filename_completer);=0A= =20=0A= @@ -2429,14 +2429,14 @@ out:=0A= }=0A= =20=0A= void=0A= -child_solib_add (char *filename, int from_tty, struct target_ops *target,= =0A= +win32_nat_child_solib_add (char *filename, int from_tty, struct target_ops= *target,=0A= int readsyms)=0A= {=0A= if (!readsyms)=0A= return;=0A= if (core_bfd)=0A= {=0A= - child_clear_solibs ();=0A= + win32_nat_child_clear_solibs ();=0A= bfd_map_over_sections (core_bfd, &core_section_load_dll_symbols, tar= get);=0A= }=0A= else=0A= Index: gdb/config/i386/tm-cygwin.h=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= RCS file: /cvs/src/src/gdb/config/i386/tm-cygwin.h,v=0A= retrieving revision 1.18=0A= diff -p -u -r1.18 tm-cygwin.h=0A= --- gdb/config/i386/tm-cygwin.h 6 Apr 2004 01:53:51 -0000 1.18=0A= +++ gdb/config/i386/tm-cygwin.h 17 Aug 2005 15:21:12 -0000=0A= @@ -21,16 +21,16 @@=0A= Boston, MA 02111-1307, USA. */=0A= =20=0A= #define ATTACH_NO_WAIT=0A= -#define SOLIB_ADD(filename, from_tty, targ, readsyms) child_solib_add(file= name, from_tty, targ, readsyms)=0A= -#define PC_SOLIB(addr) solib_address (addr)=0A= -#define SOLIB_LOADED_LIBRARY_PATHNAME(pid) child_solib_loaded_library_path= name(pid)=0A= -#define CLEAR_SOLIB child_clear_solibs=0A= -#define ADD_SHARED_SYMBOL_FILES dll_symbol_command=0A= +#define SOLIB_ADD(filename, from_tty, targ, readsyms) win32_nat_child_soli= b_add(filename, from_tty, targ, readsyms)=0A= +#define PC_SOLIB(addr) win32_nat_solib_address (addr)=0A= +#define SOLIB_LOADED_LIBRARY_PATHNAME(pid) win32_nat_child_solib_loaded_li= brary_pathname(pid)=0A= +#define CLEAR_SOLIB win32_nat_child_clear_solibs=0A= +#define ADD_SHARED_SYMBOL_FILES win32_nat_dll_symbol_command=0A= =20=0A= struct target_ops;=0A= char *cygwin_pid_to_str (ptid_t ptid);=0A= -void child_solib_add (char *, int, struct target_ops *, int);=0A= -char *solib_address (CORE_ADDR);=0A= -char *child_solib_loaded_library_pathname(int);=0A= -void child_clear_solibs (void);=0A= -void dll_symbol_command (char *, int);=0A= +void win32_nat_child_solib_add (char *, int, struct target_ops *, int);=0A= +char *win32_nat_solib_address (CORE_ADDR);=0A= +char *win32_nat_child_solib_loaded_library_pathname(int);=0A= +void win32_nat_child_clear_solibs (void);=0A= +void win32_nat_dll_symbol_command (char *, int);=0A= Index: tcl/win/tclWin32Dll.c=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= RCS file: /cvs/src/src/tcl/win/tclWin32Dll.c,v=0A= retrieving revision 1.9=0A= diff -p -u -r1.9 tclWin32Dll.c=0A= --- tcl/win/tclWin32Dll.c 21 Jan 2003 19:40:22 -0000 1.9=0A= +++ tcl/win/tclWin32Dll.c 17 Aug 2005 15:21:16 -0000=0A= @@ -38,8 +38,8 @@ static HINSTANCE hInstance; /* HINSTANCE=0A= static int platformId; /* Running under NT, or 95/98? */=0A= =20=0A= #ifdef HAVE_NO_SEH=0A= -static void *ESP;=0A= -static void *EBP;=0A= +static void *ESP __attribute__ ((used));=0A= +static void *EBP __attribute__ ((used));=0A= #endif /* HAVE_NO_SEH */=0A= =20=0A= /*=0A= @@ -393,7 +393,7 @@ TclpCheckStackSpace()=0A= }=0A= #ifdef HAVE_NO_SEH=0A= static=0A= -__attribute__ ((cdecl))=0A= +__attribute__ ((cdecl)) __attribute__ ((used))=0A= EXCEPTION_DISPOSITION=0A= _except_checkstackspace_handler(=0A= struct _EXCEPTION_RECORD *ExceptionRecord,=0A= Index: tcl/win/tclWinChan.c=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= RCS file: /cvs/src/src/tcl/win/tclWinChan.c,v=0A= retrieving revision 1.5=0A= diff -p -u -r1.5 tclWinChan.c=0A= --- tcl/win/tclWinChan.c 21 Jan 2003 19:40:22 -0000 1.5=0A= +++ tcl/win/tclWinChan.c 17 Aug 2005 15:21:18 -0000=0A= @@ -122,8 +122,8 @@ static Tcl_ChannelType fileChannelType =3D=0A= };=0A= =20=0A= #ifdef HAVE_NO_SEH=0A= -static void *ESP;=0A= -static void *EBP;=0A= +static void *ESP __attribute__ ((used));=0A= +static void *EBP __attribute__ ((used));=0A= #endif /* HAVE_NO_SEH */=0A= =20=0A= =0C=0A= @@ -1106,7 +1106,7 @@ Tcl_MakeFileChannel(rawHandle, mode)=0A= }=0A= #ifdef HAVE_NO_SEH=0A= static=0A= -__attribute__ ((cdecl))=0A= +__attribute__ ((cdecl)) __attribute__ ((used))=0A= EXCEPTION_DISPOSITION=0A= _except_makefilechannel_handler(=0A= struct _EXCEPTION_RECORD *ExceptionRecord,=0A= Index: tcl/win/tclWinFCmd.c=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= RCS file: /cvs/src/src/tcl/win/tclWinFCmd.c,v=0A= retrieving revision 1.6=0A= diff -p -u -r1.6 tclWinFCmd.c=0A= --- tcl/win/tclWinFCmd.c 7 Feb 2003 19:52:00 -0000 1.6=0A= +++ tcl/win/tclWinFCmd.c 17 Aug 2005 15:21:19 -0000=0A= @@ -469,7 +469,7 @@ DoRenameFile(=0A= }=0A= #ifdef HAVE_NO_SEH=0A= static=0A= -__attribute__ ((cdecl))=0A= +__attribute__ ((cdecl)) __attribute__ ((used))=0A= EXCEPTION_DISPOSITION=0A= _except_dorenamefile_handler(=0A= struct _EXCEPTION_RECORD *ExceptionRecord,=0A= @@ -651,7 +651,7 @@ DoCopyFile(=0A= }=0A= #ifdef HAVE_NO_SEH=0A= static=0A= -__attribute__ ((cdecl))=0A= +__attribute__ ((cdecl)) __attribute__ ((used))=0A= EXCEPTION_DISPOSITION=0A= _except_docopyfile_handler(=0A= struct _EXCEPTION_RECORD *ExceptionRecord,=0A= ------=_NextPart_000_0028_01C5A34B.789AE920--