oxidecomputer / humility

Debugger for Hubris
Mozilla Public License 2.0
526 stars 50 forks source link

Support ringbufs with `count: u16` #476

Closed mkeeter closed 5 months ago

mkeeter commented 5 months ago

This is a small fix, followed by a zillion lines of new test suite output (because I added a dump with a u16-flavored ringbuf).

Fixes #475; bumps the Humility version to 0.11.4

mkeeter commented 5 months ago

@hawkw I'm not sure if the counters ipc tests should be failing on the new archive, e.g.

$ humility -d tests/cmd/cores/hubris.core.u16-ringbuf counters ipc
humility: attached to dump
humility counters failed: read of 4704 bytes from invalid address: 0x24000490

Is that expected for a single-task dump?

mkeeter commented 5 months ago

Ah, it looks like we load the full task table:

        let task_table = {
            let (base, task_count) = hubris.task_table(core)?;
            let task_t = hubris.lookup_struct_byname("Task")?.clone();
            humility_doppel::Task::load_tcbs(
                hubris,
                core,
                base,
                task_count as usize,
                &task_t,
            )?
        };

which isn't populated for single-task dumps.

We could make this command more flexible, only loading the task table if available (and using a dummy value for generation otherwise), but that shouldn't block this PR.

hawkw commented 5 months ago

Ah, it looks like we load the full task table:

        let task_table = {
            let (base, task_count) = hubris.task_table(core)?;
            let task_t = hubris.lookup_struct_byname("Task")?.clone();
            humility_doppel::Task::load_tcbs(
                hubris,
                core,
                base,
                task_count as usize,
                &task_t,
            )?
        };

which isn't populated for single-task dumps.

We could make this command more flexible, only loading the task table if available (and using a dummy value for generation otherwise), but that shouldn't block this PR.

477 fixes this; it depends on this branch in order to update the tests for the dump you've added. So, once we get this merged, we can merge the fix for single-task dumps as well.