HP (Hewlett-Packard) 5992-4701 Computer Hardware User Manual


 
((gdb)) p lquote
$1 = 0x35d40 "<QUOTE>"
((gdb)) p rquote
$2 = 0x35d50 "<UNQUOTE>"
1.9 Listing Source Code
lquote and rquote are indeed the new left and right quotes. To look at some context,
we can display ten lines of source surrounding the current line with the l (list)
command.
((gdb)) l
533 xfree(rquote);
534
535 lquote = (lq == nil || *lq == '\0') ? def_lquote\
: xstrdup (lq);
536 rquote = (rq == nil || *rq == '\0') ? def_rquote\
: xstrdup (rq);
537
538 len_lquote = strlen(rquote);
539 len_rquote = strlen(lquote);
540 }
541
542 void
Let us step past the two lines that set len_lquote and len_rquote, and then examine
the values of those variables.
((gdb)) n
539 len_rquote = strlen(lquote);
((gdb)) n
540 }
((gdb)) p len_lquote
$3 = 9
((gdb)) p len_rquote
$4 = 7
1.10 Setting Variable Values During a Session
That certainly looks wrong, assuming len_lquote and len_rquote are meant to be
the lengths of lquote and rquote respectively. We can set them to better values using
the p command, since it can print the value of any expression―and that expression
can include subroutine calls and assignments.
((gdb)) p len_lquote=strlen(lquote)
$5 = 7
((gdb)) p len_rquote=strlen(rquote)
$6 = 9
Is that enough to fix the problem of using the new quotes with the m4 built-in
defn? We can allow m4 to continue executing with the c (continue) command, and
then try the example that caused trouble initially:
22 A Sample GDB Session