
{"id":14268,"date":"2013-10-04T16:47:37","date_gmt":"2013-10-04T16:47:37","guid":{"rendered":"http:\/\/www.beautifulwork.org\/?p=14268"},"modified":"2013-10-04T16:47:37","modified_gmt":"2013-10-04T16:47:37","slug":"gnu-grep-debug","status":"publish","type":"post","link":"https:\/\/www.trueangle.org\/index.php\/2013\/10\/04\/gnu-grep-debug\/","title":{"rendered":"GNU grep Debug"},"content":{"rendered":"<h4><u>commandline session<\/u><\/h4>\n<pre>\n$gdb grep\nGNU gdb (GDB) 7.4.1-debian\nCopyright (C) 2012 Free Software Foundation, Inc.\nLicense GPLv3+: GNU GPL version 3 or later \nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law.  Type \"show copying\"\nand \"show warranty\" for details.\nThis GDB was configured as \"x86_64-linux-gnu\".\nFor bug reporting instructions, please see:\n...\nReading symbols from \/home\/jeffrin\/GNUgrep\/grep-2.0\/grep...done.\n(gdb) break 1\nBreakpoint 1 at 0x401595: file grep.c, line 1.\n(gdb) r errno  grep.c\nStarting program: \/home\/jeffrin\/GNUgrep\/grep-2.0\/grep errno  grep.c\nwarning: no loadable sections found in added symbol-file system-supplied DSO at 0x7ffff7ffa000\nwarning: Could not load shared library symbols for linux-vdso.so.1.\nDo you need \"set solib-search-path\" or \"set sysroot\"?\n#include \n#ifndef errno\nextern int errno;\n\t\t  strerror(errno));\n    error(\"writing output\", errno);\n\t  error(filename, errno);\n\t  fatal(optarg, errno);\n\t      error(argv[optind], errno);\n[Inferior 1 (process 29324) exited normally]\n(gdb) start\nTemporary breakpoint 2 at 0x401f99: file grep.c, line 600.\nStarting program: \/home\/jeffrin\/GNUgrep\/grep-2.0\/grep errno  grep.c\nwarning: Could not load shared library symbols for linux-vdso.so.1.\nDo you need \"set solib-search-path\" or \"set sysroot\"?\n\nTemporary breakpoint 2, main (argc=3, argv=0x7fffffffe8d8) at grep.c:600\n600\t{\n(gdb) bt\n#0  main (argc=3, argv=0x7fffffffe8d8) at grep.c:600\n(gdb) break 1\nNote: breakpoint 1 also set at pc 0x401595.\nBreakpoint 3 at 0x401595: file grep.c, line 1.\n(gdb) start\nThe program being debugged has been started already.\nStart it from the beginning? (y or n) y\nTemporary breakpoint 4 at 0x401f99: file grep.c, line 600.\nStarting program: \/home\/jeffrin\/GNUgrep\/grep-2.0\/grep errno  grep.c\nwarning: no loadable sections found in added symbol-file system-supplied DSO at 0x7ffff7ffa000\nwarning: Could not load shared library symbols for linux-vdso.so.1.\nDo you need \"set solib-search-path\" or \"set sysroot\"?\n\nTemporary breakpoint 4, main (argc=3, argv=0x7fffffffe8d8) at grep.c:600\n600\t{\n(gdb) l\n595\n596\tint\n597\tmain(argc, argv)\n598\t     int argc;\n599\t     char *argv[];\n600\t{\n601\t  char *keys;\n602\t  size_t keycc, oldcc, keyalloc;\n603\t  int keyfound, count_matches, no_filenames, list_files, suppress_errors;\n604\t  int opt, cc, desc, count, status;\n(gdb) call memchar\nNo symbol \"memchar\" in current context.\n(gdb) next\n609\t  prog = argv[0];\n(gdb) l\n604\t  int opt, cc, desc, count, status;\n605\t  FILE *fp;\n606\t  extern char *optarg;\n607\t  extern int optind;\n608\n609\t  prog = argv[0];\n610\t  if (prog &amp;&amp; strrchr(prog, '\/'))\n611\t    prog = strrchr(prog, '\/') + 1;\n612\n613\t  keys = NULL;\n(gdb) bt\n#0  main (argc=3, argv=0x7fffffffe8d8) at grep.c:609\n(gdb) break 82\nNote: breakpoints 1 and 3 also set at pc 0x401595.\nBreakpoint 5 at 0x401595: file grep.c, line 82.\n(gdb) continue\nContinuing.\n#include \n#ifndef errno\nextern int errno;\n\t\t  strerror(errno));\n    error(\"writing output\", errno);\n\t  error(filename, errno);\n\t  fatal(optarg, errno);\n\t      error(argv[optind], errno);\n[Inferior 1 (process 30092) exited normally]\n(gdb)\n\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>commandline session $gdb grep GNU gdb (GDB) 7.4.1-debian Copyright (C) 2012 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type &#8220;show copying&#8221; and &#8220;show warranty&#8221; for details. This GDB &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.trueangle.org\/index.php\/2013\/10\/04\/gnu-grep-debug\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;GNU grep Debug&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[83],"tags":[639,811,840],"_links":{"self":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/posts\/14268"}],"collection":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/comments?post=14268"}],"version-history":[{"count":0,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/posts\/14268\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/media?parent=14268"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/categories?post=14268"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/tags?post=14268"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}