|
From: Siddharth N. <sn...@dr...> - 2012-08-05 01:30:09
|
On 4 August 2012 20:15, Philippe Waroquiers <phi...@sk...>wrote: > On Sat, 2012-08-04 at 18:43 -0400, Siddharth Nilakantan wrote: > > > When I run it normally, it runs fine as shown above. However, when I > > run it under gdb: > > It is unclear what you are trying to do. > > Launching gdb on callgrind-amd64-linux means you will debug > the callgrind tool. > If this is really what you want to do, then see README_DEVELOPERS > that describes how to debug Valgrind and its tools. > > Debugging callgrind is what I wanted to do. I made some modifications to Callgrind for a research project. I was debugging some changes I recently made, when I saw this issue, the first step was to test unmodified source with gdb. Following README_DEVELOPERS, even the pwd example doesn't seem to be working: (gdb) handle SIGSEGV SIGILL nostop noprint Signal Stop Print Pass to program Description SIGILL No No Yes Illegal instruction SIGSEGV No No Yes Segmentation fault (gdb) r pwd Starting program: /usr/local/lib/valgrind/callgrind-amd64-linux pwd warning: no loadable sections found in added symbol-file system-supplied DSO at 0x2aaaaaaab000 ==10498== Callgrind, a call-graph generating cache profiler ==10498== Copyright (C) 2002-2011, and GNU GPL'd, by Josef Weidendorfer et al. ==10498== Using Valgrind-3.8.0.SVN and LibVEX; rerun with -h for copyright info ==10498== Command: pwd ==10498== ==10498== For interactive control, run 'callgrind_control -h'. --10498-- VG_USERREQ__CLIENT_CALL1: func=0x0 --10498-- VG_USERREQ__CLIENT_CALL1: func=0x0 --10498-- VG_USERREQ__CLIENT_CALL1: func=0x0 ==10498== ==10498== Process terminating with default action of signal 11 (SIGSEGV) ==10498== Access not within mapped region at address 0x0 ==10498== at 0x4A07862: strlen (mc_replace_strmem.c:391) ==10498== by 0x3D9022D7FD: _nl_make_l10nflist (in /lib64/libc-2.5.so) ==10498== by 0x3D902278AA: _nl_find_locale (in /lib64/libc-2.5.so) ==10498== by 0x3D902272CD: setlocale (in /lib64/libc-2.5.so) ==10498== by 0x401756: ??? (in /bin/pwd) ==10498== by 0x3D9021D993: (below main) (in /lib64/libc-2.5.so) ==10498== If you believe this happened as a result of a stack ==10498== overflow in your program's main thread (unlikely but ==10498== possible), you can try to increase the size of the ==10498== main thread stack using the --main-stacksize= flag. ==10498== The main thread stack size used in this run was 10485760. ==10498== ==10498== Events : Ir ==10498== Collected : 114266 ==10498== ==10498== I refs: 114,266 Program terminated with signal SIGSEGV, Segmentation fault. The program no longer exists. > Otherwise, if you want to debug your application while running > under callgrind, you can use the embedded Valgrind gdbserver > (see the doc, or give --vgdb-error=0 option and follow instructions > on the screen). > > Philippe > > > |