On Wed, 2004-08-18 at 11:54, Tobias Nurmiranta wrote:> Hi,
>
> This is regarding the backend for garbage collection. My problem might be
> related to some strange memory fault created by my frontend, but I'll
try
> here to get some feedback.
Okay. I'm not an expert on GC but I'll take a look ...
> For some strange reason I get segmentation fault in process_pointer in
> semispace.c (I've implemented a small collector, hopefully :). The
fault
> occurs when I do:
>
> printf("process_root[0x%p] = 0x%p\n", (void*) Root, (void*)
*Root);
>
> I.e, when I reference Root.
I don't know what "Root" is but possibly the %p substitution with
"*Root" isn't valid.
> My frontend creates llvm assembly with llvm-gcroot in the following
> manner:
>
> ...
> %r22 = alloca uint ;; typetagged integers/pointers
> %r23 = cast uint* %r22 to sbyte**
> call void %llvm.gcroot(sbyte** %r23, sbyte* null)
> ...
>
> So Root should be a valid pointer to the program stack. It traces two
> roots before the segmentation fault.
Well, Root may be valid, but combining "%p" with *Root probably
isn't.
> Any ideas?
>
> Btw, can I run llvm-db with llvm assembly as source language?
Yes, but you'd have to manually insert the debugging support information
which would be tedious. You'd be better off doing something like writing
a debug info insertion pass and applying it to the Module. This way you
can use llvmAsmParser to get a module, apply the pass and then the
bcwriter to create the bytecode with the debug info in it.
Reid
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL:
<http://lists.llvm.org/pipermail/llvm-dev/attachments/20040818/94211baa/attachment.sig>