emacs-pretest-bug
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: abort() in query-replace


From: Robert Mecklenburg
Subject: Re: abort() in query-replace
Date: Fri, 30 Jul 2004 08:51:22 -0600

RMS> #3  0x081c7601 in move_if_not_intangible (position=0) at intervals.c:2284
RMS> #4  0x081631ae in Freplace_match (newtext=153507224, fixedcase=138494017, 
literal=138494017, string=138493969,
RMS> subexp=138493969) at search.c:2617
RMS> 
RMS> If you put a breakpoint at Freplace_match before it gets here, you could
RMS> probably find where the zero comes from.  Would you please try that?

Here is my progress for the morning.  I debugging this in 40 minute
chunks due to my other work (as I'm sure you understand)...


(gdb) l 2581
2576        }
2577
2578      /* Replace the old text with the new in the cleanest possible way.  */
2579      replace_range (search_regs.start[sub], search_regs.end[sub],
2580                     newtext, 1, 0, 1);
2581      newpoint = search_regs.start[sub] + SCHARS (newtext);
2582
2583      if (case_action == all_caps)
2584        Fupcase_region (make_number (search_regs.start[sub]),
2585                        make_number (newpoint));
(gdb) br 2581 if newpoint == 0
Breakpoint 4 at 0x81632d1: file search.c, line 2581.
(gdb) info br
Num Type           Disp Enb Address    What
1   breakpoint     keep y   0x081220c6 in abort at emacs.c:428
2   breakpoint     keep y   0x080feb7e in x_error_quitter at xterm.c:7837
3   breakpoint     keep n   0x081627dc in Freplace_match at search.c:2216
        breakpoint already hit 574 times
4   breakpoint     keep y   0x081632d1 in Freplace_match at search.c:2581
        stop only if newpoint == 0
(gdb) run
Starting program: /home/mecklen/Emacs/trunk/emacs/src/emacs -geometry 
101x80+948+0
Detaching after fork from child process 31743.
Detaching after fork from child process 31744.
Detaching after fork from child process 31745.
Detaching after fork from child process 31746.
Detaching after fork from child process 31747.
Detaching after fork from child process 31755.
Error in testing breakpoint condition:
Variable "newpoint" is not available.

Breakpoint 4, Freplace_match (newtext=151633195, fixedcase=138493969, 
literal=138494017, string=138493969,
    subexp=138493969) at search.c:2581
2581      newpoint = search_regs.start[sub] + SCHARS (newtext);
(gdb) p sub
$13 = 0
(gdb) p newtext
$14 = 151633195
(gdb) xstring
$15 = (struct Lisp_String *) 0x909bd28
Invalid number 0 of repetitions.
(gdb) p *$15
$16 = {
  size = 0,
  size_byte = 0,
  intervals = 0x0,
  data = 0x9159b58 ""
}
(gdb) p search_regs
$17 = {
  num_regs = 30,
  start = 0x8468fd0,
  end = 0x8469050
}
(gdb) p search_regs.start[0]
$18 = 0
(gdb) p search_regs.end[0]
$19 = 1
(gdb) p fixedcase
$20 = 138493969
(gdb) xtype
Lisp_Symbol
(gdb) xsymbol
$21 = (struct Lisp_Symbol *) 0x8414010
"nil"
(gdb) p literal
$22 = 138494017
(gdb) pr
t
(gdb) p string
$23 = 138493969
(gdb) pr
nil
(gdb) p subexp
$24 = 138493969
(gdb) p subexp
$25 = 138493969
(gdb) pr
nil
(gdb) p newtext
$26 = 151633195
(gdb) pr
""
(gdb) p pos
$27 = 1385
(gdb) p last
$28 = 1385
(gdb) p opoint
$29 = -9548
(gdb) p current_buffer->pt
$30 = 1379
(gdb) p current_buffer->zv
$31 = 10927
(gdb) p current_buffer->pt - current_buffer->zv
$32 = -9548
(gdb)

If newpoint == 0 is wrong, then it seems at this point it seems that
search_regs is simply wrong.  The replacement text is the empty string
(which is correct) so SCHARS(newtext) should be zero, then
search_regs.start[sub] should be non-zero.  Comments clearly indicate
this structure is set before calling Freplace_match, but I'm not sure
where.

Hopefully more later,
-- 
Robert




reply via email to

[Prev in Thread] Current Thread [Next in Thread]