Skip to content

Instantly share code, notes, and snippets.

@SteveLTN SteveLTN/gdb-commented
Last active Jan 4, 2016

Embed
What would you like to do?
commented code result of GDB
❯ gdb ./md demo 8a24e22
GNU gdb (GDB) 7.5
Copyright (C) 2012 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/>...
Reading symbols from /local/pcs_ua/pcs13_19/Labs/Lab2/MolDyn/md...done.
(gdb) watch f_accumulation[0][1394]
Hardware watchpoint 1: f_accumulation[0][1394]
(gdb) r
Starting program: /local/pcs_ua/pcs13_19/Labs/Lab2/MolDyn/md
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Molecular Dynamics Simulation example program
---------------------------------------------
number of particles is ............ 13500
side length of the box is ......... 25.323179
cut off is ........................ 3.750000
reduced temperature is ............ 0.722000
basic timestep is ................. 0.064000
temperature scale interval ........ 10
stop scaling at move .............. 20
print interval .................... 5
total no. of steps ................ 20
i ke pe e temp pres vel rp
----- ---------- ---------- ---------- -------- -------- -------- ----
Hardware watchpoint 1: f_accumulation[0][1394]
Old value = <unreadable>
New value = 0
L_main_128__par_region0_2_75 () at main.c:135
135 for (i = 0; i < num_threads; i++)
(gdb) c
Continuing.
Hardware watchpoint 1: f_accumulation[0][1394]
Old value = 0
New value = 3.2186704024134878e-57
0x00000035b2c8e6df in __memset_x86_64 () from /lib64/libc.so.6
(gdb) c
Continuing.
before forces in main: f[1394] = 0.00000000000000000000, f_accumulation[0][1394] = 0.00000000000000000000
Hardware watchpoint 1: f_accumulation[0][1394]
Old value = 3.2186704024134878e-57
New value = 9.6628030960322677e-08
0x0000000000403197 in forces (npart=13500, x=0x7ffffff0fdf0, f=0x7ffffffae130, side=25.323178916891326, rcoff=3.75)
at forces.c:59
warning: Source file is more recent than executable.
59 f_accumulation[thread_num][j+2] -= zz*r148;
(gdb) c
Continuing.
Hardware watchpoint 1: f_accumulation[0][1394]
Old value = 9.6628030960322677e-08
New value = 0.00075563692285537172
0x0000000000403197 in forces (npart=13500, x=0x7ffffff0fdf0, f=0x7ffffffae130, side=25.323178916891326, rcoff=3.75)
at forces.c:59
59 f_accumulation[thread_num][j+2] -= zz*r148;
(gdb) c
Continuing.
Hardware watchpoint 1: f_accumulation[0][1394]
Old value = 0.00075563692285537172
New value = -1.0562191859471437e-05
0x0000000000403197 in forces (npart=13500, x=0x7ffffff0fdf0, f=0x7ffffffae130, side=25.323178916891326, rcoff=3.75)
at forces.c:59
59 f_accumulation[thread_num][j+2] -= zz*r148;
(gdb) c
Continuing.
Hardware watchpoint 1: f_accumulation[0][1394]
Old value = -1.0562191859471437e-05
New value = -5.4163664839624227e-05
0x0000000000403197 in forces (npart=13500, x=0x7ffffff0fdf0, f=0x7ffffffae130, side=25.323178916891326, rcoff=3.75)
at forces.c:59
59 f_accumulation[thread_num][j+2] -= zz*r148;
(gdb) c
Continuing.
Hardware watchpoint 1: f_accumulation[0][1394]
Old value = -5.4163664839624227e-05
New value = 0.00010385563692257469
0x0000000000403197 in forces (npart=13500, x=0x7ffffff0fdf0, f=0x7ffffffae130, side=25.323178916891326, rcoff=3.75)
at forces.c:59
59 f_accumulation[thread_num][j+2] -= zz*r148;
(gdb) c
Continuing.
Hardware watchpoint 1: f_accumulation[0][1394]
Old value = 0.00010385563692257469
New value = -5.3089004413032744e-05
0x0000000000403197 in forces (npart=13500, x=0x7ffffff0fdf0, f=0x7ffffffae130, side=25.323178916891326, rcoff=3.75)
at forces.c:59
59 f_accumulation[thread_num][j+2] -= zz*r148;
(gdb) c
Continuing.
Hardware watchpoint 1: f_accumulation[0][1394]
Old value = -5.3089004413032744e-05
New value = -5.4253550936388433e-05
0x0000000000403197 in forces (npart=13500, x=0x7ffffff0fdf0, f=0x7ffffffae130, side=25.323178916891326, rcoff=3.75)
at forces.c:59
59 f_accumulation[thread_num][j+2] -= zz*r148;
(gdb) c
Continuing.
Hardware watchpoint 1: f_accumulation[0][1394]
Old value = -5.4253550936388433e-05
New value = 0.00010022927042627636
0x0000000000403197 in forces (npart=13500, x=0x7ffffff0fdf0, f=0x7ffffffae130, side=25.323178916891326, rcoff=3.75)
at forces.c:59
59 f_accumulation[thread_num][j+2] -= zz*r148;
(gdb) c
Continuing.
Hardware watchpoint 1: f_accumulation[0][1394]
Old value = 0.00010022927042627636
New value = -5.7336213366367551e-05
0x0000000000403197 in forces (npart=13500, x=0x7ffffff0fdf0, f=0x7ffffffae130, side=25.323178916891326, rcoff=3.75)
at forces.c:59
59 f_accumulation[thread_num][j+2] -= zz*r148;
(gdb) c
Continuing.
Hardware watchpoint 1: f_accumulation[0][1394]
Old value = -5.7336213366367551e-05
New value = -6.5739816946191063e-05
0x0000000000403197 in forces (npart=13500, x=0x7ffffff0fdf0, f=0x7ffffffae130, side=25.323178916891326, rcoff=3.75)
at forces.c:59
59 f_accumulation[thread_num][j+2] -= zz*r148;
(gdb) c
Continuing.
Hardware watchpoint 1: f_accumulation[0][1394]
Old value = -6.5739816946191063e-05
New value = 0.011350984887197787
0x0000000000403197 in forces (npart=13500, x=0x7ffffff0fdf0, f=0x7ffffffae130, side=25.323178916891326, rcoff=3.75)
at forces.c:59
59 f_accumulation[thread_num][j+2] -= zz*r148;
(gdb) c
Continuing.
Hardware watchpoint 1: f_accumulation[0][1394]
Old value = 0.011350984887197787
New value = 0.011450963157510274
0x0000000000403197 in forces (npart=13500, x=0x7ffffff0fdf0, f=0x7ffffffae130, side=25.323178916891326, rcoff=3.75)
at forces.c:59
59 f_accumulation[thread_num][j+2] -= zz*r148;
(gdb) c
Continuing.
Hardware watchpoint 1: f_accumulation[0][1394]
Old value = 0.011450963157510274
New value = 0.011350662605806954
0x0000000000403197 in forces (npart=13500, x=0x7ffffff0fdf0, f=0x7ffffffae130, side=25.323178916891326, rcoff=3.75)
at forces.c:59
59 f_accumulation[thread_num][j+2] -= zz*r148;
(gdb) c
Continuing.
Hardware watchpoint 1: f_accumulation[0][1394]
Old value = 0.011350662605806954
New value = -0.00034586502829251839
0x0000000000403197 in forces (npart=13500, x=0x7ffffff0fdf0, f=0x7ffffffae130, side=25.323178916891326, rcoff=3.75)
at forces.c:59
59 f_accumulation[thread_num][j+2] -= zz*r148;
(gdb) c
Continuing.
Hardware watchpoint 1: f_accumulation[0][1394]
Old value = -0.00034586502829251839
New value = -0.0078432182577748352
forces (npart=13500, x=0x7ffffff0fdf0, f=0x7ffffffae130, side=25.323178916891326, rcoff=3.75) at forces.c:13
13 for (i=0; i<npart*3; i+=3) {
(gdb) c
Continuing.
right after loop : f[1394] = 0.00000000000000000000, f_accumulation[0][1394] = -0.00784321825777483522
in forces : f[1394] = 0.00000000000000000000, f_accumulation[0][1394] = -0.00784321825777483522
after forces in main : f[1394] = 0.00000000000000000000, f_accumulation[0][1394] = -0.00784321825777483522
--------------------------------------------------
Hardware watchpoint 1: f_accumulation[0][1394]
Old value = -0.0078432182577748352
New value = 3.2186704024134878e-57
0x00000035b2c8e6df in __memset_x86_64 () from /lib64/libc.so.6
(gdb) c
Continuing.
before forces in main: f[1394] = 0.00000000000000000000, f_accumulation[0][1394] = 0.00000000000000000000
Hardware watchpoint 1: f_accumulation[0][1394]
Old value = 3.2186704024134878e-57
New value = 1.9272791278413633e-07
0x0000000000403197 in forces (npart=13500, x=0x7ffffff0fdf0, f=0x7ffffffae130, side=25.323178916891326, rcoff=3.75)
at forces.c:59
59 f_accumulation[thread_num][j+2] -= zz*r148;
(gdb) c
Continuing.
Hardware watchpoint 1: f_accumulation[0][1394]
Old value = 1.9272791278413633e-07
New value = 0.00072191254908691895
0x0000000000403197 in forces (npart=13500, x=0x7ffffff0fdf0, f=0x7ffffffae130, side=25.323178916891326, rcoff=3.75)
at forces.c:59
59 f_accumulation[thread_num][j+2] -= zz*r148;
(gdb) c
Continuing.
Hardware watchpoint 1: f_accumulation[0][1394]
Old value = 0.00072191254908691895
New value = -2.0405615878744195e-05
0x0000000000403197 in forces (npart=13500, x=0x7ffffff0fdf0, f=0x7ffffffae130, side=25.323178916891326, rcoff=3.75)
at forces.c:59
59 f_accumulation[thread_num][j+2] -= zz*r148;
(gdb) c
Continuing.
Hardware watchpoint 1: f_accumulation[0][1394]
Old value = -2.0405615878744195e-05
New value = -0.00010083893557587236
0x0000000000403197 in forces (npart=13500, x=0x7ffffff0fdf0, f=0x7ffffffae130, side=25.323178916891326, rcoff=3.75)
at forces.c:59
59 f_accumulation[thread_num][j+2] -= zz*r148;
(gdb) c
Continuing.
Hardware watchpoint 1: f_accumulation[0][1394]
Old value = -0.00010083893557587236
New value = 5.7742056428658991e-05
0x0000000000403197 in forces (npart=13500, x=0x7ffffff0fdf0, f=0x7ffffffae130, side=25.323178916891326, rcoff=3.75)
at forces.c:59
59 f_accumulation[thread_num][j+2] -= zz*r148;
(gdb) c
Continuing.
Hardware watchpoint 1: f_accumulation[0][1394]
Old value = 5.7742056428658991e-05
New value = -9.8692700008011147e-05
0x0000000000403197 in forces (npart=13500, x=0x7ffffff0fdf0, f=0x7ffffffae130, side=25.323178916891326, rcoff=3.75)
at forces.c:59
59 f_accumulation[thread_num][j+2] -= zz*r148;
(gdb) c
Continuing.
Hardware watchpoint 1: f_accumulation[0][1394]
Old value = -9.8692700008011147e-05
New value = -0.00010093268937774798
0x0000000000403197 in forces (npart=13500, x=0x7ffffff0fdf0, f=0x7ffffffae130, side=25.323178916891326, rcoff=3.75)
at forces.c:59
59 f_accumulation[thread_num][j+2] -= zz*r148;
(gdb) c
Continuing.
Hardware watchpoint 1: f_accumulation[0][1394]
Old value = -0.00010093268937774798
New value = 5.0657827208573137e-05
0x0000000000403197 in forces (npart=13500, x=0x7ffffff0fdf0, f=0x7ffffffae130, side=25.323178916891326, rcoff=3.75)
at forces.c:59
59 f_accumulation[thread_num][j+2] -= zz*r148;
(gdb) c
Continuing.
Hardware watchpoint 1: f_accumulation[0][1394]
Old value = 5.0657827208573137e-05
New value = -0.00010701083112917451
0x0000000000403197 in forces (npart=13500, x=0x7ffffff0fdf0, f=0x7ffffffae130, side=25.323178916891326, rcoff=3.75)
at forces.c:59
59 f_accumulation[thread_num][j+2] -= zz*r148;
(gdb) c
Continuing.
Hardware watchpoint 1: f_accumulation[0][1394]
Old value = -0.00010701083112917451
New value = -0.00012337064921774541
0x0000000000403197 in forces (npart=13500, x=0x7ffffff0fdf0, f=0x7ffffffae130, side=25.323178916891326, rcoff=3.75)
at forces.c:59
59 f_accumulation[thread_num][j+2] -= zz*r148;
(gdb) c
Continuing.
Hardware watchpoint 1: f_accumulation[0][1394]
Old value = -0.00012337064921774541
New value = 0.011017966843147447
0x0000000000403197 in forces (npart=13500, x=0x7ffffff0fdf0, f=0x7ffffffae130, side=25.323178916891326, rcoff=3.75)
at forces.c:59
59 f_accumulation[thread_num][j+2] -= zz*r148;
(gdb) c
Continuing.
Hardware watchpoint 1: f_accumulation[0][1394]
Old value = 0.011017966843147447
New value = 0.011118075308020276
0x0000000000403197 in forces (npart=13500, x=0x7ffffff0fdf0, f=0x7ffffffae130, side=25.323178916891326, rcoff=3.75)
at forces.c:59
59 f_accumulation[thread_num][j+2] -= zz*r148;
(gdb) c
Continuing.
Hardware watchpoint 1: f_accumulation[0][1394]
Old value = 0.011118075308020276
New value = 0.011017285010510566
0x0000000000403197 in forces (npart=13500, x=0x7ffffff0fdf0, f=0x7ffffffae130, side=25.323178916891326, rcoff=3.75)
at forces.c:59
59 f_accumulation[thread_num][j+2] -= zz*r148;
(gdb) c
Continuing.
Hardware watchpoint 1: f_accumulation[0][1394]
Old value = 0.011017285010510566
New value = -0.00066318155723504683
0x0000000000403197 in forces (npart=13500, x=0x7ffffff0fdf0, f=0x7ffffffae130, side=25.323178916891326, rcoff=3.75)
at forces.c:59
59 f_accumulation[thread_num][j+2] -= zz*r148;
(gdb) c
Continuing.
Hardware watchpoint 1: f_accumulation[0][1394]
Old value = -0.00066318155723504683
New value = -0.016828824093518824
forces (npart=13500, x=0x7ffffff0fdf0, f=0x7ffffffae130, side=25.323178916891326, rcoff=3.75) at forces.c:13
13 for (i=0; i<npart*3; i+=3) {
(gdb) c
Continuing.
c
right after loop : f[1394] = 0.00000000000000000000, f_accumulation[0][1394] = -0.01682882409351882380
in forces : f[1394] = 0.00000000000000000000, f_accumulation[0][1394] = -0.01682882409351882380
after forces in main : f[1394] = 0.00000000000000000000, f_accumulation[0][1394] = -0.01682882409351882380
--------------------------------------------------
Hardware watchpoint 1: f_accumulation[0][1394]
Old value = -0.016828824093518824
New value = 3.2186704024134878e-57
0x00000035b2c8e6df in __memset_x86_64 () from /lib64/libc.so.6
(gdb) c
Continuing.
before forces in main: f[1394] = 0.00000000000000000000, f_accumulation[0][1394] = 0.00000000000000000000
Hardware watchpoint 1: f_accumulation[0][1394]
Old value = 3.2186704024134878e-57
New value = 2.8829532722558583e-07
0x0000000000403197 in forces (npart=13500, x=0x7ffffff0fdf0, f=0x7ffffffae130, side=25.323178916891326, rcoff=3.75)
at forces.c:59
59 f_accumulation[thread_num][j+2] -= zz*r148;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.