emacs-devel
[Top][All Lists]
Advanced

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

Re: Ok, somebody give me a clue.


From: David Kastrup
Subject: Re: Ok, somebody give me a clue.
Date: Mon, 28 Feb 2005 17:20:07 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

Andreas Schwab <address@hidden> writes:

> address@hidden (Kim F. Storm) writes:
>
>> David Kastrup <address@hidden> writes:
>>
>>> For debugging purposes, I have been using the following:
>>>
>>> struct trbuf { void* pc; int value; } trbuf[256];
>>> unsigned char trptr;
>>> #define RECORD_INPUT do { __label__ woozle; \
>>>   woozle: trbuf[trptr++] = (struct trbuf)                           \
>>
>> Does [trptr++%256] give better results ?
>
> trptr is unsigned char, so won't ever be bigger than 255.

Type promotion can lead to strange effects.  While trptr++ seems like
a safe bet, I would not trust ++trptr...

Anyway, this apparently is a compiler or a dumper problem with the
local label.  I have to get at the current address with a different
method, probably inline assembly.  Pity.

Or construct a non-local label name from __LINE__.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum




reply via email to

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