Subject: re: SMP success
To: matthew green <mrg@eterna.com.au>
From: Hauke Fath <hauke@Espresso.Rhein-Neckar.DE>
List: port-sparc
Date: 01/06/2003 18:04:34
At 1:57 Uhr +1100 7.1.2003, matthew green wrote:
>
>   How would I proceed in gdb, since I do not get a core file? Is the kernel
>   linked for an absolute address?
>
>give the "call X from Y" numbers below, you can feed X and Y into
>gdb either via "list *X" or "disassemble X", which will show you
>source (-g kernels only) or assembly...

Nice!

I am inserting into the ctrace output what I got from a 'list *X' / 'list
*Y' for the first three stack levels. Sources are from a cvs update a few
hours ago.

Unfortunately, I cannot see any details about where on the bottom level (in
fdcattach_obio) the cpu was when the watchdog went off. The 'PC: f0004050'
appears to point into nowhere.

[...]
ms0 at zs1 channel 1: baud rate 1200
fdc0 at obio0 slot 0 offset 0x700000 level 11
Watchdog Reset
<#0> ok ctrace
PC: f0004050
Last leaf: jmpl  f01c155c    from f0132fe8
     0 w  %o0-%o5: ( f08bde80 f0906000 f024c5c0 f01c155c      f00 f0906100 )

--
(gdb) list *0xf01c155c
0xf01c155c is in fdcattach_obio (/usr/src/sys/arch/sparc/dev/fd.c:546).
541
542	void
543	fdcattach_obio(parent, self, aux)
544		struct device *parent, *self;
545		void *aux;
546	{
547		struct fdc_softc *fdc = (void *)self;
548		union obio_attach_args *uoba = aux;
549		struct sbus_attach_args *sa = &uoba->uoba_sbus;
550
--
(gdb) list *0xf0132fe8
0xf0132fe8 is in config_attach (/usr/src/sys/kern/subr_autoconf.c:827).
822			}
823		}
824	#ifdef __HAVE_DEVICE_REGISTER
825		device_register(dev, aux);
826	#endif
827		(*ca->ca_attach)(parent, dev, aux);
828		config_process_deferred(&deferred_config_queue, dev);
829		return (dev);
830	}
831
--

call f0132c24    from f0132a28
     1 w  %o0-%o5: ( f0906000 f024dcb4 f029e400 f025f800 f024c5c0 f01c7e00 )

