📄 node239.html
字号:
<html><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><!--Converted with jLaTeX2HTML 2002 (1.62) JA patch-1.4patched version by: Kenshi Muto, Debian Project.LaTeX2HTML 2002 (1.62),original version by: Nikos Drakos, CBLU, University of Leeds* revised and updated by: Marcus Hennecke, Ross Moore, Herb Swan* with significant contributions from: Jens Lippmann, Marek Rouchal, Martin Wilck and others --><HTML><HEAD><TITLE>21.3 Mixing Tcl and C debugging</TITLE><META NAME="description" CONTENT="21.3 Mixing Tcl and C debugging"><META NAME="keywords" CONTENT="everything"><META NAME="resource-type" CONTENT="document"><META NAME="distribution" CONTENT="global"><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"><META NAME="Generator" CONTENT="jLaTeX2HTML v2002 JA patch-1.4"><META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css"><LINK REL="STYLESHEET" HREF="everything.css" tppabs="http://www.isi.edu/nsnam/ns/doc/everything.css"><LINK REL="next" HREF="node240.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node240.html"><LINK REL="previous" HREF="node238.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node238.html"><LINK REL="up" HREF="node236.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node236.html"><LINK REL="next" HREF="node240.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node240.html"></HEAD><BODY ><!--Navigation Panel--><A NAME="tex2html4973" HREF="node240.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node240.html"><IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="file:/usr/share/latex2html/icons/next.png"></A> <A NAME="tex2html4967" HREF="node236.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node236.html"><IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="file:/usr/share/latex2html/icons/up.png"></A> <A NAME="tex2html4961" HREF="node238.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node238.html"><IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="file:/usr/share/latex2html/icons/prev.png"></A> <A NAME="tex2html4969" HREF="node1.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node1.html"><IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="file:/usr/share/latex2html/icons/contents.png"></A> <A NAME="tex2html4971" HREF="node590.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node590.html"><IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="file:/usr/share/latex2html/icons/index.png"></A> <BR><B> Next:</B> <A NAME="tex2html4974" HREF="node240.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node240.html">21.4 Memory Debugging</A><B> Up:</B> <A NAME="tex2html4968" HREF="node236.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node236.html">21. Debugging ns</A><B> Previous:</B> <A NAME="tex2html4962" HREF="node238.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node238.html">21.2 C++-Level Debugging</A>   <B> <A NAME="tex2html4970" HREF="node1.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node1.html">Contents</A></B>   <B> <A NAME="tex2html4972" HREF="node590.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node590.html">Index</A></B> <BR><BR><!--End of Navigation Panel--><H1><A NAME="SECTION04130000000000000000"></A><A NAME="sec:mixdebug"></A><BR>21.3 Mixing Tcl and C debugging</H1><P>It is a painful reality that when looking at the Tcl code and debuggingTcl level stuff, one wants to get at the C-level classes, and vice versa.This is a smallish hint on how one can make that task easier. If you arerunning ns through gdb, then the following incantation (shown below) getsyou access to the Tcl debugger. Notes on how you can then use this debugger and what you can dowith it are documented earlier in this chapter and at this URL(http://expect.nist.gov/tcl-debug/tcl-debug.ps.Z).<PRE> (gdb) runStarting program: /nfs/prot/kannan/PhD/simulators/ns/ns-2/ns ...Breakpoint 1, AddressClassifier::AddressClassifier (this=0x12fbd8) at classifier-addr.cc:47(gdb) p this-\>name\_\$1 = 0x2711e8 "\_o73"(gdb) call Tcl::instance().eval("debug 1")15: lappend auto\_path \$dbg\_librarydbg15.3\> w*0: application 15: lappend auto\_path /usr/local/lib/dbgdbg15.4\> Simulator info instances\_o1dbg15.5\> \_o1 now0dbg15.6\> # and other fun stuffdbg15.7\> \_o73 info classClassifier/Addrdbg15.8\> \_o73 info varsslots\_ shift\_ off\_ip\_ offset\_ off\_flags\_ mask\_ off\_cmn\_dbg15.9\> c(gdb) wAmbiguous command "w": while, whatis, where, watch.(gdb) where#0 AddressClassifier::AddressClassifier (this=0x12fbd8) at classifier-addr.cc:47#1 0x5c68 in AddressClassifierClass::create (this=0x10d6c8, argc=4, argv=0xefffcdc0) at classifier-addr.cc:63...(gdb)</PRE><P>In a like manner, if you have started ns through gdb, then you can alwaysget gdb's attention by sending an interrupt, usually a <TT>Ctrl-c</TT>onberkeloidrones. However, note that these do tamper with the stack frame, and on occasion,may (sometimes can (and rarely, does)) screw up the stack so that, you maynot be in a position to resume execution. To its credit, gdb appears to besmart enough to warn you about such instances when you should treadsoftly, and carry a big stick. <P><HR><!--Navigation Panel--><A NAME="tex2html4973" HREF="node240.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node240.html"><IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="file:/usr/share/latex2html/icons/next.png"></A> <A NAME="tex2html4967" HREF="node236.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node236.html"><IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="file:/usr/share/latex2html/icons/up.png"></A> <A NAME="tex2html4961" HREF="node238.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node238.html"><IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="file:/usr/share/latex2html/icons/prev.png"></A> <A NAME="tex2html4969" HREF="node1.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node1.html"><IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="file:/usr/share/latex2html/icons/contents.png"></A> <A NAME="tex2html4971" HREF="node590.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node590.html"><IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="file:/usr/share/latex2html/icons/index.png"></A> <BR><B> Next:</B> <A NAME="tex2html4974" HREF="node240.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node240.html">21.4 Memory Debugging</A><B> Up:</B> <A NAME="tex2html4968" HREF="node236.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node236.html">21. Debugging ns</A><B> Previous:</B> <A NAME="tex2html4962" HREF="node238.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node238.html">21.2 C++-Level Debugging</A>   <B> <A NAME="tex2html4970" HREF="node1.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node1.html">Contents</A></B>   <B> <A NAME="tex2html4972" HREF="node590.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node590.html">Index</A></B> <!--End of Navigation Panel--><ADDRESS>2003-09-23</ADDRESS></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -