summaryrefslogtreecommitdiffstats
path: root/src/arch/i386/core
diff options
context:
space:
mode:
authorMichael Brown2007-02-01 03:17:59 +0100
committerMichael Brown2007-02-01 03:17:59 +0100
commitc650c8c84ac18e7403df5cc60c35db8aa80ec4fe (patch)
tree58f7063b6bd4f37b1b879023329bde6f2bf078bf /src/arch/i386/core
parentPlaceholder (diff)
downloadipxe-c650c8c84ac18e7403df5cc60c35db8aa80ec4fe.tar.gz
ipxe-c650c8c84ac18e7403df5cc60c35db8aa80ec4fe.tar.xz
ipxe-c650c8c84ac18e7403df5cc60c35db8aa80ec4fe.zip
Also print out stack pointer (with optional stack dump)
Diffstat (limited to 'src/arch/i386/core')
-rw-r--r--src/arch/i386/core/nulltrap.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/arch/i386/core/nulltrap.c b/src/arch/i386/core/nulltrap.c
index 61fe5564c..3046fbecf 100644
--- a/src/arch/i386/core/nulltrap.c
+++ b/src/arch/i386/core/nulltrap.c
@@ -3,6 +3,7 @@
__attribute__ (( noreturn, section ( ".text.null_trap" ) ))
void null_function_trap ( void ) {
+ void *stack;
/* 128 bytes of NOPs; the idea of this is that if something
* dereferences a NULL pointer and overwrites us, we at least
@@ -42,7 +43,9 @@ void null_function_trap ( void ) {
__asm__ __volatile__ ( "nop ; nop ; nop ; nop" );
__asm__ __volatile__ ( "nop ; nop ; nop ; nop" );
- printf ( "NULL method called from %p\n",
- __builtin_return_address ( 0 ) );
+ __asm__ __volatile__ ( "movl %%esp, %0" : "=r" ( stack ) );
+ printf ( "NULL method called from %p (stack %p)\n",
+ __builtin_return_address ( 0 ), stack );
+ DBG_HD ( stack, 256 );
while ( 1 ) {}
}