[lldb-dev] How can I detect that LLDB is running from within the test suite?

Greg Clayton gclayton at apple.com
Wed Dec 10 16:58:05 PST 2014


> On Dec 10, 2014, at 3:45 PM, Zachary Turner <zturner at google.com> wrote:
> 
> When the test suite runs, there's a few things I need to do differently than when the test suite doesn't run.
> 
> 1) I need to configure Windows so that instead of popping up an error dialog and waiting for user interaction whenever we crash, it just silently crashes and generates a dump.

You aren't manually popping up an alert from a command line tool are you? Is this something built into windows? Or is this LLDB that is crashing? If it is LLDB or python that is crashing, then I can see adding something to detect this. 

> 2) I need to force inferiors to launch without a console window.
> 
> Both of these things are very Windows-specific, so if I were to add a method to the public API, the method wouldn't make sense for other platforms.
> 
> Also, #2 is probably something that we always want when running from the test suite, but #1 is something that I can imagine wanting to be configurable.  For example, when running the test suite on a build bot, obviously we must not have any popups that require user interaction.  But when running the test suite locally, we would want the popup so that we can easily attach a debugger and figure out why the test is crashing.

I would never pop anything up in a dialog box if possible. If you are debugging a process and it crashes, the debugger should show you the crash. 

> Any thoughts as to the best way to achieve this?  One idea I had was to have the test suite set an environment variable, and have LLDB look for this environment variable.  That seems like a bit of a hack, so I'm open to other suggestions.

If this is detecting when LLDB or python crashes, then I would suppress this using an environment variable that is set by something in lldbtest.py for windows only.







More information about the lldb-dev mailing list