Subject: Re: bug#22012: 25.1.50; gdb broken by (json-string-format "doesn't start with `\"'!")

From: Dmitry Gutov <[email-masked]>
Date: Thu, 26 Nov 2015 16:26:31 +0200

On 11/26/2015 03:31 PM, martin rudalics wrote:

> How would I know what what ‘json-read-string’ tries to read at that
> moment?  Am I supposed to instrument it?

Why not? Alternatively...

> Maybe
>
>    (unless (char-equal (json-peek) ?\")
>      (signal 'json-string-format (list "doesn't start with `\"'!")))

...you can add a (debug) call before (signal ...). And when the debugger 
hits, press `e' and evaluate (buffer-string) and (point).

Seeing the value of buffer-string might be sufficient if json-read is 
being called in a wrong buffer.

> should report the current buffer and its value of point.

I wouldn't mind if it did. Though that would need to be done in all such 
places.

But for the purposes of debugging, you can modify just that function's 
definition to report what's required.

> Anyway, if I understand the backtrace correctly, the current buffer
> should have been "*breakpoints of emacs.exe*".

I'm not sure what that implies. Does it have JSON content?