[code] [gdb] GDB solutions + questions

From: Mark Crichton (crichton@main.citynet.net)
Date: 03/01/97

[Sorry about the Subject: mangling, tried to make it brief, but failed]

[Stuff about crashes snipped for brevity]
> I tried to use gdb to track down the cause of the crash, but I got the
> following (running Slackware 2.0.0):


> ----START PASTE----
> GDB is free software and you are welcome to distribute copies of it
> under certain conditions; type "show copying" to see the conditions.
> There is absolutely no warranty for GDB; type "show warranty" for details.
> GDB 4.15.1 (i486-slackware-linux),
> Copyright 1995 Free Software Foundation, Inc...
> Couldn't fetch registers from core file: File in wrong format
> Couldn't fetch registers from core file: File in wrong format
> #0  0x0 in ?? ()
> (gdb)
> ----END PASTE----
> Two questions:
> 1) Why is the core file "in wrong format"? I get this without exception.

The problem is that, in a nutshell, Slackware...urm...is "less than optimal"
for working parts.  GDB (in ALL of the Slacks I've used recently) were compiled
with the wrong bfd libraries and hence can't read a core file hanging right in
front of their faces :(

My solution was to COMPLETELY nuke Slackware and move either to Debian or
RedHat/Caldera.  Not only does gdb work in BOTH of those Distro's, but IMHO the
packages included are more complete, better set up, more secure, and easier to
deal with/manage. (you could of course, get new bfd libs, recompile gdb and
the bintuils.  Might also have to rebuild gcc...hence why I did the former)

(I've posted this to ward off a rush of newbie questions that'll come up if 
more people use gdb and Slackware...)

Oh dear, posted to the list, so...

	One of the things I've been thinking of/tinkering with is to have the
MUD dynamically add functions while running using the dl* set of functions.

	I have a few questions about this:
	1) How portable is the dl* set of calls around Unicies?  I know Linux
	and (I think) Solaris have them, but what about some others (AIX,
	IRIX, BSD+clones, etc.)

	2) Is it easy to *replace* current functions, or what should I watch
	out for (Say, as the mud is running, completely replace the fight()
	finction with something else that takes the same parameters...)

	3) Am I nuts in even thinking about this? :)

Also, is there a (better) way to map pointer names to functions (for those that
use the event code on the Circle ftp site will hopefully know what I'm talking
about)?  Since that code stores function pointers, I would like a simple stat
command to show what function will get called at what time, yet hex addresses
aren't exactly human readable. :)  My current solution is to take nm output
from the compiled executable, and then load it up as a text file, and the stat
command go down the list, finds a "mathcing" pointer, then display the name.
Is there an "easier" way (since it requires some gymnastics at build time...)

Mark Crichton

| Ensure that you have read the CircleMUD Mailing List FAQ: |
|   http://cspo.queensu.ca/~fletcher/Circle/list_faq.html   |
|    Or send 'info circle' to majordomo@cspo.queensu.ca     |

This archive was generated by hypermail 2b30 : 12/18/00 PST