Hackers,

first of all i want to apologize for posting this in -current.
this should probably go into -questions. 

i have some weird problem. i have cvsup'ed and installed -current
yesterday. i have attached script(1) output. quick search came up
with nothing.

did i miss anything?

thanks
max
Script started on Wed Oct 31 09:49:56 2001
beetle% uname -a
FreeBSD beetle 5.0-CURRENT FreeBSD 5.0-CURRENT #0: Tue Oct 30 13:23:19 PST 2001     
root@beetle:/usr/obj/usr/src/sys/BEETLE  i386
beetle% 
beetle% 
beetle% cat c2.sh
#!/bin/sh -x
gcc -v
ld -v
ar -V
rm a.out libtest.a lib.o
cat lib.c
cat prog1.c
gcc -Wall -g -c -o lib.o lib.c
ar cr libtest.a lib.o
gcc -Wall -g prog1.c -L. -ltest
./a.out
gdb a.out

beetle% 
beetle% 
beetle% ./c2.sh
+ gcc -v
Using builtin specs.
gcc version 2.95.3 20010315 (release)
+ ld -v
GNU ld version 2.11.2 20010719 [FreeBSD] (with BFD 2.11.2 20010719 [FreeBSD])
+ ar -V
GNU ar 2.11.2 20010719 [FreeBSD]
Copyright 1997, 98, 99, 2000, 2001 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License.  This program has absolutely no warranty.
+ rm a.out libtest.a lib.o
rm: libtest.a: No such file or directory
rm: lib.o: No such file or directory
+ cat lib.c
#include <stdio.h>

int
foo(int i, short s, char c, char *str)
{
        printf("%d, %d, %d, %s\n", i, s, c, str);
        return (0);
}
+ cat prog1.c
#include <stdio.h>

int     foo     (int, short, char, char *);

int
main(void)
{
        return (foo(1, 2, '3', "test"));
}

int
foo(int i, short s, char c, char *str)
{
        printf("%d, %d, %d, %s\n", i, s, c, str);
        return (0);
}

+ gcc -Wall -g -c -o lib.o lib.c
+ ar cr libtest.a lib.o
+ gcc -Wall -g prog1.c -L. -ltest
+ ./a.out
1, 2, 51, test
+ gdb a.out
GNU gdb 4.18
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 "i386-unknown-freebsd"...
(gdb) b main
Breakpoint 1 at 0x80484c6: file prog1.c, line 8.
(gdb) run
Starting program: /usr/home/max/test/a.out 

Breakpoint 1, main () at prog1.c:8
8               return (foo(1, 2, '3', "test"));
(gdb) s
foo (i=1, s=10244, c=-54 '', str=0x804855b "test") at prog1.c:13
13      {
(gdb) q
The program is running.  Exit anyway? (y or n) y
beetle% 
beetle% 
beetle% 
beetle% cat c1.sh
#!/bin/sh -x
gcc -v
ld -v
rm a.out
cat prog1.c
gcc -Wall -g prog1.c
./a.out
gdb a.out
beetle% 
beetle% 
beetle% ./c1.sh
+ gcc -v
Using builtin specs.
gcc version 2.95.3 20010315 (release)
+ ld -v
GNU ld version 2.11.2 20010719 [FreeBSD] (with BFD 2.11.2 20010719 [FreeBSD])
+ rm a.out
+ cat prog1.c
#include <stdio.h>

int     foo     (int, short, char, char *);

int
main(void)
{
        return (foo(1, 2, '3', "test"));
}

int
foo(int i, short s, char c, char *str)
{
        printf("%d, %d, %d, %s\n", i, s, c, str);
        return (0);
}

+ gcc -Wall -g prog1.c
+ ./a.out
1, 2, 51, test
+ gdb a.out
GNU gdb 4.18
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 "i386-unknown-freebsd"...
(gdb) b main
Breakpoint 1 at 0x80484c6: file prog1.c, line 8.
(gdb) run
Starting program: /usr/home/max/test/a.out 

Breakpoint 1, main () at prog1.c:8
8               return (foo(1, 2, '3', "test"));
(gdb) s
foo (i=1, s=10244, c=-54 '', str=0x804855b "test") at prog1.c:13
13      {
(gdb) q
The program is running.  Exit anyway? (y or n) y
beetle% exit

Script done on Wed Oct 31 09:50:49 2001

Reply via email to