mirror of
https://github.com/dingusdev/dingusppc.git
synced 2024-12-22 15:29:58 +00:00
debugger: fix ofnvram commands for Nubus machines.
This commit is contained in:
parent
c0078ce97d
commit
b8915f11a2
@ -377,7 +377,6 @@ void enter_debugger() {
|
||||
size_t separator_pos;
|
||||
|
||||
unique_ptr<OfNvramUtils> ofnvram = unique_ptr<OfNvramUtils>(new OfNvramUtils);
|
||||
ofnvram->init();
|
||||
|
||||
context = 1; /* start with the PowerPC context */
|
||||
|
||||
@ -578,11 +577,15 @@ void enter_debugger() {
|
||||
}
|
||||
#endif
|
||||
} else if (cmd == "printenv") {
|
||||
if (ofnvram->init())
|
||||
continue;
|
||||
ofnvram->printenv();
|
||||
} else if (cmd == "setenv") {
|
||||
string var_name, value;
|
||||
ss >> var_name;
|
||||
ss >> value;
|
||||
if (ofnvram->init())
|
||||
continue;
|
||||
ofnvram->setenv(var_name, value);
|
||||
} else {
|
||||
cout << "Unknown command: " << cmd << endl;
|
||||
|
@ -37,9 +37,10 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
using namespace std;
|
||||
|
||||
void OfNvramUtils::init()
|
||||
int OfNvramUtils::init()
|
||||
{
|
||||
this->nvram_obj = dynamic_cast<NVram*>(gMachineObj->get_comp_by_name("NVRAM"));
|
||||
return this->nvram_obj == nullptr;
|
||||
}
|
||||
|
||||
bool OfNvramUtils::validate()
|
||||
|
@ -49,7 +49,7 @@ public:
|
||||
OfNvramUtils() = default;
|
||||
~OfNvramUtils() = default;
|
||||
|
||||
void init();
|
||||
int init();
|
||||
void printenv();
|
||||
void setenv(std::string var_name, std::string value);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user