🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by "tpopovic.US2" Tue, 08 Aug 1989 01:09
GDB 3.2 - sequent symmetry port (part 2)
#228
Author: "tpopovic.US2"
Date: Tue, 08 Aug 1989 01:09
86 lines
2323 bytes
Here is a simple test file to show truncation problems in GDB 3.2
on the sequent symmetry port.

I have already submitted a very long session log describing this
problem and a couple of others...  This file should prove useful in
the isolation of this bug.




-thxs,
Tom Popovich                      (415) 598-8028
Oracle Corporation
20 Davis Drive
Belmont, CA 94002
..!{uunet|apple|pyramid|...}!oracle.com!tpopovic




---------------------cut here----------------------------------

/*g.c*/
char* lookup(char* );


main()
{
  char* cp;

  cp = lookup("ha ha");

  if (cp == (char*)0x12233)
    printf("It works\n");
  else
    printf("It did NOT work\n");

}


char* lookup(char* c)
{
  char* ret=(char*)0x12233;
  return ret;
}

/* GDB transcript:
Current directory is /baseqa/tpopovic/gnu/gcc-1.35/T/
GDB 3.2, Copyright (C) 1988 Free Software Foundation, Inc.
There is ABSOLUTELY NO WARRANTY for GDB; type "info warranty" for details.
GDB is free software and you are welcome to distribute copies of it
 under certain conditions; type "info copying" to see the conditions.
Reading symbol data from /baseqa/tpopovic/gnu/gcc-1.35/T/g...done.
Type "help" for a list of commands.
(gdb) b lookup
Function look* not defined.
(gdb) b lookup
Reading in symbols for g.c...done.
Breakpoint 1 at 0x1166: file g.c, line 21.
(gdb) run
Starting program: /baseqa/tpopovic/gnu/gcc-1.35/T/g 

Bpt 1, lookup (c=(char *) 0x10fc "ha ha") (g.c line 21)
(gdb) i lo
ret = (char *) 0x0

<step>

(gdb) i lo
ret = (char *) 0x12233 <Address 0x12233 out of bounds>

Run till exit from #0  lookup (c=(char *) 0x10fc "ha ha") (g.c line 22)
0x1130 in main (1, 1073736676, 1073736684) (g.c line 9)
Value returned is $1 = (char *) 0x2233 "\205\300t\t\203\275L\377\377\377\021|\a\2700"

<note the return value (0x2233)>

<step till end of pgm>

It works

<as expected>

(gdb) 
 */
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads