LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   gdb (no debugging symbols found) (https://www.linuxquestions.org/questions/programming-9/gdb-no-debugging-symbols-found-838996/)

knobby67 10-19-2010 03:54 AM

gdb (no debugging symbols found)
 
Hi All,
I'm running gdb across a network using gdb server. Thanks to lots of help from here :D, I've got it up and running.
However I can't see any source or variables for my code (in ddd /gdb).
At start up gdb says (no debugging symbols found).
I've got a g in my make file,
CPFLAGS = -Wall -Os -g -pedantic

I've tried loading symbols in using "symbol-file testarm", this sort of works in that I can view symbols but not names, eg if I ask dd to show x y and z, rather than

x = 10
y = 20
x = 30


it says

display
10/20/30


Also ddd does not show anything in the source window, is there a way I can get it to show this? I think it's because I've started ddd with ddd arm-linux-gdb, as I'm calling a crosscompiler gdb. So can I tell ddd to point to the correct foldes?

Can anyone tell me what commands I need to set in gdb/ddd to view variable names (it's hard to keep track when it bunches them all together) and how to view my source code. Thanks!

Aquarius_Girl 10-20-2010 01:00 AM

Quote:

Originally Posted by knobby67 (Post 4132241)
Can anyone tell me what commands I need to set in gdb/ddd to view variable names

helloo.c:
Code:

anisha@linux-uitj:~/junk> cat helloo.c
#include <stdio.h>

int main ()
{
  int x = 10;
  int y = 20;

  x = 30;
  y = 60;

  return 0;
}

See if the following example [commands in RED color] helps you:
Code:

anisha@linux-uitj:~/junk> gcc -g helloo.c
anisha@linux-uitj:~/junk> gdb -quiet a.out
Reading symbols from /home/anisha/junk/a.out...done.
(gdb) b main
Breakpoint 1 at 0x4004e8: file helloo.c, line 5.
(gdb) r
Starting program: /home/anisha/junk/a.out
Missing separate debuginfo for /lib64/ld-linux-x86-64.so.2
Try: zypper install -C "debuginfo(build-id)=591af1afa33f255704fb6a60859b93d00e205302"
Missing separate debuginfo for /lib64/libc.so.6
Try: zypper install -C "debuginfo(build-id)=c5a3dfd66bf61fcdec9bc22153b2fbd0d6697960"


Breakpoint 1, main () at helloo.c:5

5        int x = 10;
(gdb) n
6        int y = 20;
(gdb) n
8        x = 30;
(gdb) p x
$1 = 10
(gdb) p y
$2 = 20
(gdb) list
3      int main ()
4      {
5        int x = 10;
6        int y = 20;
7
8        x = 30;
9        y = 60;
10
11        return 0;
12      }
(gdb)


Aquarius_Girl 01-23-2011 09:41 PM

Quote:

gdb (no debugging symbols found)
Try this:http://www.delorie.com/gnu/docs/gdb/gdb_125.html

The following quote is from above link:
Quote:

file filename
Use filename as the program to be debugged. It is read for its symbols and for the contents of pure memory.


All times are GMT -5. The time now is 07:38 PM.