From 621bb0278f8fb1c88738a84930046f366596eaeb Mon Sep 17 00:00:00 2001 From: yuchen Date: Mon, 9 Mar 2015 23:14:47 +0800 Subject: [PATCH] update lab1-ex for 32bit and strace -f --- related_info/lab1/Makefile | 5 +++-- related_info/lab1/lab1-ex0.md | 8 ++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/related_info/lab1/Makefile b/related_info/lab1/Makefile index d965aa9..e6f9adb 100644 --- a/related_info/lab1/Makefile +++ b/related_info/lab1/Makefile @@ -1,11 +1,12 @@ all: lab1-ex0.exe lab1-ex1.exe lab1-ex0.exe: defines.h lab1-ex0.s - gcc -g -o lab1-ex0.exe lab1-ex0.s + gcc -m32 -g -o lab1-ex0.exe lab1-ex0.s + strace -f ./lab1-ex0.exe lab1-ex1.exe: lab1-ex1.c echo "compile and watch the syscalls from lab1-ex1" - gcc -o lab1-ex1.exe lab1-ex1.c + gcc -m32 -o lab1-ex1.exe lab1-ex1.c strace -c ./lab1-ex1.exe echo "watch the interrupts in linux" more /proc/interrupts diff --git a/related_info/lab1/lab1-ex0.md b/related_info/lab1/lab1-ex0.md index 416c42d..3e91c23 100644 --- a/related_info/lab1/lab1-ex0.md +++ b/related_info/lab1/lab1-ex0.md @@ -1,15 +1,15 @@ # Try below command ``` -gcc -g -o lab1-ex0.exe lab1-ex0.s +gcc -g -m32 -o lab1-ex0.exe lab1-ex0.s ``` Then you will get lab1_ex0.exe Try to use below some tools to analysis lab1_ex0.exe ``` -objdump -nm +objdump -S ... +nm file - +strace -f ... ``` Try to understand the contents of this .s file.