This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [SH][PATCH] Disable ABI frame sniffer


Daniel Jacobowitz wrote:
  - Add a way for a sniffer to indicate "I do recognize how to unwind
    this frame, but I recognize it as the end of the stack" to solve
    the current off-by-one problem.  This could be quite nice...

I don't want to mess with the OS or compiler to fix this problem so I have been looking into this suggestion (or at least something in GDB alone).


I started by trying to figure out why the dwarf unwinder appeared to be giving:

#2 0xdeaddead in ?? ()

It turns out that this does not come from here at all - the dwarf sniffer rejects the frame, and yet I thought I had the SH unwinder disabled, so why did it still come out?

In fact, the order of events is (and apologise to all those who know this stuff backwards):

  dwarf sniffer
  sh sniffer
  print message
  sh 'frame this id' (where I had disabled the unwinder).

The obvious thing to do appears to be to disable it in the sh sniffer, but if I have that return NULL, as the dwarf unwinder does, I get an internal error. Not only may this sniffer never reject *any* frame, it is not possible to remove it altogether (i.e. not register it in the first place), because you still get the internal error.

I must conclude therefore that it is not currently possible to reject any 'frame' which precedes (from the point of view of the program) a frame with debug information.

My question is 'where to go from here?'

The above suggestion would require modifying the dwarf sniffer (since the last frame on the stack has dwarf). I can't easily see how to do this because the dwarf data doesn't know it is the end of the stack and unwinding any further seems problematic.

I could modify the sh sniffer such that it actually does something. However, this would require modifying frame_unwind_find_by_frame() and family such that it can accept a NULL answer from every sniffer.

There is, of course, the question of how to detect the end of the stack, short of just searching for the specific case. I could check if it is in memory, but that seems problematic at best - for one thing it assumes we know where memory is. Perhaps I could see if it is in a loaded section?

Any other suggestions?

Thanks

Andrew Stubbs


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]