[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

DDD Breakpoints/Local variables



Hi,

I'm having trouble using DDD.  I want to simply add a breakpoint and view
a local variable afterwards.  I have compiled my C program with
egcs-2.91.66 with -g and -ggdb3 set.  I then load ddd, and set the
breakpoint by selecting a source line and selecting set breakpoint.  When
I hit run, I get the following output:

(gdb) run
Starting program: /home/griesbac/temp/src/bjsim/bjsim 
Breakpoint 1 at 0x823c07c: file bjsim.c, line 523.
Cannot insert breakpoint 1:
Cannot access memory at address 0x823c07c.
(gdb)

Also, after that, when I try to view a local variable, (decks), by double
clicking on the variable in the source code, I get:

(gdb) graph display decks
No symbol "decks" in current context.
(gdb) 

I also attached my ddd logfile to this email.

What am I doing wrong?  Any help here is appreciated.  Thanks in advance.

Jake Griesbach
University of Colorado at Boulder


DDD 3.1.4 (i686-pc-linux-gnu), Copyright (C) 1999 TU Braunschweig.
Compiled with GCC egcs-2.91.66 Debian GNU/Linux (egcs-1.1.2 release), GNU libc 2.1
Requires X11R6, Xt11R6, Motif 1.2 (GNU LessTif 0.88 0)
Includes DDD core, XPM 3.4.11, Athena Panner
Built 1999-04-11 by J.H.M. Dassen (Ray)  <jdassen@wi.LeidenUniv.nl>.
$  ddd bjsim
+  /bin/sh -c 'exec gdb -q -fullname '\''bjsim'\'''
#  Hello, world!
#  Opening session "11808abddf000092410846800000023700010"...
#  Enabling core dumps...
#  Enabling core dumps...done.
#  Running GDB (pid 4866, tty /dev/pts/2)...
#  Current language: c/c++
#  Creating "/home/griesbac/.ddd/sessions/11808abddf000092410846800000023700010/"...
#  Creating "/home/griesbac/.ddd/sessions/11808abddf000092410846800000023700010/"...done.
#  Copying "/home/griesbac/.ddd/init" to "/home/griesbac/.ddd/sessions/11808abddf000092410846800000023700010/init"...
#  Copying "/home/griesbac/.ddd/init" to "/home/griesbac/.ddd/sessions/11808abddf000092410846800000023700010/init"...done.
<- "(gdb) "
-> "set prompt (gdb) \n"
<- "(gdb) "
-> "set height 0\n"
<- "(gdb) "
-> "set width 0\n"
<- "(gdb) "
-> "set annotate 1\n"
<- "(gdb) "
-> " set verbose off\n"
<- "(gdb) "
-> "info line\n"
<- "No line number information available.\n"
<- "(gdb) "
-> "list\n"
<- "23\tunsigned int money[7] = {500,500,500,500,500,500,500};\n"
   "24\t\n"
   "25\t\n"
<- "26\tint main(void)\n"
   "27\t{\n"
   "28\t\tint *shoe;\n"
   "29\t\tchar *card;\n"
   "30\t\ttime_t tm;\n"
   "31\t\n"
<- "32\t\treadconfig();\t\t\t/* Read Conf. File */\n"
<- "(gdb) "
-> "info line\n"
<- "Line 32 of \"bjsim.c\" starts at address 0x8048a66 <main+6> and ends at 0x8048a6b <main+11>.\n"
   "\032\032/home/griesbac/temp/src/bjsim/bjsim.c:32:551:beg:0x8048a66\n"
<- "(gdb) "
-> "output 4711\n"
<- "4711"
<- "(gdb) "
-> "show language\n"
<- "The current source language is \"auto; currently c\".\n"
<- "(gdb) "
-> "pwd\n"
<- "Working directory /home/griesbac/temp/src/bjsim.\n"
<- "(gdb) "
-> "info breakpoints\n"
<- "No breakpoints or watchpoints.\n"
   "(gdb) "
-> "show history filename\n"
<- "The filename in which to record the command history is \"/home/griesbac/temp/src/bjsim/.gdb_history\".\n"
   "(gdb) "
-> "show history size\n"
<- "The size of the command history is 256.\n"
   "(gdb) "
#  Reading file "/home/griesbac/temp/src/bjsim/bjsim.c"...
#  Reading file "/home/griesbac/temp/src/bjsim/bjsim.c"...done.
#  File "/home/griesbac/temp/src/bjsim/bjsim.c" 536 lines, 13436 characters
#  Setting buttons...
#  Setting buttons...done.
-> "info files\n"
<- "Symbols from \"/home/griesbac/temp/src/bjsim/bjsim\".\n"
   "Local exec file:\n"
   "\t`/home/griesbac/temp/src/bjsim/bjsim\', file type elf32-i386.\n"
   "\tEntry point: 0x80489a0\n"
<- "\t0x080480f4 - 0x08048107 is .interp\n"
   "\t0x08048108 - 0x08048128 is .note.ABI-tag\n"
   "\t0x08048128 - 0x0804825c is .hash\n"
   "\t0x0804825c - 0x080484bc is .dynsym\n"
   "\t0x080484bc - 0x08048635 is .dynstr\n"
   "\t0x08048636 - 0x08048682 is .gnu.version\n"
   "\t0x08048684 - 0x080486b4 is .gnu.version_r\n"
<- "\t0x080486b4 - 0x080486bc is .rel.got\n"
   "\t0x080486bc - 0x080486c4 is .rel.bss\n"
   "\t0x080486c4 - 0x0804879c is .rel.plt\n"
   "\t0x080487a0 - 0x080487d1 is .init\n"
   "\t0x080487d4 - 0x08048994 is .plt\n"
   "\t0x080489a0 - 0x0804acb8 is .text\n"
   "\t0x0804acc0 - 0x0804acdc is .fini\n"
   "\t0x0804ace0 - 0x0804ae61 is .rodata\n"
   "\t0x0804be64 - 0x0804be8c is .data\n"
<- "\t0x0804be8c - 0x0804c0a8 is .eh_frame\n"
   "\t0x0804c0a8 - 0x0804c0b0 is .ctors\n"
   "\t0x0804c0b0 - 0x0804c0b8 is .dtors\n"
   "\t0x0804c0b8 - 0x0804c134 is .got\n"
   "\t0x0804c134 - 0x0804c1dc is .dynamic\n"
   "\t0x0804c1e0 - 0x0804c546 is .bss\n"
<- "(gdb) "
-> "info program\n"
<- "The program being debugged is not being run.\n"
<- "(gdb) "
-> "source /tmp/fileZLg4MA\n"
<- "(gdb) "
-> "info breakpoints\n"
<- "No breakpoints or watchpoints.\n"
   "(gdb) "
-> "# reset\n"
<- "(gdb) "
-> "info breakpoints\n"
<- "No breakpoints or watchpoints.\n"
   "(gdb) "
-> "display\n"
<- "(gdb) "
-> "info display\n"
<- "There are no auto-display expressions now.\n"
   "(gdb) "
-> "set environment TERM dumb\n"
<- "(gdb) "
-> "info files\n"
<- "Symbols from \"/home/griesbac/temp/src/bjsim/bjsim\".\n"
   "Local exec file:\n"
   "\t`/home/griesbac/temp/src/bjsim/bjsim\', file type elf32-i386.\n"
   "\tEntry point: 0x80489a0\n"
   "\t0x080480f4 - 0x08048107 is .interp\n"
   "\t0x08048108 - 0x08048128 is .note.ABI-tag\n"
   "\t0x08048128 - 0x0804825c is .hash\n"
   "\t0x0804825c - 0x080484bc is .dynsym\n"
   "\t0x080484bc - 0x08048635 is .dynstr\n"
   "\t0x08048636 - 0x08048682 is .gnu.version\n"
   "\t0x08048684 - 0x080486b4 is .gnu.version_r\n"
   "\t0x080486b4 - 0x080486bc is .rel.got\n"
   "\t0x080486bc - 0x080486c4 is .rel.bss\n"
   "\t0x080486c4 - 0x0804879c is .rel.plt\n"
   "\t0x080487a0 - 0x080487d1 is .init\n"
   "\t0x080487d4 - 0x08048994 is .plt\n"
<- "\t0x080489a0 - 0x0804acb8 is .text\n"
   "\t0x0804acc0 - 0x0804acdc is .fini\n"
   "\t0x0804ace0 - 0x0804ae61 is .rodata\n"
   "\t0x0804be64 - 0x0804be8c is .data\n"
   "\t0x0804be8c - 0x0804c0a8 is .eh_frame\n"
   "\t0x0804c0a8 - 0x0804c0b0 is .ctors\n"
   "\t0x0804c0b0 - 0x0804c0b8 is .dtors\n"
   "\t0x0804c0b8 - 0x0804c134 is .got\n"
   "\t0x0804c134 - 0x0804c1dc is .dynamic\n"
   "\t0x0804c1e0 - 0x0804c546 is .bss\n"
<- "(gdb) "
-> "info program\n"
<- "The program being debugged is not being run.\n"
<- "(gdb) "
-> "help detach\n"
<- "Detach a process or file previously attached.\n"
   "If a process, it is no longer traced, and it continues its execution.  If you\n"
   "were debugging a file, the file is closed and gdb no longer accesses it.\n"
   "(gdb) "
#  Opening session "11808abddf000092410846800000023700010"...done.
#  Welcome to DDD 3.1.4 "Travels" (i686-pc-linux-gnu)
-> "help run\n"
<- "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) "
-> "help step\n"
<- "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) "
-> "help stepi\n"
<- "Step one instruction exactly.\n"
   "Argument N means do this N times (or till program stops for another reason).\n"
   "(gdb) "
-> "help next\n"
<- "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) "
-> "help nexti\n"
<- "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) "
-> "help until\n"
<- "Execute until the program reaches a source line greater than the current\n"
   "or a specified line or address or function (same args as break command).\n"
   "Execution will also stop upon exit from the current stack frame.\n"
   "(gdb) "
-> "help finish\n"
<- "Execute until selected stack frame returns.\n"
   "Upon return, the value returned is printed and put in the value history.\n"
   "(gdb) "
-> "help cont\n"
<- "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"
   "(gdb) "
-> "help signal\n"
<- "Continue program giving it signal specified by the argument.\n"
   "An argument of \"0\" means continue program without giving it a signal.\n"
   "(gdb) "
-> "help kill\n"
<- "Kill execution of program being debugged.\n"
<- "(gdb) "
-> "help up\n"
<- "Select and print stack frame that called this one.\n"
   "An argument says how many frames up to go.\n"
<- "(gdb) "
-> "help down\n"
<- "Select and print stack frame called by this one.\n"
   "An argument says how many frames down to go.\n"
<- "(gdb) "
-> "info source\n"
<- "Current source file is bjsim.c\n"
   "Compilation directory is /home/griesbac/temp/src/bjsim\n"
   "Located in /home/griesbac/temp/src/bjsim/bjsim.c\n"
   "Contains 536 lines.\n"
   "Source language is c.\n"
   "Compiled with DWARF 2 debugging format.\n"
<- "(gdb) "
-> "break bjsim.c:523\n"
<- "Breakpoint 1 at 0xbffff678: file bjsim.c, line 523.\n"
<- "(gdb) "
-> "info breakpoints\n"
<- "Num Type           Disp Enb Address    What\n"
   "1   breakpoint     keep y   0xbffff678 bjsim.c:523\n"
<- "(gdb) "
-> "set environment TERM dumb\n"
<- "(gdb) "
-> "run\n"
<- "Starting program: /home/griesbac/temp/src/bjsim/bjsim \n"
<- "Breakpoint 1 at 0x823c07c: file bjsim.c, line 523.\n"
<- "Cannot insert breakpoint 1:\n"
<- "Cannot access memory at address 0x823c07c.\n"
<- "(gdb) "
-> "info breakpoints\n"
<- "Num Type           Disp Enb Address    What\n"
<- "1   breakpoint     keep y   0x0823c07c bjsim.c:523\n"
<- "(gdb) "
-> "output decks\n"
<- "No symbol \"decks\" in current context.\n"
<- "(gdb) "
-> "output cardv\n"
<- "No symbol \"cardv\" in current context.\n"
<- "(gdb) "
-> "frame\n"
<- "No selected frame.\n"
<- "(gdb) "
-> "display decks\n"
<- "No symbol \"decks\" in current context.\n"
<- "(gdb) "
!  No symbol "decks" in current context.
-> "quit\n"
<- "The program is running.  Exit anyway? (y or n) "
-> "yes\n"
#  Running GDB (pid 4866, tty /dev/pts/2)...Exit 0.
#  Saving history in "/home/griesbac/.ddd/sessions/11808abddf000092410846800000023700010/history"...
#  Saving history in "/home/griesbac/.ddd/sessions/11808abddf000092410846800000023700010/history"...done.
#  Thanks for using DDD 3.1.4!

Reply to: