[Vm-beginners] mcontext_t et al

Eliot Miranda eliot.miranda at gmail.com
Sat Dec 8 18:28:26 UTC 2018


Hi Ken,

On Fri, Dec 7, 2018 at 1:23 PM Ken.Dickey <Ken.Dickey at whidbey.com> wrote:

> Greetings,
>
> I am grepping around to find the source of
>
>  ..In function sqUnixMain.c: In function 'sigsegv':
> include_ucontext.h:48:37: error 'mcontext_t'
>   has no member 'arm_pc'
>
> I note in
>  /usr/include/aarch64_linux_gnu/asm/sigcontext.h member 'pc' but not
> 'arm_pc'
>
> I am guessing this is from the include_ucontext.h line
>   #elif __linux__ && __arm__
>
> Where do I set/override __arm__ with (__aarch64__ or __armv8-a__ or
> __arm64__) ?
>
> What is the preferred __*__ to use?
>

Use all those that commonly apply. For example look at spur64src/vm/cogit.c
which attempts to include either cogitX64SysV.c or cogitX64WIN64.c
depending on whether the system, is an x86_64 and whether this is SysV or
_WIN64.  These use the following defines to see if the platform is x86_64:

defined(x86_64) || defined(__amd64) || defined(__x86_64) ||
defined(__amd64__) || defined(__x86_64__) || defined(_M_AMD64) ||
defined(_M_X64)


> Any way to debug this cr*p?  Trace flag?  Dump defines (here)?
>

There are two ways.  One is dumping the predefined macros, see e.g.
https://stackoverflow.com/questions/2224334/gcc-dump-preprocessor-defines.
For gcc (and clang) this is

$ gcc -dM -E - </dev/null

The other essential debugging technique is to use -E or -P on the
command-line.  -E dumps the preprocessed output to stdout.  -P dumps it to
foo.i if preprocessing foo.c

Thanks much,
>

It's a bit like diving into icy cold water.  Horrible when you first enter
but fortifying in the long run, providing it doesn't give you a heart
attack then and there.


> -KenD
> _______________________________________________
> VM-beginners mailing list
> VM-beginners at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/mailman/listinfo/vm-beginners


_,,,^..^,,,_
best, Eliot
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/vm-beginners/attachments/20181208/74e8f92b/attachment.html>


More information about the VM-beginners mailing list