mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
research st, add gdb info for setjmp.
This commit is contained in:
parent
4b24ee9db3
commit
a27c3dca2d
2 changed files with 18 additions and 2 deletions
|
@ -46,7 +46,23 @@ void func0()
|
||||||
* functions as a setjmp/longjmp replacement wherever they are available
|
* functions as a setjmp/longjmp replacement wherever they are available
|
||||||
* unless USE_LIBC_SETJMP is defined.
|
* unless USE_LIBC_SETJMP is defined.
|
||||||
*/
|
*/
|
||||||
// for glibc 2.4+, it's not possible to get and set the sp in jmp_buf
|
// for glibc 2.4+, it's not possible to get and set the sp in jmp_buf
|
||||||
|
/**
|
||||||
|
for example, the following is show the jmp_buf when setjmp:
|
||||||
|
(gdb) x /64xb env_func1[0].__jmpbuf
|
||||||
|
0x600ca0 <env_func1>: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
|
||||||
|
0x600ca8 <env_func1+8>: 0xf8 0xc1 0x71 0xe5 0xa8 0x88 0xb4 0x15
|
||||||
|
0x600cb0 <env_func1+16>: 0xa0 0x05 0x40 0x00 0x00 0x00 0x00 0x00
|
||||||
|
0x600cb8 <env_func1+24>: 0x90 0xe4 0xff 0xff 0xff 0x7f 0x00 0x00
|
||||||
|
0x600cc0 <env_func1+32>: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
|
||||||
|
0x600cc8 <env_func1+40>: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
|
||||||
|
0x600cd0 <env_func1+48>: 0xf8 0xc1 0x51 0xe5 0xa8 0x88 0xb4 0x15
|
||||||
|
0x600cd8 <env_func1+56>: 0xf8 0xc1 0xd9 0x2f 0xd7 0x77 0x4b 0xea
|
||||||
|
(gdb) p /x $sp
|
||||||
|
$4 = 0x7fffffffe380
|
||||||
|
we cannot finger the sp out.
|
||||||
|
where the glibc is 2.12.
|
||||||
|
*/
|
||||||
register long int rsp0 asm("rsp");
|
register long int rsp0 asm("rsp");
|
||||||
|
|
||||||
int ret = setjmp(env_func1);
|
int ret = setjmp(env_func1);
|
||||||
|
|
|
@ -124,7 +124,7 @@ $(SRS): $(OBJS)
|
||||||
$(TARGETDIR)/md.o: md.S
|
$(TARGETDIR)/md.o: md.S
|
||||||
$(CC) $(CFLAGS) -c $< -o $@
|
$(CC) $(CFLAGS) -c $< -o $@
|
||||||
|
|
||||||
$(TARGETDIR)/%.o: %.c common.h md.h
|
$(TARGETDIR)/%.o: %.c common.h md.h Makefile
|
||||||
$(CC) $(CFLAGS) -c $< -o $@
|
$(CC) $(CFLAGS) -c $< -o $@
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue