/srv/irclogs.linaro.org/2018/01/24/#linaro-tcwg.txt

rengolinazanella: psmith_ may know a thing or two10:39
psmith_I wouldn't say I'm well versed, I've encountered them before. I can always try and help if you've got a question?10:40
azanellapsmith_, I am trying to figure out the instructions sequence for split-stack is generating the suffice and correct CFI instructions for stack unwinding10:48
azanellait uses a non-standard function call and generates a non-default stack trace10:48
azanellapsmith_, the function prologue is like https://paste.ubuntu.com/26450440/10:52
azanellapsmith_, basically it branches to a libgcc function if some criteria is met10:52
psmith_Ok. I guess the libgcc function affects sp?10:54
azanellapsmith_, indeed: https://paste.ubuntu.com/26450448/10:54
azanellapsmith_, so the bracktrace should be something like https://paste.ubuntu.com/26450452/10:55
psmith_Ok I see.10:56
psmith_I guess you are wanting to know what the .cfi directives should be in _morestack? Do you need to check those in the callee as well?10:57
azanellapsmith_, yes and the question is whether we need aditional cfi in morestack and/or in the callee itself10:58
azanellacurrently I am not generating any on callee, i.e, the function prologue10:58
psmith_I think you are way out of my league here. My basic understanding comes from Dwarf, Yao or Omair might be able to help as well. The Dwarf frame (or .eh_frame) that comes out describes what happens to the stack for each address in the program. In other words if the stack changes at a particular address, then it will need a .cfi directive at that address. What I don't know is what assumptions are made about function call boundaries.11:03
azanellapsmith_, without -fexceptions I see gdb can't really get a full stacktrace11:10
azanellaand it is seems what is happening on a go test suite (it is segfaulting libgcc/unwind-dw2.c)11:10
psmith_Just thinking is _morestack analogous to alloca?11:11
psmith_In that it is a function that is called that modifies the stack.11:11
psmith_Just been discussing with Yao, it may be worth resending the links/discussion as he won't have seen the past few messages (got booted off into linaro-unregistered)11:13
psmith_I think that it should be the responsibility of the caller to describe the changes to the stack when calling _morestack as that in theory could be skipped over and not read. What I don't know is what .cfi directives should be in _morestack.11:15
azanellapsmith_, yeap it is quite similar, the idea is have disjoint stack areas that a 'glue' together in this non-standard function call11:15
psmith_One silly question, I'm assuming that the amount the stack moves is statically known by at least the caller?11:15
psmith_As _morestack won't know at compile/assembly time how much it is moving the stack.11:16
azanellapsmith_, yeah, on https://paste.ubuntu.com/26450440/ the stack pointer required is materialized on x10, so on morestack the total stack requires is sp-x1011:17
psmith_My guess is that there would need to be cfi directives describing the movement of the stack on an address that is only passed through if _morestack is called. I'm way out of my depth here though, the behaviour of alloca might be a good place to start to look.11:23
psmith_If I can, I'll see if I can get the opinion of our Dwarf generation expert.11:24
psmith_I've arranged to talk to our expert after lunch, if you have any links to how this is supposed to work that I can share with him that will be great.11:28
omjavaidI havnt been looking into DWARF generation in recent years but all information of Call frame information and its management using CFA and CFI directives can be read in dwarf documentation. Dwarf5 can be found here http://dwarfstd.org/doc/DWARF5.pdf ... chapter of interest is 6.4 onwards page 171.11:32
omjavaidyao: I am trying to debug gdb with gdb. My debugee gdb is debugging a application that i need to interrupt. But when i send SIGINT using ctrl+c it halts debugger gdb. I have tried various combinations of signal SIGINT pass/nopass etc but nothing seems to work. Any pointers? I possibly think that this seems to work previously for me but i cant remember how.11:41
yaoomjavaid, do you want to interrupt debuggee gdb or the application?11:42
omjavaidapplication11:43
yaointerrupt the application from debugger gdb or debuggee gdb?11:44
omjavaidi am running application syncronously using run command in debugee gdb.11:44
omjavaidand i send ctrl-c in debuggee to interrupt it11:44
azanellapsmith_, right, I will push my patches in a local repo11:50
psmith_Thanks. I've found your June message to tcwg https://lists.linaro.org/pipermail/linaro-toolchain/2016-June/005767.html and I've found the https://gcc.gnu.org/wiki/SplitStacks . If you have anything specific for me to ask it will be worth putting in an email.11:57
azanellapsmith_, I have updated the patches, let me sort this out so you can point to a more updated one11:58
psmith_Ok, no problem.11:59
azanellapsmith_, https://paste.ubuntu.com/26450878/ I think the commit message for the patches should give the required information12:08
psmith_Thanks. Just for confirmation, you want to know about how to describe the stack using .cfi directives for functions using a split stack and what cfi directives should be in _morestack?12:16
azanellapsmith_, exactly12:16
azanellapsmith_, the idea is to have correct stack trace information (go relies on it)12:17
psmith_I'll run these by our dwarf expert this afternoon. My guess is we may be able to get some guidance on how best to do it, but I doubt we'll be able to get anything specific.12:17
azanellapsmith_, no worries12:18
yrouxmaximk: will you join the call ?13:02
luispmomjavaid, That sounds like the correct way, though the specific combination is unclear.16:43
luispmomjavaid, probably "nostop + pass" in the top gdb and defaults in the bottom gdb?16:46
psmith_azanella: We've run through morestack.S and couldn't see anything obviously wrong. My colleague said that you shouldn't need to add any extra cfi directives to the original function or the prologue. To the best of our knowledge the cfi in morestack.S also looks ok, and looks similar to the other architectures that implement it. My colleague said that he would start stepping through the unwinder to find out where it was going wrong and16:57
psmith_then try and trace back from there. I'm thinking, is it possible to reproduce the unwinding by throwing an exception in C++?16:57
azanellapsmith_, hum indeed trying to use c++ exceptions with it should exercise it, although for -fexception I do see correct backtrace17:00
psmith_I'm wondering if it is something specific either to the exception from the test case, or how go generates its tables. Good luck!17:05
azanellathanks, now I am more inclined to think it is something unrelated to CFI17:11

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!