-
Notifications
You must be signed in to change notification settings - Fork 9
Debugging gnitest using lgdb
THIS PAGE NEEDS TO BE UPDATED
TO START, CRAY HAS DEPRECATED LGDB
This page describes how to use the Cray Line Mode Parallel Debugger (lgdb) to debug gnitest. See the man page or use help
in lgdb for additional info on commands.
First, load the lgdb module:
% module load cray-lgdb
Next, start lgdb:
% lgdb
lgdb 2.4 - Cray Line Mode Parallel Debugger
With Cray Comparative Debugging Technology.
Copyright 2007-2015 Cray Inc. All Rights Reserved.
Copyright 1996-2015 University of Queensland. All Rights Reserved.
Type "help" for a list of commands.
Type "help <cmd>" for detailed help about a command.
dbg all>
Launch gnitest using 1 node with the appropriate command line arguments. For example, on tiger:
dbg all> launch $a{1} --launcher-args="--exclusive -N1 --cpu_bind=none" --args="-j1 --verbose" ./prov/gni/test/gnitest
Starting application, please wait...
Creating MRNet communication network...
Waiting for debug servers to attach to MRNet communications network...
Timeout in 60 seconds. Please wait for the attach to complete.
Number of dbgsrvs connected: [1]; Timeout Counter: [0]
Finalizing setup...
Launch complete.
a{0}: Initial breakpoint, main at src/main.c:118
dbg all>
The unit tests are executed in a child process. In order to debug the child, use the gdb pass-thru mode:
dbg all> gdbmode
Entering gdb pass-thru mode. Type "end" to exit mode...
GNU gdb (GDB) 7.6.2-5.0.1
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-unknown-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Next, set the debugger to follow the child on fork:
> set follow-fork-mode child
Use the continue
command to begin program execution:
> cont
Continuing.
Breakpoints can be set as usual, though if you set them in gdbmode
, you may see an error message like the following:
a{0}: Debugger error: Hit unknown breakpoint!
This is to warn you that when you exit out of gdbmode
, lgdb will be in an unknown state. When debugging gnitest, we can ignore this error, since we won't exit out of gdbmode
without also wanting to quit debugging.