Re: PATCH: Fix MI stack frame output for synthetic frames

Jason Molenda
2002-11-08T22:46:25Z

[-- Attachment #1: Type: text/plain, Size: 677 bytes --]

On Fri, Nov 08, 2002 at 05:38:38PM -0500, Andrew Cagney wrote:

> It should be possible to test the "<function called from gdb>" case.
> All the more main-stream architectures now use dummy-frames so any one
> of them can be used for the test.
>
> Can you do that?

OK, I'll write up an MI test case for this and re-post the whole
patch a bit later (off to help a user just now :-). I can also
test the signal handler frame one a la gdb.base/signals.exp easily
enough.

For the tests I added to the Apple gdb, I use the following C file
to test various cases (the function bar() I used for verifying
unwindonsignal was working correctly) in MI and CLI mode.

Thanks,

J

[-- Attachment #2: inf-call-interrupt.c --]
[-- Type: text/plain, Size: 577 bytes --]

#include <signal.h>
#include <unistd.h>
#include <stdlib.h>

void foo (void);
void bar (void);

void subroutine (int);

void handler (int);

main ()
{
puts ("Starting up");

foo ();

puts ("Waiting to get a signal");

signal (SIGALRM, handler);
alarm (1);
sleep (2);

puts ("Shutting down");
}

void
foo (void)
{
puts ("hi in foo");
}

void
bar (void)
{
char *nuller = 0;

puts ("hi in bar");

*nuller = 'a'; /* try to cause a segfault */
}

void
handler (int sig)
{
subroutine (sig);
}

void
subroutine (int in)
{
while (in < 100)
in++;
}