LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-16-2006, 05:34 AM   #1
saif_shakeel
LQ Newbie
 
Registered: Apr 2006
Posts: 11

Rep: Reputation: 0
source code


hi,
this is my first post.i want to know as to how do i see the source code for programs compiled in gcc .there is a command but i am not getting it .could anyone help me out.
bye
 
Old 04-16-2006, 05:41 AM   #2
y9701015
LQ Newbie
 
Registered: Jan 2005
Posts: 10

Rep: Reputation: 0
i think that you maybe find the "Building and Installing Software Packages for
Linux" article can answer your question.
 
Old 04-16-2006, 06:47 AM   #3
saif_shakeel
LQ Newbie
 
Registered: Apr 2006
Posts: 11

Original Poster
Rep: Reputation: 0
reply

hi
sorry to confuse u guys. i meant how do i see the assembly code of the program written and not the "source code".
bye
 
Old 04-16-2006, 07:42 AM   #4
Komakino
Senior Member
 
Registered: Feb 2004
Location: Somerset, England
Distribution: Slackware 10.2, Slackware 10.0, Ubuntu 9.10
Posts: 1,938

Rep: Reputation: 55
You'd need a disassembler. Once code has been compiled it's no longer 'human-readable' because it's in binary (or can be viewed as hex). A disassembler or decompiler would give you some idea of the source code, but it wouldn't be as the programmer wrote it, it would be a 'best guess' of the disassembler. If you want source code, most linux programs provide it.
 
Old 04-16-2006, 12:28 PM   #5
saif_shakeel
LQ Newbie
 
Registered: Apr 2006
Posts: 11

Original Poster
Rep: Reputation: 0
url

hi,
where do i get the disassembler from,could u send me the link for the d/w.
 
Old 04-16-2006, 01:04 PM   #6
Komakino
Senior Member
 
Registered: Feb 2004
Location: Somerset, England
Distribution: Slackware 10.2, Slackware 10.0, Ubuntu 9.10
Posts: 1,938

Rep: Reputation: 55
Search for dasm2. I'm not sure what you're hoping to gain from this...it's only going to give you a whole load of assembly language that'll be incredibly difficult to understand.
 
Old 04-17-2006, 12:41 PM   #7
saif_shakeel
LQ Newbie
 
Registered: Apr 2006
Posts: 11

Original Poster
Rep: Reputation: 0
hi,

my aim is just to optimize the code when there are memory constraints,and by looking at assembly i hope to get an idea of writing efficent programs.
thx
bye
 
Old 04-17-2006, 02:30 PM   #8
Komakino
Senior Member
 
Registered: Feb 2004
Location: Somerset, England
Distribution: Slackware 10.2, Slackware 10.0, Ubuntu 9.10
Posts: 1,938

Rep: Reputation: 55
Quote:
Originally Posted by saif_shakeel
hi,

my aim is just to optimize the code when there are memory constraints,and by looking at assembly i hope to get an idea of writing efficent programs.
thx
bye
Well you're not going to learn that from disassembled code. You're better of reading a book about optimising assembly language or joining some forums/newsgroups. Disassembled code isn't going to be optimised or efficient, even if it was originally written that way because when the code was compiled certain things may have happened to it (like loops being unrolled) that are not how the programmer originally wrote it. In short even a program written in assembly language will look different once it's been compiled and disassembled.
 
Old 04-18-2006, 12:59 AM   #9
saif_shakeel
LQ Newbie
 
Registered: Apr 2006
Posts: 11

Original Poster
Rep: Reputation: 0
re

hi
thx for the info,i will keep that in mind.
bye
 
  


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
where is ls source code. bruse Linux - General 1 08-04-2005 08:53 AM
How to convert Assembly code to "C" source code ssg14j Programming 2 08-01-2005 12:48 PM
Does anyone know where the source code is? Echo Kilo Mandriva 8 12-22-2004 12:00 PM
how can I get the source code!? linuxfaint Red Hat 1 06-10-2004 11:25 PM
C Source Code? Gerardoj Linux - General 9 08-26-2003 04:48 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:43 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