--
(gdb) list *0xf0132c24
0xf0132c24 is in config_attach (/usr/src/sys/kern/subr_autoconf.c:707).
702	 * Attach a found device.  Allocates memory for device variables.
703	 */
704	struct device *
705	config_attach(struct device *parent, struct cfdata *cf, void *aux,
706		cfprint_t print)
707	{
708		struct device *dev;
709		struct cftable *ct;
710		struct cfdriver *cd;
711		struct cfattach *ca;
--
(gdb) list *0xf0132a28
0xf0132a28 is in config_found_sm (/usr/src/sys/kern/subr_autoconf.c:628).
623	    cfmatch_t submatch)
624	{
625		struct cfdata *cf;
626
627		if ((cf = config_search(submatch, parent, aux)) != NULL)
628			return (config_attach(parent, cf, aux, print));
629		if (print) {
630			if (config_do_twiddle)
631				twiddle();
632			aprint_normal("%s", msgs[(*print)(aux,
parent->dv_xname)]);
--

call f0132a04    from f01c8378
     2 w  %o0-%o5: ( f08bde80 f024c5c0 f01c7e00        0 f024c5c0        0 )

--
(gdb) list *0xf0132a04
0xf0132a04 is in config_found_sm (/usr/src/sys/kern/subr_autoconf.c:624).
619	 * not configured, call the given `print' function and return 0.
620	 */
621	struct device *
622	config_found_sm(struct device *parent, void *aux, cfprint_t print,
623	    cfmatch_t submatch)
624	{
625		struct cfdata *cf;
626
627		if ((cf = config_search(submatch, parent, aux)) != NULL)
628			return (config_attach(parent, cf, aux, print));
--

call f01c8174    from f01b5018
     3 w  %o0-%o5: ( f08bde80 f0226528        0 f0226544 f0254c00 f08b8f70 )

jmpl  f01b4fbc    from f0132fe8
     4 w  %o0-%o5: ( f092cfc0 f08bde80 f024c7e0 f01b4fbc      f00 f08bded0 )

call f0132c24    from f0132a28
     5 w  %o0-%o5: ( f08bde80 f024dcb4 f029e400 f025f800 f024c7e0 f01db030 )

call f0132a04    from f01db35c
     6 w  %o0-%o5: ( f092cfc0 f024c7e0 f01db030        0        0        0 )

jmpl  f0254f20    from f0132fe8
     7 w  %o0-%o5: ( f01db000 f092cfc0 f0254ee8 f0254f20 f022f800 f0254c00 )

call f0132c24    from f0132ad4
     8 w  %o0-%o5: ( f092cfc0 f024dcb4 f029e400 f025f800        0        0 )

call f0132a94    from f01daec0
     9 w  %o0-%o5: ( f022f988        0 f01e12d0        0      f00 f08b75c8 )

call f01dae80    from f01322bc
     a w  %o0-%o5: (        0 f025f800    40000 ffffffff        0 f0251800 )

call f0132280    from f0118db0
     b w  %o0-%o5: ( 10624dd3      54a     28db f0293000        0  4000000 )

call f0118994    from f0007594
     c w  %o0-%o5: ( f024dc00 f029e400 f0216400 f029b000 f0216400 f029f000 )

<#0> ok .registers
          %g0      %g1      %g2      %g3      %g4      %g5      %g6      %g7
            0 f024c318       68 f02a4c00        0 ffffffff f024aaf8        0
           PC      nPC        Y      PSR      WIM      TBR
     f0004050 f0004054  1c00000 40401fe4       10 f0004050
<#0> ok 0 .window
            0        1        2        3        4        5        6        7
IN:  f0906000 f024dcb4 f029e400 f025f800 f024c5c0 f01c7e00 f024c4f8 f0132a28
LOC: f0906000 f024d51c        2        3 f024c4e8 f0254674 f08bde80 f024fc00
OUT: f08bde80 f0906000 f024c5c0 f01c155c      f00 f0906100 f024c480 f0132fe8
<#0> ok 1 .window
            0        1        2        3        4        5        6        7
IN:  f08bde80 f024c5c0 f01c7e00        0 f024c5c0        0 f024c560 f01c8378
LOC:        2 f0230c00 f0254c00        2        0 f0002000        6        1
OUT: f0906000 f024dcb4 f029e400 f025f800 f024c5c0 f01c7e00 f024c4f8 f0132a28
<#0> ok 2 .window
            0        1        2        3        4        5        6        7
IN:  f08bde80 f0226528        0 f0226544 f0254c00 f08b8f70 f024c5f8 f01b5018
LOC: f024c5c0 f02860b8 ffd60f70 f092ce80 f01c7c00 f0229400 f0229400 f0229400
OUT: f08bde80 f024c5c0 f01c7e00        0 f024c5c0        0 f024c560 f01c8378
<#0> ok 3 .window
            0        1        2        3        4        5        6        7
IN:  f092cfc0 f08bde80 f024c7e0 f01b4fbc      f00 f08bded0 f024c660 f0132fe8
LOC: f01f6820 f02a535c f02a535c f0254c00 f0254c00       80        6 f0217f88
OUT: f08bde80 f0226528        0 f0226544 f0254c00 f08b8f70 f024c5f8 f01b5018
<#0>


-- Is there any way to find out where exactly in

(gdb) list fdcattach_obio
541
542	void
543	fdcattach_obio(parent, self, aux)
544		struct device *parent, *self;
545		void *aux;
546	{
547		struct fdc_softc *fdc = (void *)self;
548		union obio_attach_args *uoba = aux;
549		struct sbus_attach_args *sa = &uoba->uoba_sbus;
550
551		if (sa->sa_nintr == 0) {
552			printf(": no interrupt line configured\n");
553			return;
554		}
555
556		fdc->sc_bustag = sa->sa_bustag;
557
558		if (sbus_bus_map(sa->sa_bustag,
559				 sa->sa_slot, sa->sa_offset, sa->sa_size,
560				 BUS_SPACE_MAP_LINEAR, &fdc->sc_handle) != 0) {
561			printf("%s: cannot map control registers\n",
562				self->dv_xname);
563			return;
564		}
565
566		establish_chip_type(fdc,
567			sa->sa_bustag,
568			sbus_bus_addr(sa->sa_bustag, sa->sa_slot,
sa->sa_offset),
569			sa->sa_size,
570			fdc->sc_handle);
571
572		if (strcmp(PROM_getpropstring(sa->sa_node, "status"),
"disabled") == 0) {
573			printf(": no drives attached\n");
574			return;
575		}
576
577		if (fdcattach(fdc, sa->sa_pri) != 0)
578			bus_space_unmap(sa->sa_bustag, fdc->sc_handle,
sa->sa_size);
579	}
580

the watchdog interrupt hit?

	hauke



--
/~\  The ASCII Ribbon Campaign
\ /    No HTML/RTF in email
 X     No Word docs in email
/ \  Respect for open standards