Add a warning function to print a formatted string to stderr
A=jim.blandy R=nealsid git-svn-id: http://google-breakpad.googlecode.com/svn/branches/linux-dwarf@396 4c0a9323-5329-0410-9bdc-e9ce6186880e
This commit is contained in:
parent
64892f177d
commit
8583d8ee76
@ -146,6 +146,7 @@ class DumpStabsHandler: public google_breakpad::StabsHandler {
|
||||
bool StartFunction(const std::string &name, uint64_t address);
|
||||
bool EndFunction(uint64_t address);
|
||||
bool Line(uint64_t address, const char *name, int number);
|
||||
void Warning(const char *format, ...);
|
||||
|
||||
// Do any final processing necessary to make module_ contain all the
|
||||
// data provided by the STABS reader.
|
||||
@ -267,6 +268,13 @@ bool DumpStabsHandler::Line(uint64_t address, const char *name, int number) {
|
||||
return true;
|
||||
}
|
||||
|
||||
void DumpStabsHandler::Warning(const char *format, ...) {
|
||||
va_list args;
|
||||
va_start(args, format);
|
||||
vfprintf(stderr, format, args);
|
||||
va_end(args);
|
||||
}
|
||||
|
||||
void DumpStabsHandler::Finalize() {
|
||||
// Sort our boundary list, so we can search it quickly.
|
||||
sort(boundaries_.begin(), boundaries_.end());
|
||||
|
@ -179,8 +179,9 @@ class StabsHandler {
|
||||
}
|
||||
|
||||
// Report a warning. FORMAT is a printf-like format string,
|
||||
// specifying how to format the subsequent arguments.
|
||||
virtual void Warning(const char *format, ...) { }
|
||||
// specifying how to format the subsequent arguments. By default,
|
||||
// print the message to the standard error output.
|
||||
virtual void Warning(const char *format, ...) = 0;
|
||||
};
|
||||
|
||||
} // namespace google_breakpad
|
||||
|
Loading…
Reference in New Issue
Block a user