From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25628 invoked by alias); 26 Apr 2004 20:43:29 -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 25595 invoked from network); 26 Apr 2004 20:43:27 -0000 Received: from unknown (HELO mailout.TechFak.Uni-Bielefeld.DE) (129.70.136.245) by sources.redhat.com with SMTP; 26 Apr 2004 20:43:27 -0000 Received: from xayide.TechFak.Uni-Bielefeld.DE.TechFak.Uni-Bielefeld.DE (xayide.TechFak.Uni-Bielefeld.DE [129.70.137.35]) by momotombo.TechFak.Uni-Bielefeld.DE (8.12.11/8.12.11/TechFak/2004/02/24/sjaenick) with ESMTP id i3QKhQjo020965 for ; Mon, 26 Apr 2004 22:43:27 +0200 (MEST) From: Rainer Orth Message-ID: <16525.29805.263020.874731@xayide.TechFak.Uni-Bielefeld.DE> Date: Mon, 26 Apr 2004 20:43:00 -0000 To: gdb-patches@sources.redhat.com Subject: PATCH: Workaround IRIX 5 compilation problem Mime-Version: 1.0 (generated by tm-edit 7.106) Content-Type: text/plain; charset=US-ASCII X-SW-Source: 2004-04/txt/msg00618.txt.bz2 GDB 6.1 fails to compile on mips-sgi-irix5.3 with the following error: gcc -c -O2 -I. -I/vol/gnu/src/gdb/gdb-dist/gdb -I/vol/gnu/src/gdb/gdb-dist/gdb/config -DLOCALEDIR="\"/vol/gnu/share/locale\"" -DHAVE_CONFIG_H -I/vol/gnu/src/gdb/gdb-dist/gdb/../include/opcode -I/vol/gnu/src/gdb/gdb-dist/gdb/../readline/.. -I../bfd -I/vol/gnu/src/gdb/gdb-dist/gdb/../bfd -I/vol/gnu/src/gdb/gdb-dist/gdb/../include -I../intl -I/vol/gnu/src/gdb/gdb-dist/gdb/../intl -DMI_OUT=1 -Wimplicit -Wreturn-type -Wcomment -Wtrigraphs -Wformat -Wparentheses -Wpointer-arith -Wuninitialized -Wformat-nonliteral -Wunused-label /vol/gnu/src/gdb/gdb-dist/gdb/proc-api.c /vol/gnu/src/gdb/gdb-dist/gdb/procfs.c: In function `create_procinfo': /vol/gnu/src/gdb/gdb-dist/gdb/procfs.c:689: warning: implicit declaration of function `memset' /vol/gnu/src/gdb/gdb-dist/gdb/procfs.c: In function `dead_procinfo': /vol/gnu/src/gdb/gdb-dist/gdb/procfs.c:828: warning: format not a string literal and no format arguments /vol/gnu/src/gdb/gdb-dist/gdb/procfs.c: In function `proc_get_pending_signals': /vol/gnu/src/gdb/gdb-dist/gdb/procfs.c:2037: warning: implicit declaration of function `memcpy' /vol/gnu/src/gdb/gdb-dist/gdb/procfs.c: In function `procfs_create_inferior': /vol/gnu/src/gdb/gdb-dist/gdb/procfs.c:4940: warning: implicit declaration of function `strchr' /vol/gnu/src/gdb/gdb-dist/gdb/procfs.c:4975: warning: implicit declaration of function `strlen' /vol/gnu/src/gdb/gdb-dist/gdb/procfs.c:4983: warning: implicit declaration of function `strncpy' /vol/gnu/src/gdb/gdb-dist/gdb/procfs.c:4985: warning: implicit declaration of function `strcat' /vol/gnu/src/gdb/gdb-dist/gdb/procfs.c: In function `mappingflags': /vol/gnu/src/gdb/gdb-dist/gdb/procfs.c:5494: warning: implicit declaration of function `strcpy' /vol/gnu/src/gdb/gdb-dist/gdb/procfs.c: In function `info_mappings_callback': /vol/gnu/src/gdb/gdb-dist/gdb/procfs.c:5539: warning: format not a string literal, argument types not checked /vol/gnu/src/gdb/gdb-dist/gdb/procfs.c: In function `info_proc_mappings': /vol/gnu/src/gdb/gdb-dist/gdb/procfs.c:5569: warning: format not a string literal, argument types not checked /vol/gnu/src/gdb/gdb-dist/gdb/procfs.c: In function `info_proc_cmd': /vol/gnu/src/gdb/gdb-dist/gdb/procfs.c:5613: warning: implicit declaration of function `strncmp' In file included from /usr/include/sys/proc.h:138, from /vol/gnu/src/gdb/gdb-dist/gdb/proc-api.c:42: /usr/include/sys/region.h:75: error: parse error before "anon_hdl" /usr/include/sys/region.h:77: error: parse error before '}' token /usr/include/sys/region.h:342: error: parse error before "sysreg" /usr/include/sys/region.h:348: error: parse error before '*' token /usr/include/sys/region.h:351: error: parse error before '*' token /usr/include/sys/region.h:354: error: parse error before '*' token /usr/include/sys/region.h:373: error: parse error before '*' token /usr/include/sys/region.h:437: error: parse error before "reg_t" /vol/gnu/src/gdb/gdb-dist/gdb/procfs.c: In function `create_procinfo': /vol/gnu/src/gdb/gdb-dist/gdb/procfs.c:677: warning: 'parent' might be used uninitialized in this function make[1]: *** [proc-api.o] Error 1 This happens because the definition of of anon_hdl in is protected with _KERNEL || _STANDALONE || _KMEMUSER. Compiling with -D_KMEMUSER works, but unfortunately adding that definition to gdb/config/mips/nm-irix5.h does not: is included before defs.h, so the definition needs to go either into config.h or directly into proc-api.c. I think the former approach is cleaner, so this patch implements it. Ok for 6.1 branch and mainline? Rainer ----------------------------------------------------------------------------- Rainer Orth, Faculty of Technology, Bielefeld University Fri Apr 23 22:48:23 2004 Rainer Orth * configure.in (mips-sgi-irix5*): Define _KMEMUSER for . * configure: Regenerate. * config.in: Likewise. =================================================================== RCS file: gdb/RCS/configure.in,v retrieving revision 1.1 diff -up -r1.1 gdb/configure.in --- gdb/configure.in 2004/02/26 00:41:46 1.1 +++ gdb/configure.in 2004/04/23 20:48:02 @@ -606,6 +606,7 @@ AC_MSG_RESULT($gdb_cv_hpux_sswide) # If we are configured native on GNU/Linux, work around problems with # sys/procfs.h # Also detect which type of /proc is in use, such as for Unixware or Solaris. +# Work around a problem on IRIX 5. if test "${target}" = "${host}"; then case "${host}" in @@ -622,6 +623,10 @@ if test "${target}" = "${host}"; then *-*-solaris2.[[6789]]) AC_DEFINE(NEW_PROC_API) ;; + mips-sgi-irix5*) + AC_DEFINE(_KMEMUSER, 1, + [[Define to 1 so gets a definition of anon_hdl. ]]) + ;; esac fi