LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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-23-2005, 02:00 PM   #1
gaven
LQ Newbie
 
Registered: Aug 2005
Posts: 3

Rep: Reputation: 0
distinguish load and store from segmentation fault


Hi there,

I'm programming segmentation fault signal handling.
I can catch the memory address and also the instruction which causes the fault. Is there an easy
way to tell whether that instruction is a load or store instruction? Of course, a solution would be to derive that by decoding the instruction. Even for that solution, I'm not clear on how to do it quickly given the big instruction set of IA32...

Gaven
 
Old 08-24-2005, 03:40 PM   #2
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,313

Rep: Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918
there's only about 60 instructions that i know of for x86.
amways, try running it in dbx/ gdb. it should give you the offset, the machine opcodes, and the respective assembly instruction with parameters.

you can also try compiliing with the -S option to get a <program>.s file containing the assembly.

hope this helps,
schneidz
 
  


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
yast segmentation fault, system freezing - nvidia driver at fault? BaltikaTroika SUSE / openSUSE 2 12-02-2005 09:34 AM
distinguish load and store from segmentation fault gaven Linux - Software 0 08-23-2005 01:36 PM
Segmentation fault tejas15_10 Programming 9 06-20-2005 09:12 AM
Segmentation fault tejas15_10 Linux - Newbie 1 06-14-2005 04:44 AM
Segmentation fault compjinx Linux - Newbie 4 11-09-2003 04:51 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:09 PM.

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