LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 11-09-2015, 06:22 PM   #1
dendress
LQ Newbie
 
Registered: Nov 2015
Posts: 2

Rep: Reputation: Disabled
GDB symbols file format


I am trying to debug a mysql event with gdb and unzipped the /usr/share/doc/mysql-server-5.5/mysqld.sym and gdb complains that it is the wrong file format.

Any thoughts?
 
Old 11-11-2015, 07:04 AM   #2
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,882
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
GDB is looking for files which are created that contain GDB debugging information.

I can only draw a parallel, because I don't know mysql programming at all. But it appears that you can debug SQL language using GDB.

For C or C++ programming, the source files are compiled and when they are compiled, a compilation switch is used, "-ggdb" in order to generate helpful symbols for GDB debugging:
Code:
$ gcc -ggdb -o output-file source-file.c
And so when someone runs GDB against that output file, GDB will recognize the debugging symbols.

You can see if there is a compilation switch which will enable GDB debugging symbols in your resultant image file. If you are using a library or a common set of provided libraries where you are trying to debug, you'll have to either get the source of that library or find a set of it which has been compiled for debugging. The first option is usually the best, which is to recompile that library on your own and include symbols.

Last edited by rtmistler; 11-11-2015 at 11:27 AM.
 
Old 11-11-2015, 10:24 AM   #3
dendress
LQ Newbie
 
Registered: Nov 2015
Posts: 2

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by rtmistler View Post
GDB is looking for files which are created that contain GDB debugging information.

I can only draw a parallel, because I don't know mysql programming at all. But it appears that you can debug SQL language using GDB.

For C or C++ programming, the source files are compiled and when they are compiled, a compilation switch is used, "-ggdb" in order to generate helpful symbols for GDB debugging:
Code:
$ gcc -ggdb-o output-file source-file.c
And so when someone runs GDB against that output file, GDB will recognize the debugging symbols.

You can see if there is a compilation switch which will enable GDB debugging symbols in your resultant image file. If you are using a library or a common set of provided libraries where you are trying to debug, you'll have to either get the source of that library or find a set of it which has been compiled for debugging. The first option is usually the best, which is to recompile that library on your own and include symbols.
I appreciate the answer. I did not pose the question correctly. I can create a trace with gdb on the mysqld process I am trying to debug, but the special symbols are not interpreted despite my using the symbol-flag and file provided with the build of mysql (/usr/share/doc/mysql-server-5.5/mysqld.sym) gdb complains that the file is in the wrong format and does not correctly interpret the mysql specific symbols, instead returning ",::??,::??,::??," etc. on the lines I really need to read.

The /usr/share/doc/mysql-server-5.5/mysqld.sym file was originally in gz format.
 
  


Reply



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
Glade compile error, could not read symbols: File in wrong format Lethys Slackware 5 10-01-2016 05:28 AM
[SOLVED] can't debug with gdb: not in executable format: File format not recognized (squeeze) oddiofile Debian 1 08-24-2010 03:21 AM
gdb won't recognize a.out file format jakykong Programming 17 08-25-2007 05:21 AM
gdb "not in executable format: File format not recognized" tcma Programming 9 07-18-2007 06:02 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

All times are GMT -5. The time now is 09:39 AM.

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
Open Source Consulting | Domain Registration