Hello,
This function was copied into my code, which was compiled without error/warning, but when executed there is always Segmentation fault at the end after the output (which seems correct!):
Then I used gdb to debug, and I got this message:
The problem line has been highlighted. Code for the whole program is attached. I used type cast to suppress the warnings at compiling without full understanding.
Can someone explain the error for me, and show me the correct fix?
Thanks a lot!
hello,
i have a problem with strlen. I have written this:
for(y=13,z=0; cInBuf!=' ';y++)
{
cBuf=cInBuf;
z++;
}
len = strlen(cBuf);
out=len/2;
fprintf(outfile,"F%i",out);
If strlen is e.g. 22, it write F22. I want to write F2F2.
How can i do this?... (5 Replies)
Hello,
Just a little problem with the ksh function : strlen
I want to use this function in this little ksh program :
while read line ; do
TOTO=$line
TOTONB=strlen($TOTO)
echo $TOTONB (3 Replies)
When run it, segment fault.
What is wrong?
#include <stdio.h>
#include <stdlib.h>
const int max =20;
//****************************************************
// Input Matrix
//****************************************************
void inMatrixAA(int *AA, int row, int col)... (9 Replies)
In a declaration, I have:
const char comment_begin = "<!--";
const char comment_end = "-->";
const int comment_begin_len = strlen(comment_begin);
const int comment_end_len = strlen(comment_end);
When I compile, I get the warnings:
emhttpc.c:64: warning: initializer element is not... (10 Replies)
Hi all
In the ltp-posix test,there is a case in open_posix_testsuite\conformance\interfaces\timer_gettime\speculative/6-1.c
I run the above code,it will has a segment fault, if I modify it to below,it works well
Anybody can tell me why? (1 Reply)
My OS (Debian) and gcc use the UTF-8 locale. This code says that the char size is 1 byte but the size of 'a' is really 4 bytes.
int main(void)
{
setlocale(LC_ALL, "en_US.UTF-8");
printf("Char size: %i\nSize of char 'a': %i\nSize of Euro sign '€': %i\nLength of Euro sign: %i\n",... (8 Replies)
Hi,
Whether the following piece of code is placed in the read-only memory of code (text) segment or data segment?
char *a = "Hello";
I am getting two different answers while searching in google :( that's why the confusion is (7 Replies)
I always get segment fault, why? can sb help me and modify it, I have spend on much time on
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/time.h>
#include <string.h>
#define MAX 10
pthread_t thread;
void *thread1()
{
int *a;
int i, n;
... (1 Reply)
Hi
I have struggling a week to fix a program , in the begining i got SIGBUS , but after many attempts still the program gets SIGSEGV segment fault , In bellow i post the seg fault log + source codes. would really appreciate if experts help me to fix this segment fault error. any advice is... (2 Replies)
I am trying to reverse complement DNA sequence (string) with a short c++ code using boost library. Code was compiled without any warning/error, but ran into Segmentation fault.
My guess is the function to return a vector, but not sure.
#include <iostream>
#include <fstream>
#include <string>... (14 Replies)
Discussion started by: yifangt
14 Replies
LEARN ABOUT FREEBSD
dwarf_get_access_name
DWARF_GET_AT_NAME(3) BSD Library Functions Manual DWARF_GET_AT_NAME(3)NAME
dwarf_get_ACCESS_name, dwarf_get_AT_name, dwarf_get_ATE_name, dwarf_get_CC_name, dwarf_get_CFA_name, dwarf_get_CHILDREN_name,
dwarf_get_DS_name, dwarf_get_DSC_name, dwarf_get_EH_name, dwarf_get_END_name, dwarf_get_FORM_name, dwarf_get_ID_name, dwarf_get_INL_name,
dwarf_get_LANG_name, dwarf_get_LNE_name, dwarf_get_LNS_name, dwarf_get_MACINFO_name, dwarf_get_OP_name, dwarf_get_ORD_name,
dwarf_get_TAG_name, dwarf_get_VIRTUALITY_name, dwarf_get_VIS_name -- retrieve the symbolic names of DWARF constants
LIBRARY
DWARF Access Library (libdwarf, -ldwarf)
SYNOPSIS
#include <libdwarf.h>
int
dwarf_get_ACCESS_name(unsigned val, char **str);
int
dwarf_get_AT_name(unsigned val, char **str);
int
dwarf_get_ATE_name(unsigned val, char **str);
int
dwarf_get_CC_name(unsigned val, char **str);
int
dwarf_get_CFA_name(unsigned val, char **str);
int
dwarf_get_CHILDREN_name(unsigned val, char **str);
int
dwarf_get_DS_name(unsigned val, char **str);
int
dwarf_get_DSC_name(unsigned val, char **str);
int
dwarf_get_EH_name(unsigned val, char **str);
int
dwarf_get_END_name(unsigned val, char **str);
int
dwarf_get_FORM_name(unsigned val, char **str);
int
dwarf_get_ID_name(unsigned val, char **str);
int
dwarf_get_INL_name(unsigned val, char **str);
int
dwarf_get_LANG_name(unsigned val, char **str);
int
dwarf_get_LNE_name(unsigned val, char **str);
int
dwarf_get_LNS_name(unsigned val, char **str);
int
dwarf_get_MACINFO_name(unsigned val, char **str);
int
dwarf_get_OP_name(unsigned val, char **str);
int
dwarf_get_ORD_name(unsigned val, char **str);
int
dwarf_get_TAG_name(unsigned val, char **str);
int
dwarf_get_VIRTUALITY_name(unsigned val, char **str);
int
dwarf_get_VIS_name(unsigned val, char **str);
DESCRIPTION
These functions return the symbolic name of a numeric DWARF constant.
Argument val specifies the numeric value whose symbolic name is desired.
Argument str should point to a location which will hold the returned NUL-terminated string containing the symbolic name of the specified
value.
The list of functions and the DWARF constants that they accept are:
dwarf_get_ACCESS_name() DW_ACCESS_* constants.
dwarf_get_AT_name() DW_AT_* constants.
dwarf_get_ATE_name() DW_ATE_* constants.
dwarf_get_CC_name() DW_CC_* constants.
dwarf_get_CFA_name() DW_CFA_* constants.
dwarf_get_CHILDREN_name() DW_CHILDREN_* constants.
dwarf_get_DS_name() DW_DS_* constants.
dwarf_get_DSC_name() DW_DSC_* constants.
dwarf_get_EH_name() DW_EH_PE_* constants.
dwarf_get_END_name() DW_END_* constants.
dwarf_get_FORM_name() DW_FORM_* constants.
dwarf_get_ID_name() DW_ID_* constants.
dwarf_get_INL_name() DW_INL_* constants.
dwarf_get_LANG_name() DW_LANG_* constants.
dwarf_get_LNE_name() DW_LNE_* constants.
dwarf_get_LNS_name() DW_LNS_* constants.
dwarf_get_MACINFO_name() DW_MACINFO_* constants.
dwarf_get_OP_name() DW_OP_* constants.
dwarf_get_ORD_name() DW_ORD_* constants.
dwarf_get_TAG_name() DW_TAG_* constants.
dwarf_get_VIRTUALITY_name() DW_VIRTUALITY_* constants.
dwarf_get_VIS_name() DW_VIS_* constants.
RETURN VALUES
These functions return DW_DLV_OK on success. If the DWARF constant denoted by argument val is not recognized, these function return
DW_DLV_NO_ENTRY.
SEE ALSO dwarf(3)BSD April 22, 2011 BSD