Sponsored Content
Full Discussion: Regarding stack analysis
Top Forums Programming Regarding stack analysis Post 302208256 by vpraveen84 on Monday 23rd of June 2008 12:09:15 PM
Old 06-23-2008
Quote:
Originally Posted by jim mcnamara
Normally, coders test for division by zero in the function and take corrective action to the values before SIGFPE hits the process. Not after.

With your method, you will need global pointers to the problem value(s), but how do you expect to correct the problem? You have already gone past the division step. Call the function again from the signal handler? Then what happens? The code sets b=0 again and you get another SIGFPE, and you are back where you started.
I understand what you are saying, but my aim is not exception handling. I want to modify certain memory locations before dumping the core , and this is why I want access to the local variables in func().

For instance, we've the ucontext_t (in sigaction) which gives the context of the exception(similar to setjmp env). But I don't know how I can get a mapping between the variables in func() and the context ?

thanks.

Last edited by vpraveen84; 06-23-2008 at 02:26 PM..
 

6 More Discussions You Might Find Interesting

1. Solaris

Catalina Analysis

How can I make analysis for catalina.out (2 Replies)
Discussion started by: Burhan
2 Replies

2. Programming

what is stack winding and stack unwinding

helo can u tell me what do you mean by stack winding and stack unwinding Regards, Amit (2 Replies)
Discussion started by: amitpansuria
2 Replies

3. Shell Programming and Scripting

Metacharacters analysis

:confused:Hi , Can someone please advise what is the meaning of metacharacters in below code? a_PROCESS=${0##*/} a_DPFX=${a_PROCESS%.*} a_LPFX="a_DPFX : $$ : " a_UPFX="Usage: $a_PROCESS" Regards, gehlnar (3 Replies)
Discussion started by: gehlnar
3 Replies

4. UNIX for Dummies Questions & Answers

Text analysis

Hey Guys, Does anyone know how to count the separate amount of words in a text file? e.g the 5 and 20 Furthermore does anyone know how to convert whole numbers in decimals? Thanks (24 Replies)
Discussion started by: John0101
24 Replies

5. UNIX for Dummies Questions & Answers

Kernel Stack vs User Mode Stack

Hi, I am new to the linux kernel development area. I want to know what is the difference between kernel mode stack and user mode stack? Does each process has a user mode stack and a kernel mode stack?? Or Each process has a user mode stack and there is only one kernel mode stack that is shared by... (4 Replies)
Discussion started by: saurabhkoar
4 Replies

6. Infrastructure Monitoring

Nmon Analysis

Dear All, I am an performance tester. Now i am working in project where we are using linux 2.6.32. Now I got an oppurtunity to learn the monitoring the server. As part of this task i need to do analysis of the Nmon report. I was completely blank in this. So please suggest me how to start... (0 Replies)
Discussion started by: iamsengu
0 Replies
BSD_SIGNAL(3)						   BSD Library Functions Manual 					     BSD_SIGNAL(3)

NAME
bsd_signal -- simplified signal facilities SYNOPSIS
#include <signal.h> void (* bsd_signal(int sig, void (*func)(int)))(int); or in an equivalent but easier to read typedef'd version: typedef void (*sig_t) (int); sig_t bsd_signal(int sig, sig_t func); DESCRIPTION
The bsd_signal() function provides a partially compatible interface for programs written to historical system interfaces (see USAGE below). The function call bsd_signal(sig, func) has the effect as if implemented as: void (*bsd_signal(int sig, void (*func)(int)))(int) { struct sigaction act, oact; act.sa_handler = func; act.sa_flags = SA_RESTART; sigemptyset(&act.sa_mask); sigaddset(&act.sa_mask, sig); if (sigaction(sig, &act, &oact) == -1) return(SIG_ERR); return(oact.sa_handler); } The handler function should be declared: void func(int sig) where sig is the signal number. The behavior is undefined if func() is a function that takes more than one argument, or an argument of a different type. RETURN VALUES
Upon successful completion, bsd_signal() returns the previous action for sig. Otherwise, SIG_ERR is returned and errno is set to indicate the error. ERRORS
Refer to sigaction(2). USAGE
This function is a direct replacement for the BSD signal(3) function for simple applications that are installing a single-argument signal handler function. If a BSD signal handler function is being installed that expects more than one argument, the application has to be modi- fied to use sigaction(2). The bsd_signal() function differs from signal(3) in that the SA_RESTART flag is set and the SA_RESETHAND will be clear when bsd_signal() is used. The state of these flags is not specified for signal(3). SEE ALSO
sigaction(2), sigaddset(3), sigemptyset(3), signal(3) STANDARDS
The bsd_signal() function conforms to IEEE Std 1003.1-2001 (``POSIX.1''). BSD
December 20, 2003 BSD
All times are GMT -4. The time now is 07:01 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy