Minor fixes.

base/loader/ecoff_object.cc:
    Only warn (not die) if we can't load symbols from an ecoff object.
sim/debug.cc:
    Compile in functioning debug_break unless NDEBUG,
    not only if DEBUG.  Print warning if we hit breakpoint
    when compiled with NDEBUG.
sim/debug.hh:
    Compile in functioning debug_break unless NDEBUG,
    not only if DEBUG.

--HG--
extra : convert_revision : baef2caac4a9c88e1389660823eaa7c42b1d19c8
This commit is contained in:
Steve Reinhardt 2004-11-18 10:52:56 -05:00
parent 171ebf16be
commit 7bac427874
3 changed files with 10 additions and 12 deletions

View file

@ -108,14 +108,14 @@ EcoffObject::loadGlobalSymbols(SymbolTable *symtab)
return false;
if (fileHdr->f_magic != ECOFF_MAGIC_ALPHA) {
cprintf("wrong magic\n");
warn("loadGlobalSymbols: wrong magic on %s\n", filename);
return false;
}
ecoff_symhdr *syms = (ecoff_symhdr *)(fileData + fileHdr->f_symptr);
if (syms->magic != magicSym2) {
cprintf("bad symbol header magic\n");
exit(1);
warn("loadGlobalSymbols: bad symbol header magic on %s\n", filename);
return false;
}
ecoff_extsym *ext_syms = (ecoff_extsym *)(fileData + syms->cbExtOffset);
@ -137,14 +137,14 @@ EcoffObject::loadLocalSymbols(SymbolTable *symtab)
return false;
if (fileHdr->f_magic != ECOFF_MAGIC_ALPHA) {
cprintf("wrong magic\n");
warn("loadGlobalSymbols: wrong magic on %s\n", filename);
return false;
}
ecoff_symhdr *syms = (ecoff_symhdr *)(fileData + fileHdr->f_symptr);
if (syms->magic != magicSym2) {
cprintf("bad symbol header magic\n");
exit(1);
warn("loadGlobalSymbols: bad symbol header magic on %s\n", filename);
return false;
}
ecoff_sym *local_syms = (ecoff_sym *)(fileData + syms->cbSymOffset);

View file

@ -40,13 +40,15 @@
using namespace std;
#ifdef DEBUG
void
debug_break()
{
#ifndef NDEBUG
kill(getpid(), SIGTRAP);
}
#else
cprintf("debug_break suppressed, compiled with NDEBUG\n");
#endif
}
//
// Debug event: place a breakpoint on the process function and

View file

@ -29,10 +29,6 @@
#ifndef __DEBUG_HH__
#define __DEBUG_HH__
#ifdef DEBUG
void debug_break();
#else
inline void debug_break() { }
#endif
#endif // __DEBUG_HH__