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 "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
For bug reporting instructions, please see:
...
Reading symbols from /home/jeffrin/GNUgrep/grep-2.0/grep...done.
(gdb) break 1
Breakpoint 1 at 0x401595: file grep.c, line 1.
(gdb) r errno  grep.c
Starting program: /home/jeffrin/GNUgrep/grep-2.0/grep errno  grep.c
warning: no loadable sections found in added symbol-file system-supplied DSO at 0x7ffff7ffa000
warning: Could not load shared library symbols for linux-vdso.so.1.
Do you need "set solib-search-path" or "set sysroot"?
#include 
#ifndef errno
extern int errno;
		  strerror(errno));
    error("writing output", errno);
	  error(filename, errno);
	  fatal(optarg, errno);
	      error(argv[optind], errno);
[Inferior 1 (process 29324) exited normally]
(gdb) start
Temporary breakpoint 2 at 0x401f99: file grep.c, line 600.
Starting program: /home/jeffrin/GNUgrep/grep-2.0/grep errno  grep.c
warning: Could not load shared library symbols for linux-vdso.so.1.
Do you need "set solib-search-path" or "set sysroot"?

Temporary breakpoint 2, main (argc=3, argv=0x7fffffffe8d8) at grep.c:600
600	{
(gdb) bt
#0  main (argc=3, argv=0x7fffffffe8d8) at grep.c:600
(gdb) break 1
Note: breakpoint 1 also set at pc 0x401595.
Breakpoint 3 at 0x401595: file grep.c, line 1.
(gdb) start
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Temporary breakpoint 4 at 0x401f99: file grep.c, line 600.
Starting program: /home/jeffrin/GNUgrep/grep-2.0/grep errno  grep.c
warning: no loadable sections found in added symbol-file system-supplied DSO at 0x7ffff7ffa000
warning: Could not load shared library symbols for linux-vdso.so.1.
Do you need "set solib-search-path" or "set sysroot"?

Temporary breakpoint 4, main (argc=3, argv=0x7fffffffe8d8) at grep.c:600
600	{
(gdb) l
595
596	int
597	main(argc, argv)
598	     int argc;
599	     char *argv[];
600	{
601	  char *keys;
602	  size_t keycc, oldcc, keyalloc;
603	  int keyfound, count_matches, no_filenames, list_files, suppress_errors;
604	  int opt, cc, desc, count, status;
(gdb) call memchar
No symbol "memchar" in current context.
(gdb) next
609	  prog = argv[0];
(gdb) l
604	  int opt, cc, desc, count, status;
605	  FILE *fp;
606	  extern char *optarg;
607	  extern int optind;
608
609	  prog = argv[0];
610	  if (prog && strrchr(prog, '/'))
611	    prog = strrchr(prog, '/') + 1;
612
613	  keys = NULL;
(gdb) bt
#0  main (argc=3, argv=0x7fffffffe8d8) at grep.c:609
(gdb) break 82
Note: breakpoints 1 and 3 also set at pc 0x401595.
Breakpoint 5 at 0x401595: file grep.c, line 82.
(gdb) continue
Continuing.
#include 
#ifndef errno
extern int errno;
		  strerror(errno));
    error("writing output", errno);
	  error(filename, errno);
	  fatal(optarg, errno);
	      error(argv[optind], errno);
[Inferior 1 (process 30092) exited normally]
(gdb)

Copyright © 2009,  2010,  2011,  2012,  2013, 2014     BeautifulWork Project    e-mail:  ahiliation@yahoo.co.in
BeautifulWork Project comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law.