Umm your arguments are invalid.
>From klib.c, allock_klib:
static klib_t *
alloc_klib()
{
klib_t *klp;
/* if (klp = (klib_t *)malloc(sizeof(klib_t))) { */
bzero(klp, sizeof(klib_t));
/* }*/
return(klp);
}
klp is a stack allocated pointer to a klib_t type, but that klib_t
isn't allocated in the context of alloc_klib and was not passed
into alloc_klib directly as an argument.
So, the klp points to junk (it wasn't initialized
and will just be garbage that was on the stack, on other platforms,
that stack junk might just happen to be the desired klib_t,
but that would just be an artifact of the calling sequence).
I'm reasonably sure that bzero is fine, uncommenting the line before and
after
would probably help because then you would actually have a klib_t to
initialize.
...tom
-----Original Message-----
From: Hall, Brian
Sent: Tuesday, April 18, 2000 3:23 PM
To: lkcd@xxxxxxxxxxx
Cc: axp-list@xxxxxxxxxx; clinux@xxxxxxxxxxx
Subject: Alpha lkcd port: bzero problem
I have made my attempt at integrating the Alpha debugger from gdb-4.1.8 into
lcrash. However, now when I run lcrash (directly at the command line or via
a
real crash), I get this in gdb:
Starting program: /CDR_UPLOAD/hallb/linux-2.2.13-1.0.3/cmd/lcrash/./lcrash
map = /boot/System.map, vmdump = /dev/mem, outfile = stdout
Please wait...
Program received signal SIGSEGV, Segmentation fault.
__bzero () at ../sysdeps/alpha/bzero.S:107
107 ../sysdeps/alpha/bzero.S: No such file or directory.
Current language: auto; currently asm
(gdb) where
#0 __bzero () at ../sysdeps/alpha/bzero.S:107
#1 0x12002b7e8 in alloc_klib () at klib.c:191
#2 0x12002b8f0 in kl_init_klib (map=0x120164c30 "/boot/System.map",
vmdump=0x120164f30 "/dev/mem", namelist=0x120164d30 "",
flags=0) at klib.c:220
#3 0x1200029b0 in main (argc=1, argv=0x11ffffc28) at main.c:182
>From klib.c, allock_klib:
static klib_t *
alloc_klib()
{
klib_t *klp;
/* if (klp = (klib_t *)malloc(sizeof(klib_t))) { */
bzero(klp, sizeof(klib_t));
/* }*/
return(klp);
}
Does bzero work correctly on Alpha? Or are my arguments invalid?
--
http://www.bigfoot.com/~brihall
Linux Consultant
**********************************************************
To unsubscribe from this list, send mail to
majordomo@xxxxxxxxxxx with the following text in the
*body* (*not* the subject line) of the letter:
unsubscribe clinux
**********************************************************
|