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 08-07-2008, 10:17 PM   #1
Four
Member
 
Registered: Aug 2005
Posts: 298

Rep: Reputation: 30
gdb debugging assembly with no symbols


Hi,

I'm debugging a program that doesn't have any symbols. Is it posible to get gdb to print out the assembly instructions that its going to execute? all it tells me is

<address> ??()


Thank you
 
Old 08-08-2008, 09:35 AM   #2
Steve K.
LQ Newbie
 
Registered: Jul 2004
Location: Portland, OR
Posts: 15

Rep: Reputation: 1
I use KDevelop as my IDE. When debugging in KDevelop a tab labeled Disassemble is available to see assembly code for the program being debugged. I haven't used it, so I can say nothing beyond its existence.
 
Old 08-08-2008, 11:36 AM   #3
vladmihaisima
Member
 
Registered: Oct 2002
Location: Delft, Netherlands
Distribution: Gentoo
Posts: 196

Rep: Reputation: 33
You can use command "disassemble". If you want details you type "help disassemble".

Using gdb from Kdevelop would be much easiear, if possible install KDevelop.
 
Old 08-08-2008, 01:13 PM   #4
paulsm4
Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
"help disassemble" is the ticket.

Here's a good tutorial:
http://www.unknownroad.com/rtfm/gdbtut/gdbadvanced.html
 
Old 08-15-2008, 09:11 PM   #5
Four
Member
 
Registered: Aug 2005
Posts: 298

Original Poster
Rep: Reputation: 30
Is it possible to have gdb print out the assembly instruction to be executed after I type something like stepi or nexti. Its really annoying to type "disassemble $pc ($pc+1)" to get the current instruction.

Basicly I'm looking at a compiled executable and trying to understand how it works. I do not have the source code for the executable.

Thank you
 
Old 10-01-2008, 08:47 PM   #6
shana
LQ Newbie
 
Registered: Oct 2008
Posts: 1

Rep: Reputation: 0
Lightbulb

display/i $pc

This makes gdb display the next instruction to execute everytime you stop.
 
  


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
Little Help Debugging some MINOR kernel assembly Norweed Linux - Kernel 2 03-28-2008 10:32 AM
Help debugging with gdb and core files moon.es Programming 1 05-28-2005 04:58 AM
Assembly debugging using DDD bluknight43 Programming 1 02-28-2005 01:02 PM
i have used 'ggdb3' when i compile a software,why gdb didn't find debugging symbols icoming Programming 0 08-30-2004 01:35 PM
gdb assembly dump centr0 Programming 3 07-07-2003 11:38 AM


All times are GMT -5. The time now is 04:32 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration