🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gdb.bug
Article #643

gdb-3.0/munch

#643
From: Dirk Grunwald
Date: Thu, 22 Dec 1988 19:58
89 lines
2244 bytes
And, actually, you have to change munch to make it work under UMAX.
I've appended a new copy at the end of this mail.

Here's a diff that's needed for core.c to compile under UMAX.

*** /tmp/,RCSt1004108	Thu Dec 22 13:56:28 1988
--- core.c	Thu Dec 22 13:55:54 1988
***************
*** 34,40 ****
--- 34,44 ----
  #include <sys/file.h>
  #include <sys/stat.h>
  
+ #ifdef UMAX_CORE
+ #include <sys/ptrace.h>
+ #else /* not UMAX_CORE */
  #include <sys/user.h>
+ #endif
  
  /* Recognize COFF format systems because a.out.h defines AOUTHDR.  */
  #ifdef AOUTHDR


...and here's the new munch

#! /bin/sh

# create an initialization procedure from a list of .o files

cookie=">>>use usg format"
nookie=">>>use umax format"

# see if param.h defines "USG"
cat param.h > /tmp/munch$$.c
cat >> /tmp/munch$$.c <<!
#ifdef USG
$cookie
#endif
#ifdef UMAX_CORE
$nookie
#endif
!
if (cc -E -I. /tmp/munch$$.c | grep "^$cookie" > /dev/null)
then
	TYPE=USG
else
    if (cc -E -I. /tmp/munch$$.c | grep "^$nookie" > /dev/null)
    then
	TYPE=UMAX
    else
	TYPE=BSD
    fi
fi
rm -f /tmp/munch$$.c


echo '/* Do not modify this file.  It is created automatically by "munch". */'
echo 'void initialize_all_files () {'

case $TYPE in
	BSD)
		nm $* | \
		grep 'T __initialize_' | \
		sed -e 's/^.*T _\(.*\)/    \1 ();/'
		;;
	USG)
		# for usg use nm -p, grep for _initialize, 
		# don't delete leading '_'
		nm -p $* | \
		grep 'T _initialize_' | \
		sed -e 's/^.*T \(.*\)/    \1 ();/'
		;;
#
#	Some people just have to be different.
#
	UMAX)
		# for usg use nm -p, grep for _initialize, 
		# don't delete leading '_'
		nm -p $* | \
		grep 'T __initialize_' | \
		sed -e 's/^.*T _\(.*\)/    \1 ();/'
		;;
	*)
		echo unknown object file type $TYPE
		;;
esac

echo '}'
Technical Details
Message-ID: <8812221958.AA13825@m.cs.uiuc.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watmath!uunet!bu-cs!bloom-beacon!tut.cis.ohio-state.edu!M.CS.UIUC.EDU!grunwald

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watmath!uunet!bu-cs!bloom-beacon!tut.cis.ohio-state.edu!M.CS.UIUC.EDU!grunwald
From: grunwald@M.CS.UIUC.EDU (Dirk Grunwald)
Newsgroups: gnu.gdb.bug
Subject: gdb-3.0/munch
Message-ID: <8812221958.AA13825@m.cs.uiuc.edu>
Date: 22 Dec 88 19:58:04 GMT
Sender: daemon@tut.cis.ohio-state.edu
Reply-To: grunwald@m.cs.uiuc.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 89