This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


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

Re: [RFA] Assuming malloc exists in callfwmall.exp


[I thought about whether to reply to this ... I want to mention one data
 point, and that's all I will write].

Jim Blandy writes:
> Not if you link statically.

I did link statically.

  [chastain@delta chastain]$ cat bar.c
  main ()
  {
    write (1, "Howdy.\n", 7);
  }
  [chastain@delta chastain]$ gcc --version
  2.9-gnupro-99r1
  [chastain@delta chastain]$ gcc bar.c -o bar -g -static
  [chastain@delta chastain]$ gdb bar
  GNU gdb 4.18-gnupro-99r1
  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.  This version of GDB is supported
  for customers of Cygnus Solutions.  Type "show warranty" for details.
  This GDB was configured as "sparc-sun-solaris2.5"...
  (gdb) break main
  Breakpoint 1 at 0x101fc: file bar.c, line 3.
  (gdb) run
  Starting program: /home/chastain/bar 

  Breakpoint 1, main () at bar.c:3
  3         write (1, "Howdy.\n", 7);
  (gdb) write (1, "bye", 3);   
  Undefined command: "write".  Try "help".
  (gdb) call write (1, "bye", 3)
  bye$1 = 3
  (gdb) p malloc
  $2 = {<text variable, no debug info>} 0x140ac <malloc>

So malloc does get pulled in on my Solaris configuration.

Michael


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