HOW_TO_GDB.txt

# -*- mode:text; fill-column:80; coding:no-conversion; -*-
#
# HOW_TO_GDB : DBPAQ Project
#
#  Copyright (c)2006 Top Pane Networks, Inc., Yokohama
#  Copyright (c)2006 Kuragano Tetsuhiro, Yokohama
#
#  This document is a free document;  you can redistribute it and/or modify
#  it under the terms of the GNU Free Documentation License, Version 1.2 (GFDL).
#  This document is distributed under GFDL WITHOUT ANY WARRANTY.
#  See GFDL for more details.
# 

Welcome your suggestion to make it correct and to make it fun to read.

#---------
# history
2006 new "HOW_TO_GDB"

#
# start the database
#
[dbpaq@vm101 ~]$ ./start_TST.sh
dbpaq: /opt/dbpaq/depend/bin/dbmcli -s -d TST -u dbm,dbm db_cold
starting database TST : OK
dbpaq: /opt/dbpaq/depend/bin/dbmcli -s -d TST -u dbm,dbm db_warm
warming database TST : OK
dbpaq: starting communicaton server : x_server start
starting communicaton server :     12722  XSERVER  Service port is 7210
    12723  XSERVER  Opened listen socket 4
    12725  XSERVER  Listening on socket 4
    12751  XSERVER  XSERVER started, 'X32|LINUX 7.3.0    Build 048-001-001-001'
    12869  XSERVER  Redirect message output to '/var/opt/dbpaq/indep_data/wrk/xs
communication server started
check the state via shared memory : OK
State
WARM
check the state via localhost : OK
State
WARM


#
# start testplus
#
[dbpaq@vm101 ~]$ testplus TST test test
+-----------------------------------------------------------+
| TST : uid=test                                            |
| connected                                                 |
| type 'help' for commands                                  |
+-----------------------------------------------------------+
SQL/command >        

#
# see processes from the other terminal
#
[dbpaq@vm101 ~]$ ps aux | grep kernel
dbpaq     2571  0.1  1.0 23536 8240 ?        Ss   14:30   0:00 /opt/dbpaq/depend
/pgm/kernel TST
dbpaq     2573  1.5  5.2 158436 40772 ?      Sl   14:30   0:01 /opt/dbpaq/depend
/pgm/kernel TST
dbpaq     2655  0.0  0.0  4448  660 pts/3    S+   14:31   0:00 grep kernel

#
# attach from the other terminal
#
[dbpaq@vm101 ~]$ gdb /opt/dbpaq/depend/pgm/kernel 2573
GNU gdb Red Hat Linux (6.3.0.0-1.63rh)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-redhat-linux-gnu"...Using host libthread_db lib
rary "/lib/tls/libthread_db.so.1".

Attaching to program: /opt/dbpaq/depend/pgm/kernel, process 2573
Reading symbols from /usr/lib/libncurses.so.5...done.
Loaded symbols for /usr/lib/libncurses.so.5
Reading symbols from /lib/tls/libpthread.so.0...done.
[Thread debugging using libthread_db enabled]
[New Thread -1229677664 (LWP 2587)]
[New Thread -1228215392 (LWP 2586)]
[New Thread -1226073184 (LWP 2585)]
[New Thread -1225352288 (LWP 2584)]
[New Thread -1224848480 (LWP 2583)]
[New Thread -1224344672 (LWP 2582)]
[New Thread -1224213600 (LWP 2581)]
[New Thread -1224082528 (LWP 2580)]
[New Thread -1223951456 (LWP 2579)]
[New Thread -1223820384 (LWP 2578)]
[New Thread -1223689312 (LWP 2577)]
[New Thread -1223558240 (LWP 2576)]
[New Thread -1223427168 (LWP 2575)]
[New Thread -1223296096 (LWP 2574)]
[New Thread -1208039744 (LWP 2573)]
[New Thread -1329239120 (LWP 2598)]
[New Thread -1318749264 (LWP 2597)]
[New Thread -1308259408 (LWP 2596)]
[New Thread -1297769552 (LWP 2595)]
[New Thread -1287279696 (LWP 2594)]
[New Thread -1276789840 (LWP 2593)]
[New Thread -1266299984 (LWP 2592)]
[New Thread -1255810128 (LWP 2591)]
[New Thread -1243018320 (LWP 2588)]
Loaded symbols for /lib/tls/libpthread.so.0
Reading symbols from /lib/libdl.so.2...done.
Loaded symbols for /lib/libdl.so.2
Reading symbols from /usr/lib/libstdc++.so.6...done.
Loaded symbols for /usr/lib/libstdc++.so.6
Reading symbols from /lib/tls/libm.so.6...done.
Loaded symbols for /lib/tls/libm.so.6
Reading symbols from /lib/libgcc_s.so.1...done.
Loaded symbols for /lib/libgcc_s.so.1
Reading symbols from /lib/tls/libc.so.6...done.
Loaded symbols for /lib/tls/libc.so.6
Reading symbols from /lib/ld-linux.so.2...done.
Loaded symbols for /lib/ld-linux.so.2
Reading symbols from /lib/libnss_files.so.2...done.
Loaded symbols for /lib/libnss_files.so.2
Reading symbols from /opt/dbpaq/depend/lib/liboms.so...done.
Loaded symbols for /opt/dbpaq/depend/lib/liboms.so
0x002717a2 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2


#
# set break points
#
(gdb) b k75_fetch
Breakpoint 1 at 0x83a6cc4: file vkb75.c, line 281.
(gdb) b vdattime
Breakpoint 2 at 0x84c751a: file ven52c.c, line 153.
(gdb) b g03dfchange_format_date
Breakpoint 3 at 0x8480f55: file vgg03.c, line 612.
(gdb) set logging on
Copying output to gdb.txt.


#
# restart the process
#
(gdb) c
Continuing.


#
# you can play with testplus/dbpaq here
#

...

#
# after you hunting the bug, detach the process
#
(gdb) detach
Detaching from program: /opt/dbpaq/depend/pgm/kernel, process 2573
(gdb) quit


==== eof ====

All SourceForge.net projects that use the SourceForge.net project web services are required to display the SourceForge.net logo on all web pages : SourceForge.net Logo Support This Project