Skip to content

Commit

Permalink
ovs-sandbox: Add -d option to run ovsdb-server under GDB
Browse files Browse the repository at this point in the history
Signed-off-by: Andy Zhou <[email protected]>
Acked-by: Ben Pfaff <[email protected]>
  • Loading branch information
azhou-nicira committed Feb 23, 2015
1 parent 4cf272a commit 4b814d4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
3 changes: 2 additions & 1 deletion tutorial/Tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@ GDB can already be used to debug any running process, with the usual

'ovs-sandbox' also has a '-g' option for launching ovs-vswitchd under GDB.
This option can be handy for setting break points before ovs-vswitchd runs,
or for catching early segfaults.
or for catching early segfaults. Similarly, a '-d' option can be used to
run ovsdb-server under GDB. Both options can be specified at the same time.

To avoid GDB mangling with the sandbox sub shell terminal, 'ovs-sandbox'
starts a new xterm to run each GDB session. For systems that do not support
Expand Down
9 changes: 7 additions & 2 deletions tutorial/ovs-sandbox
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ rungdb() {
fi
}

gdb_vswitchd=false;
gdb_vswitchd=false
gdb_ovsdb=false
builddir=
srcdir=
schema=
Expand Down Expand Up @@ -87,6 +88,7 @@ These options force ovs-sandbox to use a particular OVS build:
These options force ovs-sandbox to use an installed Open vSwitch:
-i, --installed use installed Open vSwitch
-g, --gdb-vswitchd run ovs-vswitchd under gdb
-d, --gdb-ovsdb run ovsdb-server under gdb
-S, --schema=FILE use FILE as vswitch.ovsschema
Other options:
Expand Down Expand Up @@ -125,6 +127,9 @@ EOF
-g|--gdb-v*)
gdb_vswitchd=true
;;
-d|--gdb-o*)
gdb_ovsdb=true
;;
-*)
echo "unrecognized option $option (use --help for help)" >&2
exit 1
Expand Down Expand Up @@ -227,7 +232,7 @@ trap 'kill `cat "$sandbox"/*.pid`' 0 1 2 3 13 14 15
# Create database and start ovsdb-server.
touch "$sandbox"/.conf.db.~lock~
run ovsdb-tool create conf.db "$schema"
run ovsdb-server --detach --no-chdir --pidfile -vconsole:off --log-file \
rungdb $gdb_ovsdb ovsdb-server --detach --no-chdir --pidfile -vconsole:off --log-file \
--remote=punix:"$sandbox"/db.sock

# Start ovs-vswitchd.
Expand Down

0 comments on commit 4b814d4

Please sign in to comment.