<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - lldb cannot debug an i386 elf (32 bit) executable on an amd64 platform, (FreeBSD 11.1 and 11.2)"
href="https://bugs.llvm.org/show_bug.cgi?id=40287">40287</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>lldb cannot debug an i386 elf (32 bit) executable on an amd64 platform, (FreeBSD 11.1 and 11.2)
</td>
</tr>
<tr>
<th>Product</th>
<td>lldb
</td>
</tr>
<tr>
<th>Version</th>
<td>6.0
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>FreeBSD
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>All Bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>lldb-dev@lists.llvm.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>john.hazard@fisglobal.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>I posted this over a week ago on the BSD forums and while I had 50+ views, not
one reply.
This use to work on FreeBSD 11.0 which I believe was version 3.x.
I have distilled the problem down to the simplest example below. As a note, I
also tried it on the executable BSD utility uptime from a 32bit, i386, platform
snd it fails
prompt>uname -mKr
11.2-RELEASE amd64 1102000
prompt>
Code:
prompt>cat hello.cpp
#include<stdio.h>
int main()
{
printf("Hello World\n");
}
prompt>
Building (CLANG with -m32 and verbose)
prompt>clang++ -m32 -v -static hello.cpp
FreeBSD clang version 6.0.0 (tags/RELEASE_600/final 326565) (based on LLVM
6.0.0)
Target: i386-unknown-freebsd11.2
Thread model: posix
InstalledDir: /usr/bin
"/usr/bin/clang++" -cc1 -triple i386-unknown-freebsd11.2 -emit-obj -mrelax-all
-disable-free -disable-llvm-verifier -discard-value-names -main-file-name
hello.cpp -static-define -mrelocation-model static -mthread-model posix
-mdisable-fp-elim -masm-verbose -mconstructor-aliases -target-cpu i486
-dwarf-column-info -debugger-tuning=gdb -v -resource-dir /usr/lib/clang/6.0.0
-internal-isystem /usr/include/c++/v1 -fdeprecated-macro
-fdebug-compilation-dir
/srctree/release_11_11_b0_test/ridsbase/batch_params/libbatch_params
-ferror-limit 19 -fmessage-length 80 -fobjc-runtime=gnustep -fcxx-exceptions
-fexceptions -fdiagnostics-show-option -fcolor-diagnostics -o
/tmp/hello-669b69.o -x c++ hello.cpp
clang -cc1 version 6.0.0 based upon LLVM 6.0.0 default target
x86_64-unknown-freebsd11.2
#include "..." search starts here:
#include <...> search starts here:
/usr/include/c++/v1
/usr/lib/clang/6.0.0/include
/usr/include
End of search list.
"/usr/bin/ld" --eh-frame-hdr -Bstatic -m elf_i386_fbsd -o a.out
/usr/lib32/crt1.o /usr/lib32/crti.o /usr/lib32/crtbeginT.o -L/usr/lib32
/tmp/hello-669b69.o -lc++ -lm -lgcc -lgcc_eh -lc -lgcc -lgcc_eh
/usr/lib32/crtend.o /usr/lib32/crtn.o
prompt>
Running the program checking the file type:
prompt>file a.out
a.out: ELF 32-bit LSB executable, Intel 80386, version 1 (FreeBSD), statically
linked, for FreeBSD 11.2, FreeBSD-style, not stripped
prompt>./a.out
Hello World
prompt>
prompt>lldb a.out
(lldb) target create "a.out"
Current executable set to 'a.out' (i386).
(lldb) r
Process 25772 launching
Process 25772 launched: './a.out' (i386)
Process 25772 stopped
* thread #1, name = 'a.out', stop reason = signal SIGBUS: hardware error
frame #0: 0xffffffff
error: Bad address
(lldb)
It runs under gdb.
And of course lldb works beautifully on X86-64 elf format.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>