public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* RE: [ECOS] uninitialized variable
@ 2001-09-07 17:55 Fabrice Gautier
  0 siblings, 0 replies; 2+ messages in thread
From: Fabrice Gautier @ 2001-09-07 17:55 UTC (permalink / raw)
  To: eCos Discussion

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1585 bytes --]

> -----Original Message-----
> From: Trenton D. Adams [ mailto:tadams@theone.dnsalias.com ]
> Subject: [ECOS] uninitialized variable
> 
> 
> Is memory in eCos initialized to these values before it's 
> used?  When I
> didn't initialize this variable, it ended up being set to this value
> which happened to be in memory at that location.
> 
> (gdb) print slot->attr
> $1 = (unsigned char *) 0xdeadbeef "_\004 Bâ\004 Bä\001 Dä\001 Då\t"
> 
> Is this some sort of joke, or just a !TOTALLY random occurance?

I don't for sure for your special case, but the dead beef value is used a
few times in eCos mostly to detect some uninitialized variable.

See:

Searching for 'deadbeef'...
D:\ecos-cvs-with-e7t\ecos\packages\hal\arm\ebsa285\current\tests\sdram0.cxx(
170):
	cyg_uint32 d = 0xdeadbeef ^ ((cyg_uint32)i * 0x10001);
D:\ecos-cvs-with-e7t\ecos\packages\hal\arm\iq80310\current\src\diag\ether_te
st.c(528):
	if (isr_connect (ENET_INT_ID, (VOIDFUNCPTR)i557IntHandler,
0xdeadbeef) != OK)
D:\ecos-cvs-with-e7t\ecos\packages\hal\arm\iq80310\current\src\diag\ether_te
st.c(542):
	if (pci_isr_connect (unit_intpin, unit_busno, unit_devno,
i557IntHandler, 0xdeadbeef) != OK)
D:\ecos-cvs-with-e7t\ecos\packages\io\eth\current\src\net\eth_drv.c(152):
	s->r_rx_corrupt = (unsigned int)sc ^ 0xdeadbeef;
D:\ecos-cvs-with-e7t\ecos\packages\kernel\current\tests\kcache2.c(140):
	*p++ = 0xdeadbeef;
D:\ecos-cvs-with-e7t\ecos\packages\net\tcpip\current\src\sys\net\if_bridge.c
(1463):
	u_int32_t a = 0x9e3779b9, b = 0x9e3779b9, c = 0xdeadbeef;
6 occurrence(s) have been found.

	

Fabrice


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [ECOS] uninitialized variable
@ 2001-09-07 13:10 Trenton D. Adams
  0 siblings, 0 replies; 2+ messages in thread
From: Trenton D. Adams @ 2001-09-07 13:10 UTC (permalink / raw)
  To: eCos Discussion

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 527 bytes --]

Is memory in eCos initialized to these values before it's used?  When I
didn't initialize this variable, it ended up being set to this value
which happened to be in memory at that location.

(gdb) print slot->attr
$1 = (unsigned char *) 0xdeadbeef "_\004 Bâ\004 Bä\001 Dä\001 Då\t"

Is this some sort of joke, or just a !TOTALLY random occurance?


Trenton D. Adams
Extreme Engineering
#17, 6025 - 12 St. SE
Calgary, Alberta, Canada
T2H 2K1

Phone: 403 640 9494 ext-208
Fax: 403 640 9599

http://www.extremeeng.com

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2001-09-07 17:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-09-07 17:55 [ECOS] uninitialized variable Fabrice Gautier
  -- strict thread matches above, loose matches on Subject: below --
2001-09-07 13:10 Trenton D. Adams

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).