ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Using the same platform and the same code compiled with -g
My teammate can logon build the source, run, create a core file
>gdb Exename core.exename.pid
gdb> where
produces a backtrace to the line that the error occurred.
I login and build the same source, run, create a core file
>gdb Exename core.exename.pid
gdb> where
gives me minimal info as if I have no symbols loaded.
Checked our .bashrc and env for differences but find none. What? I give up!
I will look at the provided link. However, remember that nothing is different except that I login to my account and my teammate logs into their account. They can get useful debug information, I can't. The Exe has the debug info built into it at compile time right? So I understand you are saying use the file command but typically this is not necessary
The following are my environment variables minus the ones I thought were irrelevant to this topic:
SHELL=/bin/bash
KDE_NO_IPV6=1
GTK_RC_FILES=/etc/gtk/gtkrc:/home/williawh/.gtkrc-1.2-gnome2
QTDIR=/usr/lib64/qt-3.3
QTINC=/usr/lib64/qt-3.3/include
USER=williawh
LD_LIBRARY_PATH=/opt/Xilinx/10.1/ISE/lib/lin64:/usr/X11R6/lib:/opt/Xilinx/10.1/ISE/smartmodel/lin64/installed_lin64:/opt/Xilinx/10.1/ISE/smartmodel/lin64/installed_lin64/lib/linux.lib:/opt/Xilinx/10.1/ISE/smartmodel/lin64/installed_lin64:/opt/Xilinx/10.1/ISE/smartmodel/lin64/installed_lin64/lib/amd64.lib:/opt/Xilinx/10.1/EDK/lib/lin64:/opt/Xilinx/10.1/ISE/lib/lin64:/usr/X11R6/lib:/opt/Xilinx/10.1/ISE/smartmodel/lin64/installed_lin64/lib/linux.lib:/opt/Xilinx/10.1/ISE/smartmodel/lin64/installed_lin64/lib/amd64.lib:/opt/Xilinx/10.1/EDK/lib/lin64
DEPMOD=/opt/eldk/usr/bin/depmod.pl
XILINX_EDK=/opt/Xilinx/10.1/EDK
KDEDIR=/usr
USERNAME=williawh
PATH=/opt/eldk/usr/bin:/opt/eldk/bin:/opt/Xilinx/10.1/EDK/gnu/microblaze/lin64/bin/:/opt/Xilinx/10.1/EDK/gnu/powerpc-eabi/lin64/bin/:/opt/Xilinx/10.1/ISE/bin/lin64:/opt/Xilinx/10.1/EDK/bin/lin64:/opt/Xilinx/10.1/EDK/lib/lin64:/opt/eldk/usr/bin:/opt/eldk/bin:/opt/Xilinx/10.1/EDK/gnu/microblaze/lin64/bin/:/opt/Xilinx/10.1/EDK/gnu/powerpc-eabi/lin64/bin/:/opt/Xilinx/10.1/ISE/bin/lin64:/opt/Xilinx/10.1/EDK/bin/lin64:/opt/Xilinx/10.1/EDK/lib/lin64:/usr/lib64/qt-3.3/bin:/usr/kerberos/bin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/home/williawh/bin
XIL_IMPACT_USE_LIBUSB=1
XMODIFIERS=@im=none
KDE_IS_PRELINKED=1
LANG=en_US.UTF-8
HOME=/home/williawh
LOGNAME=williawh
QTLIB=/usr/lib64/qt-3.3/lib
ARCH=powerpc
CROSS_COMPILE=ppc_4xx-
LMC_HOME=/opt/Xilinx/10.1/ISE/smartmodel/lin64/installed_lin64:/opt/Xilinx/10.1/ISE/smartmodel/lin64/installed_lin64
XILINX=/opt/Xilinx/10.1/ISE
I am compiling to a xilinx powerpc 405 processor board using eldk provided from xilinx using the following Makefile:
PROJ = TEPCdacq
OBJS = Dacq.o ProcessCmd.o Calculation.o Logging.o FPGA_Sim.o\
Analog_Voltage.o Detector.o High_Voltage.o Power.o Pulser.o
INCLUDES = -I.
INCLUDES += -I$(TEPC_INCLUDE_DIR)
INCLUDES += -I$(ANALOG_INCLUDE_DIR)
INCLUDES += -I$(DETECTOR_INCLUDE_DIR)
INCLUDES += -I$(HIVOLT_INCLUDE_DIR)
INCLUDES += -I$(POWER_INCLUDE_DIR)
INCLUDES += -I$(PULSER_INCLUDE_DIR)
INCLUDES += -I$(PROCESSOR_INCLUDE_DIR)
DEBUG_MODE = 1
ifeq ($(DEBUG_MODE),1)
CC = $(CROSS_COMPILE)gcc -g
CPLUS = $(CROSS_COMPILE)g++ -g
else
CC = $(CROSS_COMPILE)gcc -O3
CPLUS = $(CROSS_COMPILE)g++ -O3
endif
cp TEPCdacq /opt/eldk/ppc_4xx/home/shared/.
The exe is copied to a share folder that is NFS mounted on the target.
I run the code and get a core core.TEPCdacq.870:
/aridata/bin # gdb TEPCdacq core.TEPCdacq.870
GNU gdb Red Hat Linux (6.7-1rh)
Copyright (C) 2007 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
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 "ppc-linux"...
Using host libthread_db library "/mnt/lib/libthread_db.so.1".
warning: Can't read pathname for load map: Input/output error.
Reading symbols from /lib/libstdc++.so.6...done.
Loaded symbols for /lib/libstdc++.so.6
Reading symbols from /lib/libm.so.6...done.
Loaded symbols for /lib/libm.so.6
Reading symbols from /lib/libgcc_s.so.1...done.
Loaded symbols for /lib/libgcc_s.so.1
Reading symbols from /lib/libc.so.6...done.
Loaded symbols for /lib/libc.so.6
Reading symbols from /lib/ld.so.1...done.
Loaded symbols for /lib/ld.so.1
Core was generated by `TEPCdacq'.
Program terminated with signal 11, Segmentation fault.
#0 0x3969fffc in ?? ()
(gdb) where
#0 0x3969fffc in ?? ()
Cannot access memory at address 0x801e8104
(gdb)
Doing it the way you suggested... If this is not what you mean please let me know...:
/aridata/bin # gdb
GNU gdb Red Hat Linux (6.7-1rh)
Copyright (C) 2007 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
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 "ppc-linux".
(gdb) file TEPCdacq
Reading symbols from /aridata/bin/TEPCdacq...done.
Using host libthread_db library "/mnt/lib/libthread_db.so.1".
(gdb) core-file core.TEPCdacq.87
/aridata/bin/core.TEPCdacq.87: No such file or directory.
(gdb) core-file core.TEPCdacq.870
warning: Can't read pathname for load map: Input/output error.
Reading symbols from /lib/libstdc++.so.6...done.
Loaded symbols for /lib/libstdc++.so.6
Reading symbols from /lib/libm.so.6...done.
Loaded symbols for /lib/libm.so.6
Reading symbols from /lib/libgcc_s.so.1...done.
Loaded symbols for /lib/libgcc_s.so.1
Reading symbols from /lib/libc.so.6...done.
Loaded symbols for /lib/libc.so.6
Reading symbols from /lib/ld.so.1...done.
Loaded symbols for /lib/ld.so.1
Core was generated by `TEPCdacq'.
Program terminated with signal 11, Segmentation fault.
#0 0x3969fffc in ?? ()
(gdb) where
#0 0x3969fffc in ?? ()
Cannot access memory at address 0x801e8104
(gdb)
I copy the core file to the shared folder:
/aridata/bin # cp core.TEPCdacq.870 /mnt/home/shared/
/aridata/bin # mount
rootfs on / type rootfs (rw)
/dev/root on / type ext2 (rw)
proc on /proc type proc (rw)
/dev/xsa2 on /aridata type ext3 (rw,errors=continue,data=ordered)
192.168.1.1:/opt/eldk/ppc_4xx on /mnt type nfs (rw,vers=3,rsize=32768,wsize=32768,namlen=255,hard,nointr,proto=udp,timeo=7,retrans=3,sec=sys,addr=1 92.168.1.1)
/aridata/bin #
I then copy it to the directory I built the source in and run the target debugger: (no joy :| nundeskut!!!)
[williawh@tepc-edev data_acq]$ pwd
/home/williawh/workspace/trunk/tepc_software/apps/data_acq
[williawh@tepc-edev data_acq]$ cp /opt/eldk/ppc_4xx/home/shared/core.TEPCdacq.870 .
cp: cannot open `/opt/eldk/ppc_4xx/home/shared/core.TEPCdacq.870' for reading: Permission denied
[williawh@tepc-edev data_acq]$ cp /opt/eldk/ppc_4xx/home/shared/core.TEPCdacq.870 .
[williawh@tepc-edev data_acq]$ whereis ppc_4xx-gdb
ppc_4xx-gdb:
[williawh@tepc-edev data_acq]$ which ppc_4xx-gdb
/opt/eldk/usr/bin/ppc_4xx-gdb
[williawh@tepc-edev data_acq]$ /opt/eldk/usr/bin/ppc_4xx-gdb
GNU gdb Red Hat Linux (6.7-1rh)
Copyright (C) 2007 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
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 "--host=i686-pc-linux-gnu --target=ppc-linux".
The target architecture is set automatically (currently powerpc:403)
(gdb) file TEPCdacq
Reading symbols from /home/williawh/workspace/trunk/tepc_software/apps/data_acq/TEPCdacq...done.
(gdb) core-file core.TEPCdacq.870
warning: Can't read pathname for load map: Input/output error.
Reading symbols from /opt/eldk/ppc_4xx/lib/libstdc++.so.6...done.
Loaded symbols for /opt/eldk/ppc_4xx/lib/libstdc++.so.6
Reading symbols from /opt/eldk/ppc_4xx/lib/libm.so.6...done.
Loaded symbols for /opt/eldk/ppc_4xx/lib/libm.so.6
Reading symbols from /opt/eldk/ppc_4xx/lib/libgcc_s.so.1...done.
Loaded symbols for /opt/eldk/ppc_4xx/lib/libgcc_s.so.1
Reading symbols from /opt/eldk/ppc_4xx/lib/libc.so.6...done.
Loaded symbols for /opt/eldk/ppc_4xx/lib/libc.so.6
Reading symbols from /opt/eldk/ppc_4xx/lib/ld.so.1...done.
Loaded symbols for /opt/eldk/ppc_4xx/lib/ld.so.1
Core was generated by `TEPCdacq'.
Program terminated with signal 11, Segmentation fault.
#0 0x3969fffc in ?? ()
(gdb) where
#0 0x3969fffc in ?? ()
Cannot access memory at address 0x801e8104
(gdb) quit
aaaaarrrrrgggggggghhhhhhhhhhhhhhhh! I contacted the system guru. He says "well you must be doing something different... good grief :O !!!
I couldn't properly read your outputs since you didn't use the [code] tags, see what I get by the following commands, try the exact same commands on a simple program like hello.c, and compare the outputs:
Code:
anisha@linux-dpjj:~/Desktop> gcc -Wall -Wextra hello.c -g
anisha@linux-dpjj:~/Desktop> gdb ./a.out
....
Reading symbols from /home/anisha/Desktop/a.out...done.
(gdb) file ./a.out
Load new symbol table from "/home/anisha/Desktop/a.out"? (y or n) y
Reading symbols from /home/anisha/Desktop/a.out...done.
(gdb) b main
Breakpoint 1 at 0x804845d: file check.c, line 5.
(gdb) r
Starting program: /home/anisha/Desktop/a.out
Missing separate debuginfo for /lib/ld-linux.so.2
Try: zypper install -C "debuginfo(build-id)=d7706cbaa0ca09319cb645eac789cb8399078797"
Missing separate debuginfo for /lib/libc.so.6
Try: zypper install -C "debuginfo(build-id)=ee302691046515fe3766ae3b7d47afd3e3a8d063"
Breakpoint 1, main () at check.c:5
5 char *buff[]={"ram","shayam","hari"};
(gdb) generate-core-file ./a.out
Saved corefile ./a.out
(gdb) core-file a.out
A program is being debugged already. Kill it? (y or n) y
"/home/anisha/Desktop/a.out": not in executable format: File format not recognized
(gdb) core-file a.out
Core was generated by `/home/anisha/Desktop/a.out'.
Program terminated with signal 5, Trace/breakpoint trap.
#0 main () at check.c:5
5 char *buff[]={"ram","shayam","hari"};
(gdb)
Last edited by Aquarius_Girl; 01-25-2011 at 12:06 PM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.