<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </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 --- - On FreeBSD, debugger not entered on explicit debugger trap" href="https://urldefense.proofpoint.com/v2/url?u=https-3A__llvm.org_bugs_show-5Fbug.cgi-3Fid-3D23745&d=AwMBaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=DDUMf06MYELAe1Nlv7KChiwJLLHbYha4jtK_AOiWqwQ&m=RCCPa3hwPbeVLfkZdaAJy29cXkj0BD2mn9KqyonHsTs&s=D7jHXriB8l0LMI45OK_Dw69_WQgJWOYlO3AUYmoCRGo&e=">23745</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>On FreeBSD, debugger not entered on explicit debugger trap
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>lldb
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </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@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>emaste@freebsd.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>In debug mode Chromium calls an explicit debugger trap on fatal conditions. In
gdb this looks like:

feynman% gdb79 work/stage/usr/local/share/chromium/chrome
...
(gdb) run
Starting program:
/tank/emaste/src/ports/www/chromium/work/stage/usr/local/share/chromium/chrome 
...
Program received signal SIGTRAP, Trace/breakpoint trap.
[Switching to Thread 81f406400 (LWP 101775)]
base::debug::(anonymous namespace)::DebugBreak () at
../../base/debug/debugger_posix.cc:228

and I can 'c'ontinue from there.

In LLDB:

% ... bin/lldb work/stage/usr/local/share/chromium/chrome

(lldb) run
Process 72518 launching
** some time later
Process 72518 launched:
'/tank/emaste/src/ports/www/chromium/work/stage/usr/local/share/chromium/chrome'
(x86_64)
** ... then debug output from Chromium:
[72518:524313600:0603/133227:WARNING:internal_linux.cc(58)] Failed to read
/proc/72518/stat
[72518:524313600:0603/133227:FATAL:process_info_linux.cc(20)] Check failed:
start_ticks. 
#0 0x00000187b85e <unknown>
#1 0x0000018c5d66 <unknown>
#2 0x000001917964 <unknown>
#3 0x000005f1d1b0 <unknown>

Then it remains idle, until I press ^C

^C
Process 72518 stopped
(lldb) bt
* thread #18: tid = 103217, 0x000000081bcc14ba libc.so.7`__sys_poll + 10 at
_poll.S:3
  * frame #0: 0x000000081bcc14ba libc.so.7`__sys_poll + 10 at _poll.S:3
    frame #1: 0x0000000819c79d26 libthr.so.3`__thr_poll(fds=<unavailable>,
nfds=<unavailable>, timeout=<unavailable>) + 54 at thr_syscalls.c:318
    frame #2: 0x000000081099c300 libglib-2.0.so.0`??? + 432
    frame #3: 0x000000081099c65f libglib-2.0.so.0`g_main_loop_run + 207
    frame #4: 0x00000008148946eb libgio-2.0.so.0`??? + 27
    frame #5: 0x00000008109c202a libglib-2.0.so.0`??? + 90
    frame #6: 0x0000000819c777c5
libthr.so.3`thread_start(curthread=0x000000081f411800) + 277 at
thr_create.c:288

And then after resuming the expected debugger trap is received:

(lldb) c
Process 72518 resuming
Process 72518 stopped
* thread #1: tid = 104448, 0x000000000187a906 chrome`base::debug::(anonymous
namespace)::DebugBreak() + 22 at debugger_posix.cc:220, stop reason = signal
SIGSTOP
    frame #0: 0x000000000187a906 chrome`base::debug::(anonymous
namespace)::DebugBreak() + 22 at debugger_posix.cc:220
   217      abort();
   218    } else {
   219  #if defined(DEBUG_BREAK_ASM)
-> 220      DEBUG_BREAK_ASM();
   221  #else
   222      volatile int go = 0;
   223      while (!go) {
(lldb)</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>