LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 10-19-2010, 04:54 AM   #1
knobby67
Member
 
Registered: Mar 2006
Posts: 612

Rep: Reputation: 42
gdb (no debugging symbols found)


Hi All,
I'm running gdb across a network using gdb server. Thanks to lots of help from here , 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!

Last edited by knobby67; 10-19-2010 at 09:11 AM.
 
Old 10-20-2010, 02:00 AM   #2
TheIndependentAquarius
Senior Member
 
Registered: Dec 2008
Posts: 4,680
Blog Entries: 29

Rep: Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917
Quote:
Originally Posted by knobby67 View Post
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)

Last edited by TheIndependentAquarius; 11-22-2010 at 06:26 AM. Reason: typo
 
1 members found this post helpful.
Old 01-23-2011, 10:41 PM   #3
TheIndependentAquarius
Senior Member
 
Registered: Dec 2008
Posts: 4,680
Blog Entries: 29

Rep: Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
debugging with GDB jone kim Linux - General 2 04-13-2010 01:22 AM
can't get debugging symbols when using automake ta0kira Programming 1 10-23-2008 09:52 PM
GDB Dwarf error no debuging symbols found niteshg Programming 3 10-10-2008 03:51 AM
gdb debugging assembly with no symbols Four Programming 5 10-01-2008 09:47 PM
i have used 'ggdb3' when i compile a software,why gdb didn't find debugging symbols icoming Programming 0 08-30-2004 02:35 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:54 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration