From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12987 invoked by alias); 17 Aug 2005 16:39:14 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 12979 invoked by uid 22791); 17 Aug 2005 16:39:08 -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 16:39:08 +0000 Received: from mace ([192.168.1.25]) by SERRANO.CAM.ARTIMI.COM with Microsoft SMTPSVC(6.0.3790.1830); Wed, 17 Aug 2005 17:39:05 +0100 From: "Dave Korn" To: "'Mark Kettenis'" , Subject: [PATCH] Your patch from 20050512 b0rked on cygwin! Date: Wed, 17 Aug 2005 17:59:00 -0000 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_002E_01C5A352.90C73FB0" Message-ID: X-SW-Source: 2005-08/txt/msg00199.txt.bz2 This is a multi-part message in MIME format. ------=_NextPart_000_002E_01C5A352.90C73FB0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Content-length: 2571 [Please keep me in the Cc: line, as I don't subscribe to gdb-patches] Hi Mark, Your patch to unconditionally include shared library code: Original patch - http://sources.redhat.com/ml/gdb-patches/2005-05/msg00043.html Respin that went in - http://sources.redhat.com/ml/gdb-patches/2005-05/msg00198.html ... appears to have borked cygwin. No criticism of yourself should be read into this fact: you did appeal for cygwin testing, and nobody stepped up to the plate, so I'm as much to mea culpa as anybody. Anyway, the problem is that win32-nat.c implements its own versions of the solib functions, and since your change, there is now a namespace clash over solib_address. I don't know if this is directly because of your patch, or some indirect knock-on from multi-arch work that has been ongoing; I think it is probably just because solib.o is in the COMMON_OBS now, but I haven't actually checked out and built an earlier cvs version to confirm my theory. The attached patch fixes the problem, at any rate for me. However: a) I haven't done before-and-after testsuite runs yet, because of course there was no way to build a 'before' version recently. b) It may or may not impact MinGW. I don't use MinGW and don't have an install or setup; I don't even know if MinGW can be a native gdb target, although I have this vague memory of having read posts here that say it doesn't currently support gdb, and I couldn't find it mentioned in src/gdb/config/i386/*. So this might or might not be an issue. c) I changed a whole bunch of function names that didn't clash. I find this nice and consistent, but others may feel differently about aesthetically-pleasing but non-essential changes being applied. So I would appreciate a bit of review (and preferably from someone who knows better than me what's going on in this corner of the world!). 2005-08-17 Dave Korn * win32-nat.c (solib_address): Renamed from this... (win32_nat_solib_address): ...to this, to avoid clash with solib.c (child_solib_loaded_library_pathname, child_clear_solibs) (dll_symbol_command): Likewise renamed to.... (win32_nat_child_solib_loaded_library_pathname) (win32_nat_child_clear_solibs, win32_nat_dll_symbol_command): ...these, and all call sites adjusted. * config/i386/tm-cygwin.h (SOLIB_ADD, SOLIB_LOADED_LIBRARY_PATHNAME) (CLEAR_SOLIB, ADD_SHARED_SYMBOL_FILES, PC_SOLIB): Added 'win32_nat_' prefix to all symbols to match renamed functions in win32-nat.c. cheers, DaveK -- Can't think of a witty .sigline today.... ------=_NextPart_000_002E_01C5A352.90C73FB0 Content-Type: application/octet-stream; name="gdb-cygwin-solib-problem-patch.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="gdb-cygwin-solib-problem-patch.diff" Content-length: 4713 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= ------=_NextPart_000_002E_01C5A352.90C73FB0--