This is the mail archive of the libc-hacker@sourceware.cygnus.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: glibc-2.0.93 homebrew distribution tests


05/20/98 @ 06:14:58 PM (Wednesday)

[me]
>  ...  That is how I tracked it to strtok().  I want to chase it
>  farther, but I have to have debugging info left in glibc to do it.

  Glibc still isn't finished rebuilding, but I tried coping a few
files over and running it on the x586.  It fails for a really simple
test program (included).

  It should, of course, output something like this:

	argc=3, list="a,b,c", sep=","
	tok="a"
	tok="b"
	tok="c"
								--- john
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Script started on Wed May 20 18:04:36 1998
root@lestat: ./gdb../a.out
GNU gdb 4.17
Copyright 1998 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or 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.
This GDB was configured as "i686-pc-linux-gnu"...
(gdb) run a,b,c ,
Starting program: /var/tmp/./a.out a,b,c ,
argc=3, list="a,b,c", sep=","

Program received signal SIGILL, Illegal instruction.
0x804ccb4 in strtok ()
(gdb) where
#0  0x804ccb4 in strtok ()
#1  0x0 in ?? ()
(gdb) break strtok
Breakpoint 1 at 0x804cc90
(gdb) run
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Starting program: /var/tmp/./a.out a,b,c ,
argc=3, list="a,b,c", sep=","

Breakpoint 1, 0x804cc90 in strtok ()
(gdb) where
#0  0x804cc90 in strtok ()
#1  0x80481cb in main (argc=3, argv=0xbffffca4) at asdf.c:21
#2  0x8048ce9 in __libc_start_main ()
(gdb) list asdf.c:21`
16		list =	argv[1];
17		sep =	argv[2];
18
19		(void) printf( "argc=%d, list=\"%s\", sep=\"%s\"\n", argc, list, sep );
20
21		for( tok = strtok( list, sep ); tok; tok = strtok( NULL, sep ) )
22			(void) printf( "tok=\"%s\"\n", tok );
23
24		return tok ? 1 : 0;
25		}
(gdb) step
Single stepping until exit from function strtok,
which has no line number information.

Program received signal SIGILL, Illegal instruction.
0x804ccb4 in strtok ()
(gdb) quit
The program is running.	 Exit anyway? (y or n) y
root@lestat: exit
exit

Script done on Wed May 20 18:05:49 1998
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
#include	<stdio.h>
#include	<string.h>

int main( argc, argv )
  register int	  argc;
  register char	**argv;
	{
	register char	*tok, *list, *sep;

	if (argc != 3)
		{
		(void) fprintf( stderr, "usage:  %s {list} {sep}\n", argv[0] );
		return 1;
		}

	list =	argv[1];
	sep =	argv[2];

	(void) printf( "argc=%d, list=\"%s\", sep=\"%s\"\n", argc, list, sep );

	for( tok = strtok( list, sep ); tok; tok = strtok( NULL, sep ) )
		(void) printf( "tok=\"%s\"\n", tok );

	return tok ? 1 : 0;
	}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]