Mark Morgan Lloyd wrote 18 lines
Pierre Free Pascal wrote:
> Hi Mark,
>
> do you use my patch for mips to
> handle stack?
> Without it, the backtrace doesn't work...
>
> The bad thing is that I submitted it to gdb-patches,
> but it was refused, I was told that $fp should be equal to $sp
> according to ABI...
>
> If you use a stock GDB, try to unpack a recent
> GDB source tree, apply the one line patch below,
> and recompile GDB.
>
> Can you tell us if the backtrace looks better after this?
Thanks Pierre, I'll work on it between other things.
I think I got that patch into the sources from Debian, although it had moved somewhat: I I read things correctly it went into the first of two similar blocks.
Running the program using the modified GDB, I get the same as before:
0 1> which gdb
/usr/local/bin/gdb
0 1> gdb /usr/local/bin/ppcmips
GNU gdb (GDB) 7.0.1-debian
..
(gdb) set arg -h
(gdb) run
Starting program: /usr/local/bin/ppcmips -h
Program received signal SIGBUS, Bus error.
0x0043eb88 in SYSUTILS_$$_UNIXTOWINAGE$LONGINT$$LONGINT () (gdb) bt
#0 0x0043eb88 in SYSUTILS_$$_UNIXTOWINAGE$LONGINT$$LONGINT () #1 0x0043fa6c in
SYSUTILS_$$_FINDGETFILEINFO$ANSISTRING$TSEARCHREC$$BOOLEAN () #2 0x0043fdc4 in SYSUTILS_$$_FINDNEXT$TSEARCHREC$$LONGINT () Backtrace stopped: previous frame inner to this frame (corrupt stack?) (gdb)
A curious thing is that when I first ran it from the build directory without "make install" I appeared to get more info:
Program received signal SIGBUS, Bus error.
0x0043eb88 in SYSUTILS_$$_UNIXTOWINAGE$LONGINT$$LONGINT () (gdb) bt
#0 0x0043eb88 in SYSUTILS_$$_UNIXTOWINAGE$LONGINT$$LONGINT () #1 0x0043fa6c in
SYSUTILS_$$_FINDGETFILEINFO$ANSISTRING$TSEARCHREC$$BOOLEAN () #2 0x0043fdc4 in SYSUTILS_$$_FINDNEXT$TSEARCHREC$$LONGINT () #3 0x00440074 in
SYSUTILS_$$_FINDFIRST$ANSISTRING$LONGINT$TSEARCHREC$$LONGINT () During symbol reading, couldn't parse type; debugger out of date?. #4 0x00453428 in TCACHEDDIRECTORY__RELOAD (this=<error reading variable>) at cfileutl.pas:277
#5 0x00453050 in TCACHEDDIRECTORY__FORCEUSECACHE (this=<error reading variable>) at cfileutl.pas:234
#6 0x00452fd8 in TCACHEDDIRECTORY__TRYUSECACHE (this=<error reading variable>) at cfileutl.pas:223
#7 0x00453ad8 in TCACHEDDIRECTORY__DIRECTORYEXISTS (ANAME=0x2aaa880c 'mipseb-linux',
this=<error reading variable>) at cfileutl.pas:357 #8 0x00454244 in TDIRECTORYCACHE__DIRECTORYEXISTS ( ANAME=0x2aac822c '/usr/local/lib/fpc/2.7.1/units/mipseb-linux', this=<error reading variable>)
at cfileutl.pas:433
#9 0x004555b8 in PATHEXISTS (F=0x2aac826c
'/usr/local/lib/fpc/2.7.1/units/mipseb-linux/', ALLOWCACHE=true) at cfileutl.pas:687
#10 0x00457e40 in TSEARCHPATHLIST__ADDPATH (SRCPATH=0x0, S=0x0, ADDFIRST=true,
this=<error reading variable>) at cfileutl.pas:1131 #11 0x00456b88 in TSEARCHPATHLIST__ADDPATH (S=0x2aac816c '/usr/local/lib/fpc/2.7.1/units/mipseb-linux',
ADDFIRST=true, this=<error reading variable>) at cfileutl.pas:986 #12 0x0063bf64 in TOPTION__INTERPRET_OPTION (
OPT=0x2aab910c
'-Fu/usr/local/lib/fpc/$fpcversion/units/$fpctarget', ISPARA=false, this=<error reading variable>) at options.pas:1146 #13 0x00641724 in TOPTION__INTERPRET_FILE (FILENAME=0x2aaa87ac '/etc/fpc.cfg',
this=<error reading variable>) at options.pas:2237 #14 0x00644358 in READ_ARGUMENTS (CMD=0x0) at options.pas:2932 #15 0x00427f90 in INITCOMPILER (CMD=0x0) at compiler.pas:190 #16 0x004280c0 in COMPILE (CMD=0x0) at compiler.pas:237 #17 0x0040043c in main () at pp.pas:233
(gdb) quit
However I don't entirely trust this since there could be some unholy mix of modified and unmodified libraries.
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk
[Opinions above are the author's, not those of his employers or colleagues]