Shame and guilt are both... interesting emotions. I generally file guilt under "actions" and shame under "wants/needs/states of being." If I feel that I've done something wrong (however that is being defined) then yes, I would feel guilty. Shame is a little more... nebulous, in my head anyway. I can feel shame for wanting to do something wrong, or for repeating an action that I felt guilty over.
More concretely, because these are fuzzy blurry concepts. I felt shame for many many years for being a drug addict. Every time I picked up or used, I would feel stung with guilt for doing something I had sworn (sometimes just 10 minutes before) I wouldn't do again. My inability to stop cause me to feel shame, because I felt I should be able to simply... stop, and found myself unable. I generally feel "shame" for something that is more intrinsic to myself, and I think that shame is a much more secondary emotion than guilt. Guilt, as denu mentioned, might show up with any action that one's society/values feels is "wrong," and justifiably so. In addition to positive rewards for "falling in line" with whatever the social structure is- wolves have their rewards just as humans do- guilt for misbehavior may be one of those very basic motivating principles.
Shame I tend to view as a secondary emotion (secondary in that it's a reaction to another emotion, not that it's less visceral or important), or a reaction to some aspect of the self that one feels does not "fit" with the larger social paradigm. The tonic for which, is self-acceptance. If I accept myself as I am, I have little reason to feel shame. I may still feel guilty for making mistakes, or having to make a difficult decision which results in an ambiguous result (as Leo brought up, with the cop.) The cop needn't feels shame, because he already accepts that his actions were necessary. He could feel shame, certainly, but the general social "rules" of engagement are on his side.