顯示具有 Utility 標籤的文章。 顯示所有文章
顯示具有 Utility 標籤的文章。 顯示所有文章

2013年8月24日

Remvoe file with "-"

Try "rm -rf ./--FILE"

2010年4月16日

Add persistent static routing rule into Windows.


C:\> route -p add 10.10.10.0 mask 255.255.255.0 192.168.1.1 metric 1

This writes the persistent route to the following Windows Registry key as a string value (REG_SZ):

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\PersistentRoutes

From: http://www.itsyourip.com/networking/howto-add-persistent-static-routes-in-windows/

2010年4月7日

Coresump Analysis (arm-linux-uclibc-gdb)

[root@porter tmp]# arm-linux-uclibc-gdb /tftpboot/web_httpd
GNU gdb 6.8
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=i386-redhat-linux --target=arm-linux-uclibc"...
(gdb) set solib-search-path /tmp/libs
(gdb) core-file /tftpboot/coredump
warning: exec file is newer than core file.
warning: .dynamic section for "/lib/libpthread.so.0" is not at the expected address (wrong library or version mismatch?)
warning: .dynamic section for "/lib/libgcc_s.so.1" is not at the expected address (wrong library or version mismatch?)
Reading symbols from /tmp/libs/libm.so.0...done.
Loaded symbols for /tmp/libs/libm.so.0
Reading symbols from /lib/libpthread.so.0...done.
Loaded symbols for /lib/libpthread.so.0
Reading symbols from /tmp/libs/libssl.so.0.9.8...done.
Loaded symbols for /tmp/libs/libssl.so.0.9.8
Reading symbols from /tmp/libs/libcrypto.so.0.9.8...done.
Loaded symbols for /tmp/libs/libcrypto.so.0.9.8
Reading symbols from /lib/libgcc_s.so.1...done.
Loaded symbols for /lib/libgcc_s.so.1
Reading symbols from /tmp/libs/libc.so.0...done.
Loaded symbols for /tmp/libs/libc.so.0
Reading symbols from /tmp/libs/librt.so.0...done.
Loaded symbols for /tmp/libs/librt.so.0
Reading symbols from /tmp/libs/libdl.so.0...done.
Loaded symbols for /tmp/libs/libdl.so.0
Reading symbols from /tmp/libs/ld-uClibc.so.0...done.
Loaded symbols for /tmp/libs/ld-uClibc.so.0
Core was generated by `web_httpd -h /web'.
Program terminated with signal 11, Segmentation fault.
[New process 1555]
[New process 1554]
[New process 1528]
#0 0x40210444 in select () from /tmp/libs/libc.so.0
(gdb) where
#0 0x40210444 in select () from /tmp/libs/libc.so.0
#1 0x40012358 in sys_wait_for_event_msg (n=15, readfds=0x81c0, writefds=0x0,
exceptfds=0x0, timeout=0x0, msg=0x0) at libsys.c:2665
#2 0x00012cec in web_mgr_mainloop () at web_mgr.c:336
#3 0x40081394 in ?? ()
Backtrace stopped: frame did not save the PC
(gdb)

2010年1月14日

Trigger CoreDump under Linux

Enable core dumps:
#> ulimit -c unlimited

Force a core dump with following signals:

SIGQUIT 3 Core Quit from keyboard
SIGILL 4 Core Illegal Instruction
SIGABRT 6 Core Abort signal from abort(3)
SIGFPE 8 Core Floating point exception
SIGSEGV 11 Core Invalid memory reference

2009年11月22日

J-Link Commander

SEGGER J-Link Commander V4.09p ('?' for help)
Compiled Oct 28 2009 17:33:31
DLL version V4.09p, compiled Oct 28 2009 17:33:00
Firmware: J-Link ARM V8 compiled Oct 27 2009 18:08:30
Hardware: V8.00
S/N : 20090626
Feature(s) : RDI,FlashDL,FlashBP,JFlash,GDBFull
VTarget = 3.248V
Info: TotalIRLen = 10, IRPrint = 0x0021
Found 2 JTAG devices, Total IRLen = 5:
[Porter] -- Dual core is identified. #1 is the main host CPU, #0 is a DSP. Thus, all command sets should be set to #1 CPU.
#0 Id: 0x07B3645B, IRLen: 05, IRPrint: 0x1, ARM1136 Core
#1 Id: 0x07B3645B, IRLen: 05, IRPrint: 0x1, ARM1136 Core
ARM11 identified.
JTAG speed: 1000 kHz

[Porter] -- Use "Config" to tell commander that we'll work on #1 CPU.
J-Link>Config 5,1
Info: TotalIRLen = 10, IRPrint = 0x0021
Found 2 JTAG devices, Total IRLen = 5:
#0 Id: 0x07B3645B, IRLen: 05, IRPrint: 0x1, ARM1136 Core
#1 Id: 0x07B3645B, IRLen: 05, IRPrint: 0x1, ARM1136 Core
ARM11 identified.
J-Link>

[Porter] -- Halt CPU.
J-Link>h
Info: CP15.0.0: 0x4117B365: ARM, Architecture 6
Info: CP15.0.1: 0x1D9D29D2: ICache: 64kB (4*512*32), DCache: 64kB (4*512*32)
DIDR: 6 Breakpoints available and 2 Watchpoints available.
J-Link>h
PC: (R15) = AA6F8300, CPSR = 000001D7 (ABORT mode, ARM FIQ dis. IRQ dis.)
R0 = 00000000, R1 = 46521804, R2 = 04008000, R3 = 0003C000
R4 = 40000000, R5 = 00002000, R6 = 000C2084, R7 = 04000080
USR: R8 =428020C8, R9 =11410AC8, R10=00000000, R11 =C0C18004, R12 =00009020
R13=02A48501, R14=F0940315
FIQ: R8 =02002000, R9 =00035604, R10=C8048010, R11 =40108900, R12 =E1060000
R13=00801100, R14=00020980, SPSR=00000010
SVC: R13=0083523C, R14=00040000, SPSR=00000010
ABT: R13=6086010A, R14=C0000004, SPSR=000001D3
IRQ: R13=0201D008, R14=00140110, SPSR=00000010
UND: R13=44328000, R14=00400800, SPSR=00000010
J-Link>
[Porter] -- Load boot loader binary to RAM. The base is 0x80000000.
J-Link>loadbin c:/arm/u-boot.bin 0x80000000
Loading binary file... [c:/arm/u-boot.bin]
Writing bin data into target memory @ 0x80000000.
J-Link>

[Porter] -- Set program counter to 0x80000000 and then run.
J-Link>setpc 0x80000000
J-Link>g