mirror of
https://github.com/yuzu-emu/breakpad.git
synced 2025-01-11 02:35:35 +00:00
Issue 26001: Linux dumper: fix comments in STABS reader
Typos; ambiguities; dangling references to arguments whose names got changed. a=jimblandy, r=nealsid git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@445 4c0a9323-5329-0410-9bdc-e9ce6186880e
This commit is contained in:
parent
7f941f990a
commit
08fecb2e43
|
@ -112,9 +112,9 @@ bool StabsReader::ProcessCompilationUnit() {
|
||||||
symbol_++;
|
symbol_++;
|
||||||
|
|
||||||
// The STABS documentation says that some compilers may emit
|
// The STABS documentation says that some compilers may emit
|
||||||
// additional N_SO units with names immediately following the first,
|
// additional N_SO entries with names immediately following the
|
||||||
// and that they should be ignored. However, the original Breakpad
|
// first, and that they should be ignored. However, the original
|
||||||
// STABS reader doesn't ignore them, so we won't either.
|
// Breakpad STABS reader doesn't ignore them, so we won't either.
|
||||||
|
|
||||||
// Process the body of the compilation unit, up to the next N_SO.
|
// Process the body of the compilation unit, up to the next N_SO.
|
||||||
while (symbol_ < symbols_end_ && symbol_->n_type != N_SO) {
|
while (symbol_ < symbols_end_ && symbol_->n_type != N_SO) {
|
||||||
|
|
|
@ -54,8 +54,8 @@ class StabsReader {
|
||||||
// Create a reader for the STABS debug information whose .stab
|
// Create a reader for the STABS debug information whose .stab
|
||||||
// section is the STAB_SIZE bytes at STAB, and whose .stabstr
|
// section is the STAB_SIZE bytes at STAB, and whose .stabstr
|
||||||
// section is the STABSTR_SIZE bytes at STABSTR. The reader will
|
// section is the STABSTR_SIZE bytes at STABSTR. The reader will
|
||||||
// call the methods of HANDLER to report the information it finds,
|
// call the member functions of HANDLER to report the information it
|
||||||
// when the reader's 'process' method is called.
|
// finds, when the reader's 'Process' member function is called.
|
||||||
//
|
//
|
||||||
// Note that, in ELF, the .stabstr section should be found using the
|
// Note that, in ELF, the .stabstr section should be found using the
|
||||||
// 'sh_link' field of the .stab section header, not by name.
|
// 'sh_link' field of the .stab section header, not by name.
|
||||||
|
@ -63,9 +63,9 @@ class StabsReader {
|
||||||
const uint8_t *stabstr, size_t stabstr_size,
|
const uint8_t *stabstr, size_t stabstr_size,
|
||||||
StabsHandler *handler);
|
StabsHandler *handler);
|
||||||
|
|
||||||
// Process the STAB data, calling the handler's methods to report
|
// Process the STABS data, calling the handler's member functions to
|
||||||
// what we find. While the handler functions return true, continue
|
// report what we find. While the handler functions return true,
|
||||||
// to process until we reach the end of the section. If we
|
// continue to process until we reach the end of the section. If we
|
||||||
// processed the entire section and all handlers returned true,
|
// processed the entire section and all handlers returned true,
|
||||||
// return true. If any handler returned false, return false.
|
// return true. If any handler returned false, return false.
|
||||||
bool Process();
|
bool Process();
|
||||||
|
@ -101,12 +101,13 @@ class StabsReader {
|
||||||
const char *current_source_file_;
|
const char *current_source_file_;
|
||||||
};
|
};
|
||||||
|
|
||||||
// Consumer-provided callback structure for the STABS reader.
|
// Consumer-provided callback structure for the STABS reader. Clients
|
||||||
// Clients of the STABS reader provide an instance of this structure.
|
// of the STABS reader provide an instance of this structure. The
|
||||||
// The reader then invokes the methods of that instance to report the
|
// reader then invokes the member functions of that instance to report
|
||||||
// information it finds.
|
// the information it finds.
|
||||||
//
|
//
|
||||||
// The default definitions of the methods do nothing.
|
// The default definitions of the member functions do nothing, and return
|
||||||
|
// true so processing will continue.
|
||||||
class StabsHandler {
|
class StabsHandler {
|
||||||
public:
|
public:
|
||||||
StabsHandler() { }
|
StabsHandler() { }
|
||||||
|
@ -134,9 +135,10 @@ class StabsHandler {
|
||||||
// file names.
|
// file names.
|
||||||
//
|
//
|
||||||
// Thus, it's safe to use (say) std::map<char *, ...>, which does
|
// Thus, it's safe to use (say) std::map<char *, ...>, which does
|
||||||
// address comparisons. Since all the pointers are into the array
|
// string address comparisons, not string content comparisons.
|
||||||
// holding the .stabstr section's contents, comparing them produces
|
// Since all the strings are in same array of characters --- the
|
||||||
// predictable results.
|
// .stabstr section --- comparing their addresses produces
|
||||||
|
// predictable, if not lexicographically meaningful, results.
|
||||||
|
|
||||||
// Begin processing a compilation unit whose main source file is
|
// Begin processing a compilation unit whose main source file is
|
||||||
// named FILENAME, and whose base address is ADDRESS. If
|
// named FILENAME, and whose base address is ADDRESS. If
|
||||||
|
@ -147,10 +149,10 @@ class StabsHandler {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Finish processing the compilation unit. If END_ADDRESS is
|
// Finish processing the compilation unit. If ADDRESS is non-zero,
|
||||||
// non-zero, it is the ending address of the compilation unit. This
|
// it is the ending address of the compilation unit. If ADDRESS is
|
||||||
// information may not be available, in which case the consumer must
|
// zero, then the compilation unit's ending address is not
|
||||||
// infer it by other means.
|
// available, and the consumer must infer it by other means.
|
||||||
virtual bool EndCompilationUnit(uint64_t address) { return true; }
|
virtual bool EndCompilationUnit(uint64_t address) { return true; }
|
||||||
|
|
||||||
// Begin processing a function named NAME, whose starting address is
|
// Begin processing a function named NAME, whose starting address is
|
||||||
|
@ -161,14 +163,16 @@ class StabsHandler {
|
||||||
// .stabstr section; this is because the name as it appears in the
|
// .stabstr section; this is because the name as it appears in the
|
||||||
// STABS data is followed by type information. The value passed to
|
// STABS data is followed by type information. The value passed to
|
||||||
// StartFunction is the function name alone.
|
// StartFunction is the function name alone.
|
||||||
|
//
|
||||||
|
// In languages that use name mangling, like C++, NAME is mangled.
|
||||||
virtual bool StartFunction(const std::string &name, uint64_t address) {
|
virtual bool StartFunction(const std::string &name, uint64_t address) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Finishing processing the function. If END_ADDRESS is non-zero,
|
// Finish processing the function. If ADDRESS is non-zero, it is
|
||||||
// it is the ending address for the function. This information may
|
// the ending address for the function. If ADDRESS is zero, then
|
||||||
// not be available, in which case the consumer must infer it by
|
// the function's ending address is not available, and the consumer
|
||||||
// other means.
|
// must infer it by other means.
|
||||||
virtual bool EndFunction(uint64_t address) { return true; }
|
virtual bool EndFunction(uint64_t address) { return true; }
|
||||||
|
|
||||||
// Report that the code at ADDRESS is attributable to line NUMBER of
|
// Report that the code at ADDRESS is attributable to line NUMBER of
|
||||||
|
|
Loading…
Reference in a new issue