ddd
[Top][All Lists]
Advanced

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

Re: source file is not open


From: Lassi A. Tuura
Subject: Re: source file is not open
Date: Fri, 15 Feb 2002 09:50:06 +0100

Hi Oleg,

> Now, on CERN cluster, I am forced myself to open the source file:
> "File" => "Open Source"=>"Open".

Is your main in FORTRAN?  Gdb seems to have trouble understanding where
the main program is under Linux -- it thinks the one in the F77 runtime,
not the one in your program.  (With a little test program I get a nearly
empty source window that says in upper left corner "in main.c".)

I can't offer any solution to this -- perhaps someone else can help or
a search on google will help.  I know things work if you convert your
PROGRAM into SUBROUTINE and add a C or C++ main program, but that's a
kludge.

If anyone wants to debug this in DDD:
  $ cat foo.F
          PROGRAM FOO
          END
  $ g77 -g foo.F
  $ ddd a.out

I've attached .ddd/log from this session.

Hope this helps,
//lat
-- 
Where does the family start?  It starts with a young man falling
in love with a girl---no superior alternative has yet been found.
        --Winston Churchill
GNU DDD 3.1.90 (i686-pc-linux-gnu)
Copyright (C) 1999 Technische Universitaet Braunschweig, Germany.
Copyright (C) 1999 Universitaet Passau, Germany.
Compiled with GCC egcs-2.91.66 19990314/Linux (egcs-1.1.2 release), GNU libc 2.1
Requires X11R6, Xt11R6, Motif 1.2 (GNU/LessTif Version 1.2 Release 0.89.4)
Includes DDD core, Readline 2.2, Manual, App defaults, XPM 3.4.10, Athena Panner
Built 1999-12-10 by Philippe Defert CERN <address@hidden>.
$  ddd a.out
+  /bin/sh -c 'exec gdb -q -fullname '\''a.out'\'''
#  Hello, world!
#  Starting GDB...
#  Enabling core dumps...
#  Enabling core dumps...done.
#  Running GDB (pid 30088, tty /dev/pts/1)...
#  Current language: c/c++
<- "(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"
<- "46\tmain.c: No such file or directory.\n"
   "(gdb) "
-> "info line\n"
<- "Line number 0 is out of range for \"main.c\".\n"
   "(gdb) "
-> "output 4711\n"
<- "4711(gdb) "
-> "show language\n"
<- "The current source language is \"auto; currently c\".\n"
   "(gdb) "
-> "pwd\n"
<- "Working directory /afs/cern.ch/user/l/lat/dev/test.\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 
\"/afs/cern.ch/user/l/lat/dev/test/.gdb_history\".\n"
   "(gdb) "
-> "show history size\n"
<- "The size of the command history is 256.\n"
   "(gdb) "
#  Reading file "/afs/cern.ch/user/l/lat/dev/test/main.c"...
#  Reading file "/afs/cern.ch/user/l/lat/dev/test/main.c"...No such file or 
directory.
-> "info source\n"
<- "Current source file is main.c\n"
   "Compilation directory is 
/scratch/happi/GNU.LANG/gcc-2.95.2/i686-pc-linux-gnu/libf2c/libF77/\n"
   "Source language is c.\n"
   "Compiled with stabs debugging format.\n"
   "(gdb) "
#  Reading file "main.c" from GDB...
-> "list main.c:1,1000000\n"
<- "1\tin main.c\n"
   "(gdb) "
