#include "base/cprintf.hh"
-using namespace std;
-
volatile int stop = false;
void
int
main()
{
- stringstream result;
+ std::stringstream result;
int iterations = 0;
signal(SIGALRM, handle_alarm);
do_test(10);
while (!stop) {
- stringstream result;
+ std::stringstream result;
ccprintf(result,
"this is a %s of %d iterations %3.2f %p\n",
"test", iterations, 51.934, &result);
#include "base/logging.hh"
#include "base/str.hh"
-using namespace std;
-
int
main(int argc, char *argv[])
{
for (const Loader::Symbol &symbol: obj->symtab())
cprintf("%#x %s\n", symbol.address, symbol.name);
} else {
- string symbol = argv[2];
+ std::string symbol = argv[2];
Addr address;
if (symbol[0] == '0' && symbol[1] == 'x') {
#include "base/loader/symtab.hh"
#include "base/str.hh"
-using namespace std;
-
void usage(const char *progname);
void
usage(const char *progname)
{
- cout << "Usage: " << progname << " <symbol file> <symbol>" << endl;
+ std::cout << "Usage: " << progname << " <symbol file> <symbol>"
+ << std::endl;
exit(1);
}
usage(argv[0]);
if (!symtab.load(argv[1])) {
- cout << "could not load symbol file: " << argv[1] << endl;
+ std::cout << "could not load symbol file: " << argv[1] << std::endl;
exit(1);
}
- string symbol = argv[2];
+ std::string symbol = argv[2];
Addr address;
if (!to_number(symbol, address)) {
auto it = symtab.find(symbol);
if (it == symtab.end()) {
- cout << "could not find symbol: " << symbol << endl;
+ std::cout << "could not find symbol: " << symbol << std::endl;
exit(1);
}
- cout << symbol << " -> " << "0x" << hex << it->address << endl;
+ std::cout << symbol << " -> " << "0x" << std::hex << it->address <<
+ std::endl;
} else {
auto it = symtab.find(address);
if (it == symtab.end()) {
- cout << "could not find address: " << address << endl;
+ std::cout << "could not find address: " << address << std::endl;
exit(1);
}
- cout << "0x" << hex << address << " -> " << it->name << endl;
+ std::cout << "0x" << std::hex << address << " -> " << it->name <<
+ std::endl;
}
return 0;