qemu-log: new option -dfilter to limit output

When debugging big programs or system emulation sometimes you want both
the verbosity of cpu,exec et all but don't want to generate lots of logs
for unneeded stuff. This patch adds a new option -dfilter which allows
you to specify interesting address ranges in the form:

-dfilter 0x8000..0x8fff,0xffffffc000080000+0x200,...

Then logging code can use the new qemu_log_in_addr_range() function to
decide if it will output logging information for the given range.

Backports commit 3514552e04388d8e7686bcf89efd022e892acb5b from qemu
This commit is contained in:
Alex Bennée 2018-02-22 10:00:51 -05:00 committed by Lioncash
parent b895ae38a9
commit 2d401b6f23
No known key found for this signature in database
GPG key ID: 4E3C3CC1031BA9C7
2 changed files with 17 additions and 0 deletions

View file

@ -123,4 +123,7 @@ static inline void qemu_log_close(void)
}
}
void qemu_set_dfilter_ranges(const char *ranges);
bool qemu_log_in_addr_range(uint64_t addr);
#endif

View file

@ -34,3 +34,17 @@ void qemu_log(const char *fmt, ...)
}
va_end(ap);
}
/* Returns true if addr is in our debug filter or no filter defined
*/
bool qemu_log_in_addr_range(uint64_t addr)
{
// Unicorn: stubbed
return true;
}
void qemu_set_dfilter_ranges(const char *filter_spec)
{
// Unicorn: stubbed
}