#  Reading file "main.c" from GDB...done.
#  Source "main.c" (from GDB) 1 line, 10 characters
#  Setting buttons...
#  Setting buttons...done.
-> "info files\n"
<- "Symbols from \"/afs/cern.ch/user/l/lat/dev/test/a.out\".\n"
   "Local exec file:\n"
   "\t`/afs/cern.ch/user/l/lat/dev/test/a.out\', file type elf32-i386.\n"
   "\tEntry point: 0x8048ae0\n"
   "\t0x080480f4 - 0x08048107 is .interp\n"
   "\t0x08048108 - 0x08048128 is .note.ABI-tag\n"
   "\t0x08048128 - 0x0804826c is .hash\n"
   "\t0x0804826c - 0x0804850c is .dynsym\n"
   "\t0x0804850c - 0x080486a0 is .dynstr\n"
   "\t0x080486a0 - 0x080486f4 is .gnu.version\n"
   "\t0x080486f4 - 0x08048744 is .gnu.version_r\n"
   "\t0x08048744 - 0x0804874c is .rel.got\n"
   "\t0x0804874c - 0x08048764 is .rel.bss\n"
   "\t0x08048764 - 0x08048874 is .rel.plt\n"
   "\t0x08048874 - 0x080488a3 is .init\n"
   "\t0x080488a4 - 0x08048ad4 is .plt\n"
   "\t0x08048ae0 - 0x0804a204 is .text\n"
   "\t0x0804a204 - 0x0804a21e is .fini\n"
   "\t0x0804a220 - 0x0804a7d0 is .rodata\n"
   "\t0x0804b7d0 - 0x0804b884 is .data\n"
   "\t0x0804b884 - 0x0804b888 is .eh_frame\n"
   "\t0x0804b888 - 0x0804b890 is .ctors\n"
   "\t0x0804b890 - 0x0804b898 is .dtors\n"
   "\t0x0804b898 - 0x0804b930 is .got\n"
   "\t0x0804b930 - 0x0804b9d8 is .dynamic\n"
   "\t0x0804b9e0 - 0x0804cee4 is .bss\n"
   "(gdb) "
-> "info program\n"
<- "The program being debugged is not being run.\n"
   "(gdb) "
-> "set confirm on\n"
<- "(gdb) "
-> "source /tmp/fileruSeCZ\n"
<- "/tmp/fileruSeCZ:36: Error in sourced command file:\n"
   "No symbol \"loadtype\" in current context.\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 \"/afs/cern.ch/user/l/lat/dev/test/a.out\".\n"
   "Local exec file:\n"
   "\t`/afs/cern.ch/user/l/lat/dev/test/a.out\', file type elf32-i386.\n"
   "\tEntry point: 0x8048ae0\n"
   "\t0x080480f4 - 0x08048107 is .interp\n"
   "\t0x08048108 - 0x08048128 is .note.ABI-tag\n"
   "\t0x08048128 - 0x0804826c is .hash\n"
   "\t0x0804826c - 0x0804850c is .dynsym\n"
   "\t0x0804850c - 0x080486a0 is .dynstr\n"
   "\t0x080486a0 - 0x080486f4 is .gnu.version\n"
   "\t0x080486f4 - 0x08048744 is .gnu.version_r\n"
   "\t0x08048744 - 0x0804874c is .rel.got\n"
   "\t0x0804874c - 0x08048764 is .rel.bss\n"
   "\t0x08048764 - 0x08048874 is .rel.plt\n"
   "\t0x08048874 - 0x080488a3 is .init\n"
   "\t0x080488a4 - 0x08048ad4 is .plt\n"
   "\t0x08048ae0 - 0x0804a204 is .text\n"
   "\t0x0804a204 - 0x0804a21e is .fini\n"
   "\t0x0804a220 - 0x0804a7d0 is .rodata\n"
   "\t0x0804b7d0 - 0x0804b884 is .data\n"
   "\t0x0804b884 - 0x0804b888 is .eh_frame\n"
   "\t0x0804b888 - 0x0804b890 is .ctors\n"
   "\t0x0804b890 - 0x0804b898 is .dtors\n"
   "\t0x0804b898 - 0x0804b930 is .got\n"
   "\t0x0804b930 - 0x0804b9d8 is .dynamic\n"
   "\t0x0804b9e0 - 0x0804cee4 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\n"
   "you were debugging a file, the file is closed and gdb no longer accesses 
it.\n"
   "(gdb) "
-> "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) "
#  Starting GDB...done.
#  Welcome to DDD 3.1.90 "Gravity Pull" (i686-pc-linux-gnu)
-> "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) "
-> "quit\n"
#  Running GDB (pid 30088, tty /dev/pts/1)...Exit 0.
#  Saving history in "/afs/cern.ch/user/l/lat/.ddd/history"...
#  Saving history in "/afs/cern.ch/user/l/lat/.ddd/history"...done.
#  Thanks for using DDD 3.1.90!

reply via email to

[Prev in Thread] Current Thread [Next in Thread]