(gdb) b after_post
Breakpoint 1 at 0x80dccfb: file article.c, line 1098.
(gdb) c
Continuing.
Breakpoint 1, after_post (user=0xd057cac0, fh=0x8046a50, boardname=0xd1041680 "test", re=0x0,
poststat=1, session=0x8147900) at article.c:1098
1098 int fd, err = 0, nowid = 0;
(gdb) watch boardname
Watchpoint 2: boardname
(gdb) p boardname
$1 = 0xd1041680 "test"
(gdb) n
1105 struct boardheader *bh = NULL;
(gdb) p boardname
$2 = 0xd1041680 "test"
(gdb) n
1108 if ((re == NULL) && (!strncmp(fh->title, "Re: ", 4))) {
(gdb) p boardname
$3 = 0xd1041680 "test"
(gdb) n
Watchpoint 2 deleted because the program has left the block in
which its expression is valid.
0xd117f790 in strncmp () from /usr/lib/libc.so.1
(gdb) p boardname
No symbol "boardname" in current context.
(gdb) n
Single stepping until exit from function strncmp,
which has no line number information.
after_post (user=0xd057cac0, fh=0x8046a50, boardname=0xd1041680 "test", re=0x0, poststat=1,
session=0x8147900) at article.c:1111
1111 bid = getbid(boardname, &bh);
(gdb) p boardname
$4 = 0xd1041680 "test"
(gdb) n
1113 setbfile(oldpath, boardname, fh->filename);
(gdb) p boardname
$5 = 0xd1041680 "test"
(gdb) n
1114 filtered = 0;
(gdb) p boardname
$6 = 0xd1041680 "test"
(gdb) n
1115 if (strcmp(fh->owner, DELIVER)) {
(gdb) p boardname
$7 = 0xd1041680 "test"
(gdb) n
1116 if (((bh && bh->level & PERM_POSTMASK) || normal_board(boardname)) && strcmp(boardname, FILTER_BOARD)
(gdb) p boardname
$8 = 0xd1041680 "test"
(gdb) n
1128 if (check_badword_str(fh->title, strlen(fh->title), session) || check_badword(oldpath, fh->attachment, session))
(gdb) p boardname
$9 = 0xd1041680 "test"
(gdb) n
1178 setbfile(buf, boardname, DOT_DIR);
(gdb) p boardname
$10 = 0xd1041680 "test"
(gdb) n
1180 if ((fd = open(buf, O_WRONLY | O_CREAT, 0664)) == -1) {
(gdb) p boardname
$11 = 0xd1041680 "test"
(gdb) n
1189 for (p = fh->title; *p; p++)
(gdb) p boardname
$12 = 0xd1041680 "test"
(gdb) n
1190 if (*p == '\x1b')
(gdb) p boardname
$13 = 0xd1041680 "test"
(gdb) n
1189 for (p = fh->title; *p; p++)
(gdb) p boardname
$14 = 0xd1041680 "test"
(gdb) n
1190 if (*p == '\x1b')
(gdb) p boardname
$15 = 0xd1041680 "test"
(gdb) n
1189 for (p = fh->title; *p; p++)
(gdb) p boardname
$16 = 0xd1041680 "test"
(gdb) n
1190 if (*p == '\x1b')
(gdb) p boardname
$17 = 0xd1041680 "test"
(gdb) n
1189 for (p = fh->title; *p; p++)
(gdb) p boardname
$18 = 0xd1041680 "test"
(gdb) n
1193 if (!err) {
(gdb) p boardname
$19 = 0xd1041680 "test"
(gdb) n
1194 flock(fd, LOCK_EX);
(gdb) p boardname
$20 = 0xd1041680 "test"
(gdb) n
1195 nowid = get_nextid(boardname);
(gdb) p boardname
$21 = 0xd1041680 "test"
(gdb) n
1196 fh->id = nowid;
(gdb) p boardname
$22 = 0xd1041680 <Address 0xd1041680 out of bounds>
(gdb) n
1197 if (re == NULL) {
(gdb) p boardname
$23 = 0xd1041680 <Address 0xd1041680 out of bounds>
(gdb) n
1198 fh->groupid = fh->id;
(gdb) p boardname
$24 = 0xd1041680 <Address 0xd1041680 out of bounds>
(gdb) n
1199 fh->reid = fh->id;
(gdb) p boardname
$25 = 0xd1041680 <Address 0xd1041680 out of bounds>
(gdb) n
1204 set_posttime(fh);
(gdb) p boardname
$26 = 0xd1041680 <Address 0xd1041680 out of bounds>
(gdb) n
1205 lseek(fd, 0, SEEK_END);
(gdb) p boardname
$27 = 0xd1041680 <Address 0xd1041680 out of bounds>
(gdb) n
1206 if (safewrite(fd, fh, sizeof(fileheader)) == -1) {
(gdb) p boardname
$28 = 0xd1041680 <Address 0xd1041680 out of bounds>
(gdb) n
1210 flock(fd, LOCK_UN);
(gdb) p boardname
$29 = 0xd1041680 <Address 0xd1041680 out of bounds>
(gdb) n
1211 close(fd);
(gdb) p boardname
$30 = 0xd1041680 <Address 0xd1041680 out of bounds>
(gdb) n
1213 if (err) {
(gdb) p boardname
$31 = 0xd1041680 <Address 0xd1041680 out of bounds>
(gdb) n
1223 updatelastpost(boardname);
(gdb) p boardname
$32 = 0xd1041680 <Address 0xd1041680 out of bounds>
(gdb) n
Program received signal SIGSEGV, Segmentation fault.
0xd11ab4ee in strncasecmp () from /usr/lib/libc.so.1
(gdb) p boardname
No symbol "boardname" in current context.
(gdb) n
Single stepping until exit from function strncasecmp,
which has no line number information.
warning: rw_common (): unable to read at addr 0xd10f6500
warning: rw_common (): unable to read at addr 0xd10f6500
thread_to_lwp: td_ta_map_id2thr Debugger service failed
【 在 atppp (Big Mouse) 的大作中提到: 】
: ft看来还真的是这里?...
: watch用不了那你就n一条就打印一次boardname,看什么时候变了...
: 辛苦了!
: ...................
--
FROM 220.173.136.*