dbgr: allow dumping the backtrace to a file (#2284)

Some backtraces are quite large, an option is to increase your terminal
buffer -- but dumping to a file is also useful if you want to share the
crash.

I'm not crazy about the way I hacked this in, but it felt like the least
invasive way for now and I don't want to cause a regression with the
debugger. It's also nice that it dumps with ansi colors as then you can
view the backtrace with the original coloring:


![image](https://user-images.githubusercontent.com/13153231/221460358-991916ad-90f0-445d-ba81-7bc3dbc42eb4.png)

Usage:
```clj
(:di "./stacktrace.log")
```
This commit is contained in:
Tyler Wilding
2023-02-27 18:54:23 -05:00
committed by GitHub
parent adf929d18d
commit 87ff182332
4 changed files with 57 additions and 24 deletions
+1 -1
View File
@@ -182,7 +182,7 @@ TEST(Jak1Debugger, SimpleBreakpoint) {
std::this_thread::sleep_for(std::chrono::milliseconds(100));
}
compiler.get_debugger().update_break_info();
compiler.get_debugger().update_break_info({});
auto expected_instr_before_rip = compiler.get_debugger().get_x86_base_addr() + func_addr;
auto rip = compiler.get_debugger().get_regs().rip;
// instructions can be at most 15 bytes long.