mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-21 11:10:21 +02:00
Make jit_get_note a public interface.
* include/lightning.h, include/lightning/jit_private.h, lib/jit_note.c: Change the code argument of jit_get_note to a jit_pointer_t and make jit_get_note a public interface. It was intended so since start, as a way to map an offset in the code to a function name, file name and line number mapping.
This commit is contained in:
parent
5a2df005c5
commit
948315f45e
4 changed files with 17 additions and 6 deletions
|
@ -213,7 +213,7 @@ _jit_set_note(jit_state_t *_jit, jit_note_t *note,
|
|||
}
|
||||
|
||||
jit_bool_t
|
||||
_jit_get_note(jit_state_t *_jit, jit_uint8_t *code,
|
||||
_jit_get_note(jit_state_t *_jit, jit_pointer_t code,
|
||||
char **name, char **file, jit_int32_t *lineno)
|
||||
{
|
||||
jit_note_t *note;
|
||||
|
@ -221,12 +221,13 @@ _jit_get_note(jit_state_t *_jit, jit_uint8_t *code,
|
|||
jit_int32_t index;
|
||||
jit_int32_t offset;
|
||||
|
||||
if ((index = note_search_index(code)) >= _jit->note.length)
|
||||
if ((index = note_search_index((jit_uint8_t *)code)) >= _jit->note.length)
|
||||
return (0);
|
||||
note = _jit->note.ptr + index;
|
||||
if (code < note->code || code >= note->code + note->size)
|
||||
if ((jit_uint8_t *)code < note->code ||
|
||||
(jit_uint8_t *)code >= note->code + note->size)
|
||||
return (0);
|
||||
offset = code - note->code;
|
||||
offset = (jit_uint8_t *)code - note->code;
|
||||
if ((index = line_search_index(note, offset)) >= note->length)
|
||||
return (0);
|
||||
if (index == 0 && offset < note->lines[0].offsets[0])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue