This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

script to intersperse C code throughout assembly dump


Thankyou to the people who told me how to get source line info into an assembly dump - compile with -g.... Unfortunately this only puts cryptic debug info into the file and not the actual source line. I have therefore written a script which may be of use to some of you out there.

USAGE: ./slic.sh infile

SLIC (Source Line Interspersion sCript) will take the file infile (presumably assembly) and replace references to ".stabn 68,0" with the actual line from the C source code.  You just have to set the 'SRC_PATH' variable in the script to point to the dir containing the source code. The script needs awk and sed to run.

Its a bit of a hack but it works for me.
This is use&abuseware so enjoy.

P.S. I'd be interested if anyone can tell me how to get rid of the stupid ^M at the end of every included source line.

Attachment: slic.sh
Description: Bourne shell script


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]