GNU DDD 3.3.11 (x86_64-unknown-linux-gnu) Copyright (C) 1995-1999 Technische Universität Braunschweig, Germany. Copyright (C) 1999-2001 Universität Passau, Germany. Copyright (C) 2001 Universität des Saarlandes, Germany. Copyright (C) 2001-2004 Free Software Foundation, Inc. Compiled with GCC 4.1.2, GNU libc 2.3 Requires X11R6, Xt11R6, Motif 2.2.3 (Motif Version 2.2.3) Includes XPM 3.4.11, Athena Panner (7000002L), DDD core Built 2007-09-28 by matrix . $ ddd a.out + /bin/sh -c 'exec gdb -q -fullname '\''a.out'\''' # Hello, world! # Starting GDB... # Enabling line numbers... # Enabling line numbers...done. # Enabling core dumps... # Enabling core dumps...done. # Running GDB (pid 15951, tty /dev/pts/93)... # Current language: C/C++ # Searching "vsllib/ddd.vsl"... # Trying "/home/harshitm/.ddd/vsllib/ddd.vsl" # Trying "/grid/common/pkgs/ddd/v3.3.11/share/ddd-3.3.11/vsllib/ddd.vsl" # Searching "vsllib/ddd.vsl"..."/grid/common/pkgs/ddd/v3.3.11/share/ddd-3.3.11/vsllib/ddd.vsl". 2019.03.06 11:47:02 <- "Reading symbols from /home/harshitm/har_prg/c/a.out...done.\n" "(gdb) " 2019.03.06 11:47:02 -> "set prompt (gdb) \n" 2019.03.06 11:47:02 <- "(gdb) " 2019.03.06 11:47:02 -> "set height 0\n" 2019.03.06 11:47:02 <- "(gdb) " 2019.03.06 11:47:02 -> "set width 0\n" 2019.03.06 11:47:02 <- "(gdb) " 2019.03.06 11:47:02 -> "set annotate 1\n" 2019.03.06 11:47:02 <- "(gdb) " 2019.03.06 11:47:02 -> " set verbose off\n" 2019.03.06 11:47:02 <- "(gdb) " 2019.03.06 11:47:02 -> "info line\n" 2019.03.06 11:47:02 <- "No line number information available.\n" "(gdb) " 2019.03.06 11:47:02 -> "list\n" 2019.03.06 11:47:02 <- "1\t#include\n" "2\t#include\n" "3\t#define I_SHIFT (sizeof(short) * CHAR_BIT)\n" "4\t#define I_RADIX ((unsigned long)(1L << I_SHIFT))\n" "5\t#define I_MAXNUM ((unsigned long)((I_RADIX - 1)))\n" "6\t#define MAXIntRep_SIZE I_MAXNUM\n" "7\tint main()\n" "8\t{\n" "9\t\tprintf(\"%d : this \\n" "\",MAXIntRep_SIZE);\n" "10\t\tprintf(\"%d : this \\n" "\",I_MAXNUM);\n" 2019.03.06 11:47:02 <- "(gdb) " 2019.03.06 11:47:02 -> "info line\n" 2019.03.06 11:47:02 <- "Line 10 of \"test.c\" starts at address 0x4004bf and ends at 0x4004d6 .\n" "\032\032/home/harshitm/har_prg/c/test.c:10:289:beg:0x4004bf\n" 2019.03.06 11:47:02 <- "(gdb) " 2019.03.06 11:47:02 -> "output 4711\n" 2019.03.06 11:47:02 <- "4711" 2019.03.06 11:47:02 <- "(gdb) " 2019.03.06 11:47:02 -> "show language\n" 2019.03.06 11:47:02 <- "The current source language is \"auto; currently c\".\n" 2019.03.06 11:47:02 <- "(gdb) " 2019.03.06 11:47:02 -> "show version\n" 2019.03.06 11:47:02 <- "GNU gdb (GDB) 7.4\n" "Copyright (C) 2012 Free Software Foundation, Inc.\n" "License GPLv3+: GNU GPL version 3 or later \n" "This is free software: you are free to change and redistribute it.\n" "There is NO WARRANTY, to the extent permitted by law. Type \"show copying\"\n" "and \"show warranty\" for details.\n" "This GDB was configured as \"x86_64-unknown-linux-gnu\".\n" "For bug reporting instructions, please see:\n" ".\n" 2019.03.06 11:47:02 <- "(gdb) " 2019.03.06 11:47:02 -> "pwd\n" 2019.03.06 11:47:02 <- "Working directory /home/harshitm/har_prg/c.\n" 2019.03.06 11:47:02 <- "(gdb) " 2019.03.06 11:47:02 -> "info breakpoints\n" 2019.03.06 11:47:02 <- "No breakpoints or watchpoints.\n" 2019.03.06 11:47:02 <- "(gdb) " 2019.03.06 11:47:02 -> "show history filename\n" 2019.03.06 11:47:02 <- "The filename in which to record the command history is \"/home/harshitm/har_prg/c/.gdb_history\".\n" 2019.03.06 11:47:02 <- "(gdb) " 2019.03.06 11:47:02 -> "show history size\n" 2019.03.06 11:47:02 <- "The size of the command history is 256.\n" 2019.03.06 11:47:02 <- "(gdb) " # Reading file "/home/harshitm/har_prg/c/test.c"... # Reading file "/home/harshitm/har_prg/c/test.c"...done. # File "/home/harshitm/har_prg/c/test.c" 15 lines, 553 characters # Setting buttons... # Setting buttons...done. 2019.03.06 11:47:03 -> "set confirm off\n" # Disassembling location 0x4004bf to 0x4005bf... 2019.03.06 11:47:03 <- "(gdb) " 2019.03.06 11:47:03 -> "disassemble 0x4004bf 0x4005bf\n" 2019.03.06 11:47:03 <- "A syntax error in expression, near `0x4005bf\'.\n" 2019.03.06 11:47:03 <- "(gdb) " # Disassembling location 0x4004bf to 0x4005bf...done. 2019.03.06 11:47:03 -> "source /tmp/dddb7Ug6M\n" 2019.03.06 11:47:03 <- "(gdb) " 2019.03.06 11:47:03 -> "info breakpoints\n" 2019.03.06 11:47:03 <- "No breakpoints or watchpoints.\n" "(gdb) " 2019.03.06 11:47:03 -> "info source\n" 2019.03.06 11:47:03 <- "Current source file is test.c\n" "Compilation directory is /home/harshitm/har_prg/c\n" "Located in /home/harshitm/har_prg/c/test.c\n" "Contains 15 lines.\n" "Source language is c.\n" "Compiled with DWARF 2 debugging format.\n" "Does not include preprocessor macro info.\n" 2019.03.06 11:47:03 <- "(gdb) " 2019.03.06 11:47:03 -> "# reset\n" 2019.03.06 11:47:03 <- "(gdb) " 2019.03.06 11:47:03 -> "info breakpoints\n" 2019.03.06 11:47:03 <- "No breakpoints or watchpoints.\n" 2019.03.06 11:47:03 <- "(gdb) " 2019.03.06 11:47:03 -> "display\n" 2019.03.06 11:47:03 <- "(gdb) " 2019.03.06 11:47:03 -> "info display\n" 2019.03.06 11:47:03 <- "There are no auto-display expressions now.\n" 2019.03.06 11:47:03 <- "(gdb) " 2019.03.06 11:47:03 -> "set environment TERM dumb\n" 2019.03.06 11:47:03 <- "(gdb) " 2019.03.06 11:47:03 -> "info files\n" 2019.03.06 11:47:03 <- "Symbols from \"/home/harshitm/har_prg/c/a.out\".\n" "Local exec file:\n" 2019.03.06 11:47:03 <- "\t`/home/harshitm/har_prg/c/a.out\', file type elf64-x86-64.\n" "\tEntry point: 0x4003c0\n" "\t0x0000000000400200 - 0x000000000040021c is .interp\n" "\t0x000000000040021c - 0x000000000040023c is .note.ABI-tag\n" "\t0x0000000000400240 - 0x0000000000400264 is .hash\n" "\t0x0000000000400268 - 0x00000000004002c8 is .dynsym\n" "\t0x00000000004002c8 - 0x0000000000400307 is .dynstr\n" "\t0x0000000000400308 - 0x0000000000400310 is .gnu.version\n" "\t0x0000000000400310 - 0x0000000000400330 is .gnu.version_r\n" "\t0x0000000000400330 - 0x0000000000400348 is .rela.dyn\n" "\t0x0000000000400348 - 0x0000000000400378 is .rela.plt\n" "\t0x0000000000400378 - 0x0000000000400390 is .init\n" "\t0x0000000000400390 - 0x00000000004003c0 is .plt\n" "\t0x00000000004003c0 - 0x0000000000400608 is .text\n" "\t0x0000000000400608 - 0x0000000000400616 is .fini\n" "\t0x0000000000400618 - 0x0000000000400634 is .rodata\n" "\t0x0000000000400634 - 0x0000000000400658 is .eh_frame_hdr\n" "\t0x0000000000400658 - 0x00000000004006d4 is .eh_frame\n" "\t0x00000000006006d8 - 0x00000000006006e8 is .ctors\n" "\t0x00000000006006e8 - 0x00000000006006f8 is .dtors\n" "\t0x00000000006006f8 - 0x0000000000600700 is .jcr\n" "\t0x0000000000600700 - 0x0000000000600890 is .dynamic\n" "\t0x0000000000600890 - 0x0000000000600898 is .got\n" "\t0x0000000000600898 - 0x00000000006008c0 is .got.plt\n" "\t0x00000000006008c0 - 0x00000000006008c4 is .data\n" "\t0x00000000006008c8 - 0x00000000006008d8 is .bss\n" 2019.03.06 11:47:03 <- "(gdb) " 2019.03.06 11:47:03 -> "info program\n" 2019.03.06 11:47:03 <- "The program being debugged is not being run.\n" 2019.03.06 11:47:03 <- "(gdb) " # Starting GDB...done. # Welcome to DDD 3.3.11 "Rhubarb" (x86_64-unknown-linux-gnu) 2019.03.06 11:47:03 -> "help detach\n" 2019.03.06 11:47:03 <- "Detach a process or file previously attached.\n" "If a process, it is no longer traced, and it continues its execution. If\n" "you were debugging a file, the file is closed and gdb no longer accesses it.\n" "\n" "List of detach subcommands:\n" "\n" "detach checkpoint -- Detach from a checkpoint (experimental)\n" "detach inferiors -- Detach from inferior ID (or list of IDS)\n" "\n" "Type \"help detach\" followed by detach subcommand name for full documentation.\n" "Type \"apropos word\" to search for commands related to \"word\".\n" "Command name abbreviations are allowed if unambiguous.\n" "(gdb) " 2019.03.06 11:47:03 -> "help run\n" 2019.03.06 11:47:03 <- "Start debugged program. You may specify arguments to give it.\n" "Args may include \"*\", or \"[...]\"; they are expanded using \"sh\".\n" "Input and output redirection with \">\", \"<\", or \">>\" are also allowed.\n" "\n" "With no arguments, uses arguments last specified (with \"run\" or \"set args\").\n" "To cancel previous arguments and run with no arguments,\n" "use \"set args\" without arguments.\n" "(gdb) " 2019.03.06 11:47:03 -> "help step\n" 2019.03.06 11:47:03 <- "Step program until it reaches a different source line.\n" "Argument N means do this N times (or till program stops for another reason).\n" "(gdb) " 2019.03.06 11:47:03 -> "help stepi\n" 2019.03.06 11:47:03 <- "Step one instruction exactly.\n" "Argument N means do this N times (or till program stops for another reason).\n" "(gdb) " 2019.03.06 11:47:03 -> "help next\n" 2019.03.06 11:47:03 <- "Step program, proceeding through subroutine calls.\n" "Like the \"step\" command as long as subroutine calls do not happen;\n" "when they do, the call is treated as one instruction.\n" "Argument N means do this N times (or till program stops for another reason).\n" "(gdb) " 2019.03.06 11:47:03 -> "help nexti\n" 2019.03.06 11:47:03 <- "Step one instruction, but proceed through subroutine calls.\n" "Argument N means do this N times (or till program stops for another reason).\n" "(gdb) " 2019.03.06 11:47:03 -> "help until\n" 2019.03.06 11:47:03 <- "Execute until the program reaches a source line greater than the current\n" "or a specified location (same args as break command) within the current frame.\n" "(gdb) " 2019.03.06 11:47:03 -> "help finish\n" 2019.03.06 11:47:03 <- "Execute until selected stack frame returns.\n" "Upon return, the value returned is printed and put in the value history.\n" "(gdb) " 2019.03.06 11:47:03 -> "help cont\n" 2019.03.06 11:47:03 <- "Continue program being debugged, after signal or breakpoint.\n" "If proceeding from breakpoint, a number N may be used as an argument,\n" "which means to set the ignore count of that breakpoint to N - 1 (so that\n" "the breakpoint won\'t break until the Nth time it is reached).\n" "\n" "If non-stop mode is enabled, continue only the current thread,\n" "otherwise all the threads in the program are continued. To \n" "continue all stopped threads in non-stop mode, use the -a option.\n" "Specifying -a and an ignore count simultaneously is an error.\n" "(gdb) " 2019.03.06 11:47:03 -> "help signal\n" 2019.03.06 11:47:03 <- "Continue program giving it signal specified by the argument.\n" "An argument of \"0\" means continue program without giving it a signal.\n" "(gdb) " 2019.03.06 11:47:03 -> "help kill\n" 2019.03.06 11:47:03 <- "Kill execution of program being debugged.\n" "\n" "List of kill subcommands:\n" "\n" "kill inferiors -- Kill inferior ID (or list of IDs)\n" "\n" "Type \"help kill\" followed by kill subcommand name for full documentation.\n" "Type \"apropos word\" to search for commands related to \"word\".\n" "Command name abbreviations are allowed if unambiguous.\n" "(gdb) " 2019.03.06 11:47:03 -> "help up\n" 2019.03.06 11:47:04 <- "Select and print stack frame that called this one.\n" "An argument says how many frames up to go.\n" "(gdb) " 2019.03.06 11:47:04 -> "help down\n" 2019.03.06 11:47:04 <- "Select and print stack frame called by this one.\n" "An argument says how many frames down to go.\n" "(gdb) " 2019.03.06 11:47:11 -> "b main\n" 2019.03.06 11:47:11 <- "Breakpoint 1 at 0x4004a8: file test.c, line 9.\n" "(gdb) " 2019.03.06 11:47:11 -> "info breakpoints\n" 2019.03.06 11:47:11 <- "Num Type Disp Enb Address What\n" "1 breakpoint keep y 0x00000000004004a8 in main at test.c:9\n" "(gdb) " 2019.03.06 11:47:30 -> "set environment TERM dumb\n" 2019.03.06 11:47:30 <- "(gdb) " 2019.03.06 11:47:30 -> "run\n" 2019.03.06 11:47:30 <- "\n" "Breakpoint 1, main () at test.c:9\n" "\032\032/home/harshitm/har_prg/c/test.c:9:249:beg:0x4004a8\n" "(gdb) " 2019.03.06 11:47:30 -> "info breakpoints\n" 2019.03.06 11:47:30 <- "Num Type Disp Enb Address What\n" "1 breakpoint keep y 0x00000000004004a8 in main at test.c:9\n" "\tbreakpoint already hit 1 time\n" "(gdb) " 2019.03.06 11:47:30 -> "x /i 0x4004a8\n" 2019.03.06 11:47:30 <- "=> 0x4004a8 :\tmov $0x400628,%eax\n" "(gdb) " 2019.03.06 11:47:30 -> "x /i 0x4005a4\n" 2019.03.06 11:47:30 <- " 0x4005a4 <__libc_csu_init+100>:\tjb 0x400590 <__libc_csu_init+80>\n" "(gdb) " # Disassembling location 0x4004a8... 2019.03.06 11:47:30 -> "disassemble 0x4004a8\n" 2019.03.06 11:47:31 <- "Dump of assembler code for function main:\n" " 0x00000000004004a4 <+0>:\tpush %rbp\n" " 0x00000000004004a5 <+1>:\tmov %rsp,%rbp\n" "=> 0x00000000004004a8 <+4>:\tmov $0x400628,%eax\n" " 0x00000000004004ad <+9>:\tmov $0xffff,%esi\n" " 0x00000000004004b2 <+14>:\tmov %rax,%rdi\n" " 0x00000000004004b5 <+17>:\tmov $0x0,%eax\n" " 0x00000000004004ba <+22>:\tcallq 0x4003a0 \n" " 0x00000000004004bf <+27>:\tmov $0x400628,%eax\n" " 0x00000000004004c4 <+32>:\tmov $0xffff,%esi\n" " 0x00000000004004c9 <+37>:\tmov %rax,%rdi\n" " 0x00000000004004cc <+40>:\tmov $0x0,%eax\n" " 0x00000000004004d1 <+45>:\tcallq 0x4003a0 \n" " 0x00000000004004d6 <+50>:\tmov $0x400628,%eax\n" " 0x00000000004004db <+55>:\tmov $0x10000,%esi\n" " 0x00000000004004e0 <+60>:\tmov %rax,%rdi\n" " 0x00000000004004e3 <+63>:\tmov $0x0,%eax\n" " 0x00000000004004e8 <+68>:\tcallq 0x4003a0 \n" " 0x00000000004004ed <+73>:\tmov $0x400628,%eax\n" " 0x00000000004004f2 <+78>:\tmov $0x10,%esi\n" " 0x00000000004004f7 <+83>:\tmov %rax,%rdi\n" " 0x00000000004004fa <+86>:\tmov $0x0,%eax\n" " 0x00000000004004ff <+91>:\tcallq 0x4003a0 \n" " 0x0000000000400504 <+96>:\tmov $0x400628,%eax\n" " 0x0000000000400509 <+101>:\tmov $0x8,%esi\n" " 0x000000000040050e <+106>:\tmov %rax,%rdi\n" " 0x0000000000400511 <+109>:\tmov $0x0,%eax\n" " 0x0000000000400516 <+114>:\tcallq 0x4003a0 \n" " 0x000000000040051b <+119>:\tmov $0x0,%eax\n" " 0x0000000000400520 <+124>:\tleaveq \n" " 0x0000000000400521 <+125>:\tretq \n" "End of assembler dump.\n" "(gdb) " # Disassembling location 0x4004a8...done. 2019.03.06 11:47:58 -> "output mov\n" 2019.03.06 11:47:58 <- "No symbol \"mov\" in current context.\n" "(gdb) " 2019.03.06 11:47:58 -> "output $mov\n" 2019.03.06 11:47:58 <- "void(gdb) " 2019.03.06 11:48:00 -> "output $0xffff\n" 2019.03.06 11:48:00 <- "void(gdb) " 2019.03.06 11:48:28 -> "output esi\n" 2019.03.06 11:48:28 <- "No symbol \"esi\" in current context.\n" "(gdb) " 2019.03.06 11:48:28 -> "output $esi\n" 2019.03.06 11:48:28 <- "-7064(gdb) " 2019.03.06 11:48:28 -> "output /x $esi\n" 2019.03.06 11:48:28 <- "0xffffe468(gdb) " 2019.03.06 11:49:32 -> "s\n" 2019.03.06 11:49:32 <- "65535 : this \n" "\032\032/home/harshitm/har_prg/c/test.c:10:289:beg:0x4004bf\n" "(gdb) " 2019.03.06 11:49:32 -> "info breakpoints\n" 2019.03.06 11:49:32 <- "Num Type Disp Enb Address What\n" "1 breakpoint keep y 0x00000000004004a8 in main at test.c:9\n" "\tbreakpoint already hit 1 time\n" "(gdb) " # Retrieving Command Definitions... 2019.03.06 11:50:03 -> "help user-defined\n" 2019.03.06 11:50:03 <- "User-defined commands.\n" "The commands in this class are those defined by the user.\n" "Use the \"define\" command to define a command.\n" "\n" "List of commands:\n" "\n" "\n" "Type \"help\" followed by command name for full documentation.\n" "Type \"apropos word\" to search for commands related to \"word\".\n" "Command name abbreviations are allowed if unambiguous.\n" "(gdb) " # Retrieving Command Definitions...done. 2019.03.06 11:50:03 -> "python\n" 2019.03.06 11:50:03 <- ">" 2019.03.06 11:50:07 -> "import gdb\n" 2019.03.06 11:50:07 <- ">" 2019.03.06 11:50:28 -> "gdb.execute(\"step\")\n" 2019.03.06 11:50:28 <- ">" 2019.03.06 11:50:30 -> "end\n" 2019.03.06 11:50:30 <- "65535 : this \n" "\032\032/home/harshitm/har_prg/c/test.c:11:323:beg:0x4004d6\n" "(gdb) " 2019.03.06 11:50:30 -> "info breakpoints\n" 2019.03.06 11:50:30 <- "Num Type Disp Enb Address What\n" "1 breakpoint keep y 0x00000000004004a8 in main at test.c:9\n" "\tbreakpoint already hit 1 time\n" "(gdb) " 2019.03.06 11:50:49 -> "where\n" 2019.03.06 11:50:49 <- "#0 main () at test.c:11\n" "(gdb) " 2019.03.06 11:50:56 -> "output I_MAXNUM\n" 2019.03.06 11:50:56 <- "No symbol \"I_MAXNUM\" in current context.\n" "(gdb) " 2019.03.06 11:51:36 -> "step\n" 2019.03.06 11:51:36 <- "65536 : this \n" "\032\032/home/harshitm/har_prg/c/test.c:12:356:beg:0x4004ed\n" "(gdb) " 2019.03.06 11:51:36 -> "info breakpoints\n" 2019.03.06 11:51:36 <- "Num Type Disp Enb Address What\n" "1 breakpoint keep y 0x00000000004004a8 in main at test.c:9\n" "\tbreakpoint already hit 1 time\n" "(gdb) " 2019.03.06 11:51:41 -> "where\n" 2019.03.06 11:51:41 <- "#0 main () at test.c:12\n" "(gdb) " 2019.03.06 11:53:20 -> "c\n" 2019.03.06 11:53:20 <- "16 : this \n" "8 : this \n" "[Inferior 1 (process 16109) exited normally]\n" "(gdb) " 2019.03.06 11:53:20 -> "info breakpoints\n" 2019.03.06 11:53:20 <- "Num Type Disp Enb Address What\n" "1 breakpoint keep y 0x00000000004004a8 in main at test.c:9\n" "\tbreakpoint already hit 1 time\n" "(gdb) " 2019.03.06 11:53:25 -> "quit\n" # Running GDB (pid 15951, tty /dev/pts/93)...Exit 0. # Saving options in "/home/harshitm/.ddd/init"... # Saving options in "/home/harshitm/.ddd/init"...done. # Saving history in "/home/harshitm/.ddd/history"... # Saving history in "/home/harshitm/.ddd/history"...done. # Thanks for using DDD 3.3.11!