<mwalle>
i guess thats a 5 stage mips pipeline, which they are discusiing
<larsc>
yes
<mwalle>
and there the exceptions are delayed until the writeback stage
<mwalle>
and then prioritized
<mwalle>
iirc, was yesterday evening in bed and i was half asleep ;)
<mwalle>
anyway, i have another question for you guys ;)
<mwalle>
does gdb support sth like helper functions?
<larsc>
you can write plugins in python
<mwalle>
eg. i upload some data, and a helper function and then call that function, which does something useful with the data
<mwalle>
larsc: yeah but then i can only use the commands the gdbstub supports, right?
<larsc>
yes
<mwalle>
eg. on lm32 i can only do byte access
<larsc>
if you upload extra code I think you can just execute it like normal code
<larsc>
e.g. *((*func)(int, int)0x100000)(10, 20)
<mwalle>
larsc: and gdb sets a breakpont at the function return point automatically?
<mwalle>
or what happens if the functions returns?
<mwalle>
mom brb
<larsc>
hm good question
<larsc>
maybe gdb uses a stub to call the function and has a breakpoint in the stub after the function call
<Fallenou>
21:43 < mwalle> Fallenou: and do i have to do ea=ea-4 for an itlb miss too? < about your question, you were thinking about qemu?
<Fallenou>
or just the code of the exception vector ?
<wpwrak>
larsc: i concur. i did that sort of thing in umlsim. you may not even need a stub, but having at least a known to be good instruction outside the code path as the return target can't hurt.
<larsc>
hm
<larsc>
set a breakpoint at some random address and setup your stackframe to have ra point to that address
<larsc>
should work i guess
<mwalle>
Fallenou: both and consistency ;)
<wpwrak>
that would depend on which exception has priority. e.g., if the breakpoint location has an invalid opcode, generates a TLB miss, etc., then you may have several things competing. may get messy to sort them out.
<wpwrak>
ah, and if you don't have hw breakpoints, you don't have that problem anyway, since you need to write the trap instruction(s) :)
<mwalle>
but i guess nobody acutally knows how the 'call' command in gdb internally works? :)
<larsc>
it's magic
<wpwrak>
i'd set up the stack frame (you get all the necessary information about argument types and such from the DWARF data), set up the return trap, then preload the necessary registers and let things run
<wpwrak>
when you regain control you either get some exception, a breakpoint somewhere inside the call, or the return trap
<wpwrak>
in the latter case, you retrieve the return value, do any cleanup needed, and put the return value to good use
<mwalle>
ok, but if gdb already supports calling functions, why should i do it by hand? :)
<mwalle>
wpwrak: but yes that should be sufficient for a short helper, i dont even need the calling conventions.. i could preload some registers, do sth useful and trap
<mwalle>
(saving the registers of course)
<wpwrak>
what i mean is: this is how i've done it (successfully) in umlsim and it seems likely that gdb does something similar.
<wpwrak>
(umlsim includes what is basically a debugger that can be scripted in a variant of C)
<wpwrak>
x86 only, though. i never extended is to amd64. also, the "uml" part of it (User-Mode Linux) stopped working at some point in time. umlsim uses UML to control the kernel's idea of time. so you can, say, have two linux systems run and let them communicate via TCP over a link with a 100 ms delay.
<wpwrak>
or run sleep 3600 in a shell and have it return immediately, with "date" before and after showing that an hour has passed
<Fallenou>
mwalle: the teachers seem very experienced :)
jimmythehorn_ has joined #milkymist
jimmythehorn has quit [Read error: Connection reset by peer]
jimmythehorn_ is now known as jimmythehorn
mumptai has quit [Quit: Verlassend]
jimmythehorn has quit [Read error: Connection reset by peer]
jimmythehorn has joined #milkymist
kristianpaul has quit [Ping timeout: 260 seconds]
kristianpaul has joined #milkymist
kristianpaul has quit [Changing host]
kristianpaul has joined #milkymist
jimmythehorn_ has joined #milkymist
jimmythehorn has quit [Read error: Connection reset by peer]
jimmythehorn_ is now known as jimmythehorn
jimmythehorn_ has joined #milkymist
jimmythehorn has quit [Read error: Connection reset by peer]
jimmythehorn_ is now known as jimmythehorn
<mwalle>
Fallenou: yeah and the course is actually about superscalar cpus
<mwalle>
wpwrak: (umlsim) nice ;)
jimmythehorn has quit [Read error: Connection reset by peer]