Recent Posts
None | 24 sec ago
None | 26 sec ago
None | 30 sec ago
None | 32 sec ago
PHP | 35 sec ago
Bash | 37 sec ago
C | 43 sec ago
None | 49 sec ago
None | 1 min ago
None | 1 min ago
Sitereport
Find cool info about any domain on the internet?
visit sitereport
Free Subdomains
Want a pastebin.com sub-domain for your community?
learn more...
What is pastebin?
Pastebin is a website that hosts all your text & code on dedicated servers for easy sharing.
learn more...
Learn a little bit about the new Pastebin.com on our help page. hide message
By godrik on the 9th of Feb 2010 09:16:27 PM Download | Raw | Embed | Report
  1. erik@powell:/tmp$ cat test.c
  2. #include <math.h>
  3. #include <stdio.h>
  4. #include <string.h>
  5.  
  6. int main ()
  7. {
  8.   double (*fnct)(double);
  9.  
  10.   double i;
  11.   char buf[19];
  12.   scanf ("%p %lf %s", &fnct, &i, buf);
  13.   printf ("%lf %d\n",fnct(i), strlen(buf));
  14.   return 0;
  15. }
  16. erik@powell:/tmp$ gcc -lgsl -lm  -lgslcblas test.c -o test -g
  17. erik@powell:/tmp$ gdb test
  18. GNU gdb 6.8-debian
  19. Copyright (C) 2008 Free Software Foundation, Inc.
  20. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  21. This is free software: you are free to change and redistribute it.
  22. There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
  23. and "show warranty" for details.
  24. This GDB was configured as "x86_64-linux-gnu"...
  25. (gdb) b main
  26. Breakpoint 1 at 0x4006a5: file test.c, line 11.
  27. (gdb) r
  28. Starting program: /tmp/test
  29.  
  30. Breakpoint 1, main () at test.c:11
  31. 11        scanf ("%p %lf %s", &fnct, &i, buf);
  32. (gdb) p sqrt
  33. $1 = {<text variable, no debug info>} 0x7fa6075f3d50 <sqrt>
  34. (gdb) p sqrt(4)
  35. $2 = 0
  36. (gdb) set variable fnct=sqrt
  37. (gdb) set variable i=4
  38. (gdb) p fnct(i)
  39. $3 = 2
  40. erik@powell:/tmp$ gcc -v -lgsl -lm  -lgslcblas test.c -o test -g
  41. Using built-in specs.
  42. Target: x86_64-linux-gnu
  43. Configured with: ../src/configure -v --with-pkgversion='Debian 4.3.2-1.1' --with-bugurl=file:///usr/share/doc/gcc-4.3/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --with-gxx-include-dir=/usr/include/c++/4.3 --program-suffix=-4.3 --enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --enable-mpfr --enable-cld --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
  44. Thread model: posix
  45. gcc version 4.3.2 (Debian 4.3.2-1.1)
  46. COLLECT_GCC_OPTIONS='-v' '-o' 'test' '-g' '-mtune=generic'
  47.  /usr/lib/gcc/x86_64-linux-gnu/4.3.2/cc1 -quiet -v test.c -quiet -dumpbase test.c -mtune=generic -auxbase test -g -version -o /tmp/ccChhzYk.s
  48. ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu"
  49. ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/4.3.2/../../../../x86_64-linux-gnu/include"
  50. ignoring nonexistent directory "/usr/include/x86_64-linux-gnu"
  51. #include "..." search starts here:
  52. #include <...> search starts here:
  53.  /usr/local/include
  54.  /usr/lib/gcc/x86_64-linux-gnu/4.3.2/include
  55.  /usr/lib/gcc/x86_64-linux-gnu/4.3.2/include-fixed
  56.  /usr/include
  57. End of search list.
  58. GNU C (Debian 4.3.2-1.1) version 4.3.2 (x86_64-linux-gnu)
  59.         compiled by GNU C version 4.3.2, GMP version 4.2.2, MPFR version 2.3.2.
  60. warning: MPFR header version 2.3.2 differs from library version 2.3.1.
  61. GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
  62. Compiler executable checksum: 3741a6052d20b6389f93b1cc4a619780
  63. COLLECT_GCC_OPTIONS='-v' '-o' 'test' '-g' '-mtune=generic'
  64.  as -V -Qy -o /tmp/cca0LLSw.o /tmp/ccChhzYk.s
  65. GNU assembler version 2.18.0 (x86_64-linux-gnu) using BFD version (GNU Binutils for Debian) 2.18.0.20080103
  66. COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/4.3.2/:/usr/lib/gcc/x86_64-linux-gnu/4.3.2/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/4.3.2/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/4.3.2/:/usr/lib/gcc/x86_64-linux-gnu/
  67. LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/4.3.2/:/usr/lib/gcc/x86_64-linux-gnu/4.3.2/:/usr/lib/gcc/x86_64-linux-gnu/4.3.2/../../../../lib/:/lib/../lib/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/4.3.2/../../../:/lib/:/usr/lib/
  68. COLLECT_GCC_OPTIONS='-v' '-o' 'test' '-g' '-mtune=generic'
  69.  /usr/lib/gcc/x86_64-linux-gnu/4.3.2/collect2 --eh-frame-hdr -m elf_x86_64 --hash-style=both -dynamic-linker /lib64/ld-linux-x86-64.so.2 -o test /usr/lib/gcc/x86_64-linux-gnu/4.3.2/../../../../lib/crt1.o /usr/lib/gcc/x86_64-linux-gnu/4.3.2/../../../../lib/crti.o /usr/lib/gcc/x86_64-linux-gnu/4.3.2/crtbegin.o -L/usr/lib/gcc/x86_64-linux-gnu/4.3.2 -L/usr/lib/gcc/x86_64-linux-gnu/4.3.2 -L/usr/lib/gcc/x86_64-linux-gnu/4.3.2/../../../../lib -L/lib/../lib -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/4.3.2/../../.. -lgsl -lm -lgslcblas /tmp/cca0LLSw.o -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/gcc/x86_64-linux-gnu/4.3.2/crtend.o /usr/lib/gcc/x86_64-linux-gnu/4.3.2/../../../../lib/crtn.o
Submit a correction or amendment below. [ previous version ] | [ difference ] | Make A New Post
To highlight particular lines, prefix each line with @h@
Syntax highlighting:
Post expiration:
Post exposure:
Name / Title:
Email: