gdb debug fork spawnv

78 篇文章 0 订阅
mv out/debug/host/linux-x86/pr/sim/symbols/system/bin/dexopt out/debug/host/linux-x86/pr/sim/symbols/system/bin/dexopt.bin


vi out/debug/host/linux-x86/pr/sim/symbols/system/bin/dexopt 
#!/bin/sh
xterm -e gdb --args dexopt.bin $@


set follow-fork-mode child


export ANDROID_ROOT=/media/linux/1/android-20120605-2.3.4_r1/out/debug/host/linux-x86/pr/sim/system
export BOOTCLASSPATH=/media/linux/1/android-20120605-2.3.4_r1/out/debug/host/linux-x86/pr/sim/system/framework/core.jar
export ANDROID_DATA=/tmp/dalvik_leon



spawnv


gdb out/debug/host/linux-x86/pr/sim/symbols/system/bin/dalvikvm
set solib-search-path /media/linux/1/android-20120605-2.3.4_r1/out/debug/host/linux-x86/pr/sim/symbols/system/lib/
set follow-fork-mode child
b main
run -Xint:portable -cp foo.jar Foo
b dvmOptimizeDexFile
dvmContinueOptimization
b dalvik/vm/oo/Class.c:4513
(gdb) info b
4       breakpoint     keep y   0x00271a27 in dvmClassStartup
                                       at dalvik/vm/oo/Class.c:312 inf 2, 1
breakpoint already hit 2 times
5       breakpoint     keep y   0x0024e724 in dvmOptimizeDexFile
                                       at dalvik/vm/analysis/DexPrepare.c:299 inf 2, 1
breakpoint already hit 1 time
6       breakpoint     keep y   0x0022b097 in dvmJarFileOpen at dalvik/vm/JarFile.c:188 inf 2, 1
breakpoint already hit 1 time
7       breakpoint     keep y   0x0024e724 in dvmOptimizeDexFile
                                       at dalvik/vm/analysis/DexPrepare.c:299 inf 2, 1
breakpoint already hit 1 time
8       breakpoint     keep y   0x0024d307 in dvmContinueOptimization
                                       at dalvik/vm/analysis/DexPrepare.c:476 inf 2, 1
breakpoint already hit 1 time
9       breakpoint     keep y   0x0024d354 in dvmContinueOptimization
                                       at dalvik/vm/analysis/DexPrepare.c:498 inf 2, 1
c
show follow-fork-mode
show detach-on-fork
run  -cp foo.jar Foo
clear main
b dvmClassStartup
dalvik\vm\analysis\DexPrepare.c
b dvmOptimizeDexFile
info source
help status
info local
b dvmCreateStockExceptions
c
run -cp foo.jar Foo
b dvmInterpret
b dalvik/vm/interp/Interp.c:1340
clear dvmInterpret
clear dalvik/vm/interp/Interp.c:1340
bt
b dalvik/dalvikvm/Main.c:212
s
b dvmStartup
clear dvmStartup
b dvmPrepMainThread
clear dvmPrepMainThread
b dalvik/vm/Thread.c:844
clear dalvik/vm/Thread.c:844
clear main
b dvmGetSystemClassLoader
c
clear dvmGetSystemClassLoader
b dvmInitClass
b dalvik/vm/oo/Class.c:4513
ignore 5 59
clear dvmInitClass
frame 13
c
p *clazz
finish 
p *clazz


bt
c
shell
b dalvik/vm/Init.c:1316
b dvmCheckException
info b
clear dvmCheckException
b dvmThreadSelf
clear dvmThreadSelf
p self->exception
Breakpoint 6, dvmCheckException (self=0x804e4e0) at dalvik/vm/Exception.h:128
128    return (self->exception != NULL);
Breakpoint 5, dvmThreadSelf () at dalvik/vm/Thread.c:1111
1111    return (Thread*) pthread_getspecific(gDvm.pthreadKeySelf);


root@ubuntu:/media/linux/1/android-20120605-2.3.4_r1# gdb out/debug/host/linux-x86/pr/sim/symbols/system/bin/dalvikvm
GNU gdb (GDB) 7.2-ubuntu
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
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 "i686-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /media/linux/1/android-20120605-2.3.4_r1/out/debug/host/linux-x86/pr/sim/symbols/system/bin/dalvikvm...done.
(gdb) set solib-search-path /media/linux/1/android-20120605-2.3.4_r1/out/debug/host/linux-x86/pr/sim/symbols/system/lib/
(gdb) b main
Breakpoint 1 at 0x804874a: file dalvik/dalvikvm/Main.c, line 152.
(gdb) run -Xint:portable -cp foo.jar Foo
Starting program: /media/linux/1/android-20120605-2.3.4_r1/out/debug/host/linux-x86/pr/sim/symbols/system/bin/dalvikvm -Xint:portable -cp foo.jar Foo
[Thread debugging using libthread_db enabled]


Breakpoint 1, main (argc=5, argv=0xbffff224) at dalvik/dalvikvm/Main.c:152
152    setvbuf(stdout, NULL, _IONBF, 0);
(gdb) b dvmOptimizeDexFile
Breakpoint 2 at 0x207724: file dalvik/vm/analysis/DexPrepare.c, line 299.
(gdb) c
Continuing.
E/dalvikvm( 5239): ERROR: must specify non-'.' bootclasspath
W/dalvikvm( 5239): JNI_CreateJavaVM failed
Dalvik VM init failed (check log file)


Program exited with code 01.
(gdb) q
root@ubuntu:/media/linux/1/android-20120605-2.3.4_r1# export ANDROID_ROOT=/media/linux/1/android-20120605-2.3.4_r1/out/debug/host/linux-x86/pr/sim/system
root@ubuntu:/media/linux/1/android-20120605-2.3.4_r1# export BOOTCLASSPATH=/media/linux/1/android-20120605-2.3.4_r1/out/debug/host/linux-x86/pr/sim/system/framework/core.jar
root@ubuntu:/media/linux/1/android-20120605-2.3.4_r1# export ANDROID_DATA=/tmp/dalvik_leon
root@ubuntu:/media/linux/1/android-20120605-2.3.4_r1# gdb out/debug/host/linux-x86/pr/sim/symbols/system/bin/dalvikvm
GNU gdb (GDB) 7.2-ubuntu
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
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 "i686-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /media/linux/1/android-20120605-2.3.4_r1/out/debug/host/linux-x86/pr/sim/symbols/system/bin/dalvikvm...done.
(gdb) set solib-search-path /media/linux/1/android-20120605-2.3.4_r1/out/debug/host/linux-x86/pr/sim/symbols/system/lib/
(gdb) b main
Breakpoint 1 at 0x804874a: file dalvik/dalvikvm/Main.c, line 152.
(gdb) run -Xint:portable -cp foo.jar Foo
Starting program: /media/linux/1/android-20120605-2.3.4_r1/out/debug/host/linux-x86/pr/sim/symbols/system/bin/dalvikvm -Xint:portable -cp foo.jar Foo
[Thread debugging using libthread_db enabled]


Breakpoint 1, main (argc=5, argv=0xbffff134) at dalvik/dalvikvm/Main.c:152
152    setvbuf(stdout, NULL, _IONBF, 0);
(gdb) b dvmOptimizeDexFile
Breakpoint 2 at 0x207724: file dalvik/vm/analysis/DexPrepare.c, line 299.
(gdb) c
Continuing.
E/dalvikvm( 5689): Can't open dex cache '/tmp/dalvik_leon/dalvik-cache/media@linux@1@android-20120605-2.3.4_r1@out@debug@host@linux-x86@pr@sim@system@framework@core.jar@classes.dex': No such file or directory
I/dalvikvm( 5689): Unable to open or create cache for /media/linux/1/android-20120605-2.3.4_r1/out/debug/host/linux-x86/pr/sim/system/framework/core.jar (/tmp/dalvik_leon/dalvik-cache/media@linux@1@android-20120605-2.3.4_r1@out@debug@host@linux-x86@pr@sim@system@framework@core.jar@classes.dex)
E/dalvikvm( 5689): No valid entries found in bootclasspath '/media/linux/1/android-20120605-2.3.4_r1/out/debug/host/linux-x86/pr/sim/system/framework/core.jar'
W/dalvikvm( 5689): JNI_CreateJavaVM failed
Dalvik VM init failed (check log file)


Program exited with code 01.
(gdb) b dvmClassStartup
Breakpoint 3 at 0x22aa27: file dalvik/vm/oo/Class.c, line 312.
(gdb) run -Xint:portable -cp foo.jar Foo
Starting program: /media/linux/1/android-20120605-2.3.4_r1/out/debug/host/linux-x86/pr/sim/symbols/system/bin/dalvikvm -Xint:portable -cp foo.jar Foo
[Thread debugging using libthread_db enabled]


Breakpoint 1, main (argc=5, argv=0xbffff134) at dalvik/dalvikvm/Main.c:152
152    setvbuf(stdout, NULL, _IONBF, 0);
(gdb) c
Continuing.


Breakpoint 3, dvmClassStartup () at dalvik/vm/oo/Class.c:312
312    if (strcmp(gDvm.bootClassPathStr, ".") == 0) {
(gdb) p gDvm.bootClassPathStr
$1 = 0x804c1f8 "/media/linux/1/android-20120605-2.3.4_r1/out/debug/host/linux-x86/pr/sim/system/framework/core.jar"
(gdb) n
318        dvmHashTableCreate(256, (HashFreeFunc) dvmFreeClassInnards);
(gdb) 
321    if (gDvm.pBootLoaderAlloc == NULL)
(gdb) 
318        dvmHashTableCreate(256, (HashFreeFunc) dvmFreeClassInnards);
(gdb) 
317    gDvm.loadedClasses =
(gdb) 
320    gDvm.pBootLoaderAlloc = dvmLinearAllocCreate(NULL);
(gdb) 
321    if (gDvm.pBootLoaderAlloc == NULL)
(gdb) b prepareCpe
Function "prepareCpe" not defined.
Make breakpoint pending on future shared library load? (y or [n]) y


Breakpoint 4 (prepareCpe) pending.
(gdb) c
Continuing.
E/dalvikvm( 6512): Can't open dex cache '/tmp/dalvik_leon/dalvik-cache/media@linux@1@android-20120605-2.3.4_r1@out@debug@host@linux-x86@pr@sim@system@framework@core.jar@classes.dex': No such file or directory
I/dalvikvm( 6512): Unable to open or create cache for /media/linux/1/android-20120605-2.3.4_r1/out/debug/host/linux-x86/pr/sim/system/framework/core.jar (/tmp/dalvik_leon/dalvik-cache/media@linux@1@android-20120605-2.3.4_r1@out@debug@host@linux-x86@pr@sim@system@framework@core.jar@classes.dex)
E/dalvikvm( 6512): No valid entries found in bootclasspath '/media/linux/1/android-20120605-2.3.4_r1/out/debug/host/linux-x86/pr/sim/system/framework/core.jar'
W/dalvikvm( 6512): JNI_CreateJavaVM failed
Dalvik VM init failed (check log file)


Program exited with code 01.
(gdb) run -Xint:portable -cp foo.jar Foo
Starting program: /media/linux/1/android-20120605-2.3.4_r1/out/debug/host/linux-x86/pr/sim/symbols/system/bin/dalvikvm -Xint:portable -cp foo.jar Foo
[Thread debugging using libthread_db enabled]


Breakpoint 1, main (argc=5, argv=0xbffff134) at dalvik/dalvikvm/Main.c:152
152    setvbuf(stdout, NULL, _IONBF, 0);
(gdb) c
Continuing.


Breakpoint 3, dvmClassStartup () at dalvik/vm/oo/Class.c:312
312    if (strcmp(gDvm.bootClassPathStr, ".") == 0) {
(gdb) b processClassPath
Function "processClassPath" not defined.
Make breakpoint pending on future shared library load? (y or [n]) y


Breakpoint 5 (processClassPath) pending.
(gdb) n
318        dvmHashTableCreate(256, (HashFreeFunc) dvmFreeClassInnards);
(gdb) 
321    if (gDvm.pBootLoaderAlloc == NULL)
(gdb) 
318        dvmHashTableCreate(256, (HashFreeFunc) dvmFreeClassInnards);
(gdb) 
317    gDvm.loadedClasses =
(gdb) 
320    gDvm.pBootLoaderAlloc = dvmLinearAllocCreate(NULL);
(gdb) 
321    if (gDvm.pBootLoaderAlloc == NULL)
(gdb) 
320    gDvm.pBootLoaderAlloc = dvmLinearAllocCreate(NULL);
(gdb) 
321    if (gDvm.pBootLoaderAlloc == NULL)
(gdb) 
333    gDvm.classSerialNumber = INITIAL_CLASS_SERIAL_NUMBER;
(gdb) 
341        calloc(ZYGOTE_CLASS_CUTOFF, sizeof(InitiatingLoaderList));
(gdb) 
340    gDvm.initiatingLoaderList =
(gdb) 
343    gDvm.classJavaLangClass = (ClassObject*) dvmMalloc(
(gdb) 
345    DVM_OBJECT_INIT(&gDvm.classJavaLangClass->obj, gDvm.classJavaLangClass);
(gdb) 
343    gDvm.classJavaLangClass = (ClassObject*) dvmMalloc(
(gdb) 
345    DVM_OBJECT_INIT(&gDvm.classJavaLangClass->obj, gDvm.classJavaLangClass);
(gdb) 
351    assert(gDvm.bootClassPath == NULL);
(gdb) 
346    gDvm.classJavaLangClass->descriptor = "Ljava/lang/Class;";
(gdb) 
345    DVM_OBJECT_INIT(&gDvm.classJavaLangClass->obj, gDvm.classJavaLangClass);
(gdb) 
346    gDvm.classJavaLangClass->descriptor = "Ljava/lang/Class;";
(gdb) 
351    assert(gDvm.bootClassPath == NULL);
(gdb) 
352    processClassPath(gDvm.bootClassPathStr, true);
(gdb) s
processClassPath () at dalvik/vm/oo/Class.c:548
548    assert(pathStr != NULL);
(gdb) n
dvmClassStartup () at dalvik/vm/oo/Class.c:352
352    processClassPath(gDvm.bootClassPathStr, true);
(gdb) s
processClassPath () at dalvik/vm/oo/Class.c:548
548    assert(pathStr != NULL);
(gdb) n
550    mangle = strdup(pathStr);
(gdb) 
560    for (cp = mangle; *cp != '\0'; cp++) {
(gdb) l
555     *
556     * If the path was constructed strangely (e.g. ":foo::bar:") this will
557     * over-allocate, which isn't ideal but is mostly harmless.
558     */
559    count = 1;
560    for (cp = mangle; *cp != '\0'; cp++) {
561        if (*cp == ':') {   /* separates two entries */
562            count++;
563            *cp = '\0';
564        }
(gdb) 
565    }
566    end = cp;
567
568    /*
569     * Allocate storage.  We over-alloc by one so we can set an "end" marker.
570     */
571    cpe = (ClassPathEntry*) calloc(count+1, sizeof(ClassPathEntry));
572
573    /*
574     * Set the global pointer so the DEX file dependency stuff can find it.
(gdb) 
575     */
576    gDvm.bootClassPath = cpe;
577
578    /*
579     * Go through a second time, pulling stuff out.
580     */
581    cp = mangle;
582    idx = 0;
583    while (cp < end) {
584        if (*cp == '\0') {
(gdb) 
585            /* leading, trailing, or doubled ':'; ignore it */
586        } else {
587            if (isBootstrap &&
588                    dvmPathToAbsolutePortion(cp) == NULL) {
589                LOGE("Non-absolute bootclasspath entry '%s'\n", cp);
590                free(cpe);
591                cpe = NULL;
592                goto bail;
593            }
594
(gdb) 
595            ClassPathEntry tmp;
596            tmp.kind = kCpeUnknown;
597            tmp.fileName = strdup(cp);
598            tmp.ptr = NULL;
599
600            /*
601             * Drop an end marker here so DEX loader can walk unfinished
602             * list.
603             */
604            cpe[idx].kind = kCpeLastEntry;
(gdb) 
605            cpe[idx].fileName = NULL;
606            cpe[idx].ptr = NULL;
607
608            if (!prepareCpe(&tmp, isBootstrap)) {
609                /* drop from list and continue on */
610                free(tmp.fileName);
611            } else {
612                /* copy over, pointers and all */
613                cpe[idx] = tmp;
614                idx++;
(gdb) b dalvik/vm/oo/Class.c:605
Breakpoint 6 at 0x22ad18: file dalvik/vm/oo/Class.c, line 605.
(gdb) c
Continuing.


Breakpoint 6, processClassPath () at dalvik/vm/oo/Class.c:605
605            cpe[idx].fileName = NULL;
(gdb) n
606            cpe[idx].ptr = NULL;
(gdb) n
608            if (!prepareCpe(&tmp, isBootstrap)) {
(gdb) s
prepareCpe () at dalvik/vm/oo/Class.c:608
608            if (!prepareCpe(&tmp, isBootstrap)) {
(gdb) 
stat () at /usr/include/sys/stat.h:457
457  return __xstat (_STAT_VER, __path, __statbuf);
(gdb) 
prepareCpe () at dalvik/vm/oo/Class.c:491
491    if (cc < 0) {
(gdb) 
495    if (S_ISDIR(sb.st_mode)) {
(gdb) n
510    if (dvmJarFileOpen(cpe->fileName, NULL, &pJarFile, isBootstrap) == 0) {
(gdb) s
dvmJarFileOpen (
    fileName=0x80581e0 "/media/linux/1/android-20120605-2.3.4_r1/out/debug/host/linux-x86/pr/sim/system/framework/core.jar", odexOutputName=0x0, ppJarFile=0xbfffee6c, isBootstrap=true)
    at dalvik/vm/JarFile.c:188
188 {
(gdb) n
200    if (dexZipOpenArchive(fileName, &archive) != 0)
(gdb) 
190    DvmDex* pDvmDex = NULL;
(gdb) 
191    char* cachedName = NULL;
(gdb) 
200    if (dexZipOpenArchive(fileName, &archive) != 0)
(gdb) 
206    dvmSetCloseOnExec(dexZipGetArchiveFd(&archive));
(gdb) 
211    fd = openAlternateSuffix(fileName, "odex", O_RDONLY, &cachedName);
(gdb) 
212    if (fd >= 0) {
(gdb) 
211    fd = openAlternateSuffix(fileName, "odex", O_RDONLY, &cachedName);
(gdb) 
212    if (fd >= 0) {
(gdb) 
234        entry = dexZipFindEntry(&archive, kDexInJarName);
(gdb) 
235        if (entry != NULL) {
(gdb) 
234        entry = dexZipFindEntry(&archive, kDexInJarName);
(gdb) 
235        if (entry != NULL) {
(gdb) 
249            if (odexOutputName == NULL) {
(gdb) 
236            bool newFile = false;
(gdb) 
249            if (odexOutputName == NULL) {
(gdb) 
250                cachedName = dexOptGenerateCacheFileName(fileName,
(gdb) 
252                if (cachedName == NULL)
(gdb) 
250                cachedName = dexOptGenerateCacheFileName(fileName,
(gdb) 
252                if (cachedName == NULL)
(gdb) 
259            fd = dvmOpenCachedDexFile(fileName, cachedName,
(gdb) 
261                    dexGetZipEntryCrc32(&archive, entry),
(gdb) 
259            fd = dvmOpenCachedDexFile(fileName, cachedName,
(gdb) 
260                    dexGetZipEntryModTime(&archive, entry),
(gdb) 
259            fd = dvmOpenCachedDexFile(fileName, cachedName,
(gdb) 
E/dalvikvm( 7539): Can't open dex cache '/tmp/dalvik_leon/dalvik-cache/media@linux@1@android-20120605-2.3.4_r1@out@debug@host@linux-x86@pr@sim@system@framework@core.jar@classes.dex': No such file or directory
263            if (fd < 0) {
(gdb) b dalvik/vm/JarFile.c:260
Breakpoint 7 at 0x1e43a9: file dalvik/vm/JarFile.c, line 260.
(gdb) run -Xint:portable -cp foo.jar Foo
The program being debugged has been started already.
Start it from the beginning? (y or n) y


Starting program: /media/linux/1/android-20120605-2.3.4_r1/out/debug/host/linux-x86/pr/sim/symbols/system/bin/dalvikvm -Xint:portable -cp foo.jar Foo
[Thread debugging using libthread_db enabled]


Breakpoint 1, main (argc=5, argv=0xbffff134) at dalvik/dalvikvm/Main.c:152
152    setvbuf(stdout, NULL, _IONBF, 0);
(gdb) c
Continuing.


Breakpoint 3, dvmClassStartup () at dalvik/vm/oo/Class.c:312
312    if (strcmp(gDvm.bootClassPathStr, ".") == 0) {
(gdb) 
Continuing.


Breakpoint 6, processClassPath () at dalvik/vm/oo/Class.c:605
605            cpe[idx].fileName = NULL;
(gdb) 
Continuing.


Breakpoint 7, dvmJarFileOpen (
    fileName=0x80581e0 "/media/linux/1/android-20120605-2.3.4_r1/out/debug/host/linux-x86/pr/sim/system/framework/core.jar", odexOutputName=0x0, ppJarFile=0xbfffee6c, isBootstrap=true)
    at dalvik/vm/JarFile.c:263
263            if (fd < 0) {
(gdb) info b
Num     Type           Disp Enb Address    What
1       breakpoint     keep y   0x0804874a in main at dalvik/dalvikvm/Main.c:152
breakpoint already hit 1 time
2       breakpoint     keep y   0x00207724 in dvmOptimizeDexFile
                                       at dalvik/vm/analysis/DexPrepare.c:299
3       breakpoint     keep y   0x0022aa27 in dvmClassStartup at dalvik/vm/oo/Class.c:312
breakpoint already hit 1 time
4       breakpoint     keep y   <PENDING>  prepareCpe
5       breakpoint     keep y   <PENDING>  processClassPath
6       breakpoint     keep y   0x0022ad18 in dvmClassStartup at dalvik/vm/oo/Class.c:605
breakpoint already hit 1 time
7       breakpoint     keep y   0x001e43a9 in dvmJarFileOpen at dalvik/vm/JarFile.c:260
breakpoint already hit 1 time
(gdb) p fd
$2 = -1
(gdb) l
258                fileName, cachedName);
259            fd = dvmOpenCachedDexFile(fileName, cachedName,
260                    dexGetZipEntryModTime(&archive, entry),
261                    dexGetZipEntryCrc32(&archive, entry),
262                    isBootstrap, &newFile, /*createIfMissing=*/true);
263            if (fd < 0) {
264                LOGI("Unable to open or create cache for %s (%s)\n",
265                    fileName, cachedName);
266                goto bail;
267            }
(gdb) n
259            fd = dvmOpenCachedDexFile(fileName, cachedName,
(gdb) 
263            if (fd < 0) {
(gdb) 
276            if (newFile) {
(gdb) p fd
$3 = 6
(gdb) b dvmOptimizeDexFile
Note: breakpoint 2 also set at pc 0x207724.
Breakpoint 8 at 0x207724: file dalvik/vm/analysis/DexPrepare.c, line 299.
(gdb) c
Continuing.


Breakpoint 2, dvmOptimizeDexFile (fd=6, dexOffset=40, dexLength=1624, 
    fileName=0x80581e0 "/media/linux/1/android-20120605-2.3.4_r1/out/debug/host/linux-x86/pr/sim/system/framework/core.jar", modWhen=1115621803, crc=2301662202, isBootstrap=true)
    at dalvik/vm/analysis/DexPrepare.c:299
299 {
(gdb) l
294 *
295 * Returns "true" on success.  All data will have been written to "fd".
296 */
297 bool dvmOptimizeDexFile(int fd, off_t dexOffset, long dexLength,
298    const char* fileName, u4 modWhen, u4 crc, bool isBootstrap)
299 {
300    const char* lastPart = strrchr(fileName, '/');
301    if (lastPart != NULL)
302        lastPart++;
303    else
(gdb) 
304        lastPart = fileName;
305
306    LOGD("DexOpt: --- BEGIN '%s' (bootstrap=%d) ---\n", lastPart, isBootstrap);
307
308    pid_t pid;
309
310    /*
311     * This could happen if something in our bootclasspath, which we thought
312     * was all optimized, got rejected.
313     */
(gdb) 
314    if (gDvm.optimizing) {
315        LOGW("Rejecting recursive optimization attempt on '%s'\n", fileName);
316        return false;
317    }
318
319    pid = fork();
320    if (pid == 0) {
321        static const int kUseValgrind = 0;
322        static const char* kDexOptBin = "/bin/dexopt";
323        static const char* kValgrinder = "/usr/bin/valgrind";
(gdb) 
324        static const int kFixedArgCount = 10;
325        static const int kValgrindArgCount = 5;
326        static const int kMaxIntLen = 12;   // '-'+10dig+'\0' -OR- 0x+8dig
327        int bcpSize = dvmGetBootPathSize();
328        int argc = kFixedArgCount + bcpSize
329            + (kValgrindArgCount * kUseValgrind);
330        char* argv[argc+1];             // last entry is NULL
331        char values[argc][kMaxIntLen];
332        char* execFile;
333        char* androidRoot;
(gdb) 
334        int flags;
335
336        /* change process groups, so we don't clash with ProcessManager */
337        setpgid(0, 0);
338
339        /* full path to optimizer */
340        androidRoot = getenv("ANDROID_ROOT");
341        if (androidRoot == NULL) {
342            LOGW("ANDROID_ROOT not set, defaulting to /system\n");
343            androidRoot = "/system";
(gdb) 
344        }
345        execFile = malloc(strlen(androidRoot) + strlen(kDexOptBin) + 1);
346        strcpy(execFile, androidRoot);
347        strcat(execFile, kDexOptBin);
348
349        /*
350         * Create arg vector.
351         */
352        int curArg = 0;
353
(gdb) 
354        if (kUseValgrind) {
355            /* probably shouldn't ship the hard-coded path */
356            argv[curArg++] = (char*)kValgrinder;
357            argv[curArg++] = "--tool=memcheck";
358            argv[curArg++] = "--leak-check=yes";        // check for leaks too
359            argv[curArg++] = "--leak-resolution=med";   // increase from 2 to 4
360            argv[curArg++] = "--num-callers=16";        // default is 12
361            assert(curArg == kValgrindArgCount);
362        }
363        argv[curArg++] = execFile;
(gdb) 
364
365        argv[curArg++] = "--dex";
366
367        sprintf(values[2], "%d", DALVIK_VM_BUILD);
368        argv[curArg++] = values[2];
369
370        sprintf(values[3], "%d", fd);
371        argv[curArg++] = values[3];
372
373        sprintf(values[4], "%d", (int) dexOffset);
(gdb) 
374        argv[curArg++] = values[4];
375
376        sprintf(values[5], "%d", (int) dexLength);
377        argv[curArg++] = values[5];
378
379        argv[curArg++] = (char*)fileName;
380
381        sprintf(values[7], "%d", (int) modWhen);
382        argv[curArg++] = values[7];
383
(gdb) b dalvik/vm/analysis/DexPrepare.c:382
Breakpoint 9 at 0x207a91: file dalvik/vm/analysis/DexPrepare.c, line 382.
(gdb) c
Continuing.
E/dalvikvm(12646): Too many exceptions during init (failed on 'Ljava/lang/NoClassDefFoundError;' 'java.lang.NoClassDefFoundError')
E/dalvikvm(12646): VM aborting
W/dalvikvm(11243): DexOpt: --- END 'core.jar' --- status=0x000b, process failed
E/dalvikvm(11243): Unable to extract+optimize DEX from '/media/linux/1/android-20120605-2.3.4_r1/out/debug/host/linux-x86/pr/sim/system/framework/core.jar'
E/dalvikvm(11243): No valid entries found in bootclasspath '/media/linux/1/android-20120605-2.3.4_r1/out/debug/host/linux-x86/pr/sim/system/framework/core.jar'
W/dalvikvm(11243): JNI_CreateJavaVM failed
Dalvik VM init failed (check log file)


Program exited with code 01.
(gdb) show follow-fork-mode
Debugger response to a program call of fork or vfork is "parent".
(gdb) show detach-on-fork
Whether gdb will detach the child of a fork is on.
(gdb) version
Undefined command: "version".  Try "help".
(gdb) show version
GNU gdb (GDB) 7.2-ubuntu
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
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 "i686-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
(gdb) set follow-fork-mode child
(gdb) show follow-fork-mode
Debugger response to a program call of fork or vfork is "child".
(gdb) info b
Num     Type           Disp Enb Address    What
1       breakpoint     keep y   0x0804874a in main at dalvik/dalvikvm/Main.c:152
breakpoint already hit 1 time
2       breakpoint     keep y   0x00207724 in dvmOptimizeDexFile
                                       at dalvik/vm/analysis/DexPrepare.c:299
breakpoint already hit 1 time
3       breakpoint     keep y   0x0022aa27 in dvmClassStartup at dalvik/vm/oo/Class.c:312
breakpoint already hit 1 time
4       breakpoint     keep y   <PENDING>  prepareCpe
5       breakpoint     keep y   <PENDING>  processClassPath
6       breakpoint     keep y   0x0022ad18 in dvmClassStartup at dalvik/vm/oo/Class.c:605
breakpoint already hit 1 time
7       breakpoint     keep y   0x001e43a9 in dvmJarFileOpen at dalvik/vm/JarFile.c:260
breakpoint already hit 1 time
8       breakpoint     keep y   0x00207724 in dvmOptimizeDexFile
                                       at dalvik/vm/analysis/DexPrepare.c:299
breakpoint already hit 1 time
9       breakpoint     keep y   0x00207a91 in dvmOptimizeDexFile
                                       at dalvik/vm/analysis/DexPrepare.c:382
(gdb) run -Xint:portable -cp foo.jar Foo
Starting program: /media/linux/1/android-20120605-2.3.4_r1/out/debug/host/linux-x86/pr/sim/symbols/system/bin/dalvikvm -Xint:portable -cp foo.jar Foo
[Thread debugging using libthread_db enabled]


Breakpoint 1, main (argc=5, argv=0xbffff134) at dalvik/dalvikvm/Main.c:152
152    setvbuf(stdout, NULL, _IONBF, 0);
(gdb) c
Continuing.


Breakpoint 3, dvmClassStartup () at dalvik/vm/oo/Class.c:312
312    if (strcmp(gDvm.bootClassPathStr, ".") == 0) {
(gdb) 
Continuing.


Breakpoint 6, processClassPath () at dalvik/vm/oo/Class.c:605
605            cpe[idx].fileName = NULL;
(gdb) 
Continuing.


Breakpoint 7, dvmJarFileOpen (
    fileName=0x80581e0 "/media/linux/1/android-20120605-2.3.4_r1/out/debug/host/linux-x86/pr/sim/system/framework/core.jar", odexOutputName=0x0, ppJarFile=0xbfffee6c, isBootstrap=true)
    at dalvik/vm/JarFile.c:263
263            if (fd < 0) {
(gdb) 
Continuing.


Breakpoint 2, dvmOptimizeDexFile (fd=6, dexOffset=40, dexLength=1624, 
    fileName=0x80581e0 "/media/linux/1/android-20120605-2.3.4_r1/out/debug/host/linux-x86/pr/sim/system/framework/core.jar", modWhen=1115621803, crc=2301662202, isBootstrap=true)
    at dalvik/vm/analysis/DexPrepare.c:299
299 {
(gdb) n
300    const char* lastPart = strrchr(fileName, '/');
(gdb) 
299 {
(gdb) 
300    const char* lastPart = strrchr(fileName, '/');
(gdb) 
306    LOGD("DexOpt: --- BEGIN '%s' (bootstrap=%d) ---\n", lastPart, isBootstrap);
(gdb) 
301    if (lastPart != NULL)
(gdb) 
306    LOGD("DexOpt: --- BEGIN '%s' (bootstrap=%d) ---\n", lastPart, isBootstrap);
(gdb) 
301    if (lastPart != NULL)
(gdb) 
306    LOGD("DexOpt: --- BEGIN '%s' (bootstrap=%d) ---\n", lastPart, isBootstrap);
(gdb) 
314    if (gDvm.optimizing) {
(gdb) 
319    pid = fork();
(gdb) 
[New process 21021]
[Thread debugging using libthread_db enabled]
[Switching to Thread 0xb7fe96d0 (LWP 21021)]
320    if (pid == 0) {
(gdb) 
319    pid = fork();
(gdb) 
320    if (pid == 0) {
(gdb) 
327        int bcpSize = dvmGetBootPathSize();
(gdb) 
329            + (kValgrindArgCount * kUseValgrind);
(gdb) 
330        char* argv[argc+1];             // last entry is NULL
(gdb) 
331        char values[argc][kMaxIntLen];
(gdb) 
330        char* argv[argc+1];             // last entry is NULL
(gdb) 
329            + (kValgrindArgCount * kUseValgrind);
(gdb) 
331        char values[argc][kMaxIntLen];
(gdb) 
330        char* argv[argc+1];             // last entry is NULL
(gdb) 
331        char values[argc][kMaxIntLen];
(gdb) 
337        setpgid(0, 0);
(gdb) 
340        androidRoot = getenv("ANDROID_ROOT");
(gdb) 
341        if (androidRoot == NULL) {
(gdb) 
340        androidRoot = getenv("ANDROID_ROOT");
(gdb) 
341        if (androidRoot == NULL) {
(gdb) 
297 bool dvmOptimizeDexFile(int fd, off_t dexOffset, long dexLength,
(gdb) 
345        execFile = malloc(strlen(androidRoot) + strlen(kDexOptBin) + 1);
(gdb) 
367        sprintf(values[2], "%d", DALVIK_VM_BUILD);
(gdb) p execFile
$4 = <value optimized out>
(gdb) n
345        execFile = malloc(strlen(androidRoot) + strlen(kDexOptBin) + 1);
(gdb) 
346        strcpy(execFile, androidRoot);
(gdb) 
345        execFile = malloc(strlen(androidRoot) + strlen(kDexOptBin) + 1);
(gdb) 
346        strcpy(execFile, androidRoot);
(gdb) 
347        strcat(execFile, kDexOptBin);
(gdb) 
363        argv[curArg++] = execFile;
(gdb) 
365        argv[curArg++] = "--dex";
(gdb) p *argv[1]
no such vector element
(gdb) p argv[1]
no such vector element
(gdb) p argv[0]
no such vector element
(gdb) local
Undefined command: "local".  Try "help".
(gdb) show local
Undefined show command: "local".  Try "help show".
(gdb) info local
kDexOptBin = 0x25b362 "/bin/dexopt"
androidRoot = <value optimized out>
argc = 10
flags = <value optimized out>
curArg = <value optimized out>
bcpSize = <value optimized out>
cpe = <value optimized out>
lastPart = 0xbfffec70 "\370\354\377\277\260=\022"
(gdb) n
363        argv[curArg++] = execFile;
(gdb) 
365        argv[curArg++] = "--dex";
(gdb) 
367        sprintf(values[2], "%d", DALVIK_VM_BUILD);
(gdb) 
368        argv[curArg++] = values[2];
(gdb) 
370        sprintf(values[3], "%d", fd);
(gdb) 
371        argv[curArg++] = values[3];
(gdb) 
373        sprintf(values[4], "%d", (int) dexOffset);
(gdb) 
371        argv[curArg++] = values[3];
(gdb) 
373        sprintf(values[4], "%d", (int) dexOffset);
(gdb) 
374        argv[curArg++] = values[4];
(gdb) 
376        sprintf(values[5], "%d", (int) dexLength);
(gdb) 
374        argv[curArg++] = values[4];
(gdb) 
376        sprintf(values[5], "%d", (int) dexLength);
(gdb) 
377        argv[curArg++] = values[5];
(gdb) 
379        argv[curArg++] = (char*)fileName;
(gdb) 
381        sprintf(values[7], "%d", (int) modWhen);
(gdb) 
377        argv[curArg++] = values[5];
(gdb) 
381        sprintf(values[7], "%d", (int) modWhen);
(gdb) 


Breakpoint 9, dvmOptimizeDexFile (fd=6, dexOffset=<value optimized out>, dexLength=1624, 
    fileName=0x80581e0 "/media/linux/1/android-20120605-2.3.4_r1/out/debug/host/linux-x86/pr/sim/system/framework/core.jar", modWhen=1115621803, crc=2301662202, isBootstrap=<value optimized out>)
    at dalvik/vm/analysis/DexPrepare.c:382
382        argv[curArg++] = values[7];
(gdb) 
384        sprintf(values[8], "%d", (int) crc);
(gdb) 
382        argv[curArg++] = values[7];
(gdb) 
384        sprintf(values[8], "%d", (int) crc);
(gdb) 
388        if (gDvm.dexOptMode != OPTIMIZE_MODE_NONE) {
(gdb) 
385        argv[curArg++] = values[8];
(gdb) 
388        if (gDvm.dexOptMode != OPTIMIZE_MODE_NONE) {
(gdb) 
385        argv[curArg++] = values[8];
(gdb) 
388        if (gDvm.dexOptMode != OPTIMIZE_MODE_NONE) {
(gdb) 
390            if (gDvm.dexOptMode == OPTIMIZE_MODE_ALL)
(gdb) 
393        if (gDvm.classVerifyMode != VERIFY_MODE_NONE) {
(gdb) 
394            flags |= DEXOPT_VERIFY_ENABLED;
(gdb) 
396                flags |= DEXOPT_VERIFY_ALL;
(gdb) 
399            flags |= DEXOPT_IS_BOOTSTRAP;
(gdb) 
401            flags |= DEXOPT_GEN_REGISTER_MAPS;
(gdb) 
399            flags |= DEXOPT_IS_BOOTSTRAP;
(gdb) 
402        sprintf(values[9], "%d", flags);
(gdb) 
399            flags |= DEXOPT_IS_BOOTSTRAP;
(gdb) 
401            flags |= DEXOPT_GEN_REGISTER_MAPS;
(gdb) 
402        sprintf(values[9], "%d", flags);
(gdb) 
401            flags |= DEXOPT_GEN_REGISTER_MAPS;
(gdb) 
402        sprintf(values[9], "%d", flags);
(gdb) 
403        argv[curArg++] = values[9];
(gdb) 
409        for (cpe = gDvm.bootClassPath; cpe->ptr != NULL; cpe++) {
(gdb) l
404
405        assert(((!kUseValgrind && curArg == kFixedArgCount) ||
406               ((kUseValgrind && curArg == kFixedArgCount+kValgrindArgCount))));
407
408        ClassPathEntry* cpe;
409        for (cpe = gDvm.bootClassPath; cpe->ptr != NULL; cpe++) {
410            argv[curArg++] = cpe->fileName;
411        }
412        assert(curArg == argc);
413
(gdb) n
403        argv[curArg++] = values[9];
(gdb) 
409        for (cpe = gDvm.bootClassPath; cpe->ptr != NULL; cpe++) {
(gdb) 
412        assert(curArg == argc);
(gdb) 
414        argv[curArg] = NULL;
(gdb) 
419            execv(execFile, argv);
(gdb) p execFile
$5 = <value optimized out>
(gdb) p argv
$6 = <value optimized out>
(gdb) n
414        argv[curArg] = NULL;
(gdb) 
419            execv(execFile, argv);
(gdb) 
process 21021 is executing new program: /media/linux/1/android-20120605-2.3.4_r1/out/debug/host/linux-x86/pr/sim/system/bin/dexopt
[Thread debugging using libthread_db enabled]


Breakpoint 1, main (argc=10, argv=0xbffff0c4) at dalvik/dexopt/OptMain.c:573
573    set_process_name("dexopt");
(gdb) p argv[2]
$7 = 0xbffff2f6 "23"
(gdb) p argv[3]
$8 = 0xbffff2f9 "6"
(gdb) p argv[4]
$9 = 0xbffff2fb "40"
(gdb) p argv[5]
$10 = 0xbffff2fe "1624"
(gdb) p argv[6]
$11 = 0xbffff303 "/media/linux/1/android-20120605-2.3.4_r1/out/debug/host/linux-x86/pr/sim/system/framework/core.jar"
(gdb) n
575    setvbuf(stdout, NULL, _IONBF, 0);
(gdb) 
577    if (argc > 1) {
(gdb) 
578        if (strcmp(argv[1], "--zip") == 0)
(gdb) 
580        else if (strcmp(argv[1], "--dex") == 0)
(gdb) 
581            return fromDex(argc, argv);
(gdb) 


Breakpoint 3, dvmClassStartup () at dalvik/vm/oo/Class.c:312
312    if (strcmp(gDvm.bootClassPathStr, ".") == 0) {
(gdb) 
318        dvmHashTableCreate(256, (HashFreeFunc) dvmFreeClassInnards);
(gdb) 
321    if (gDvm.pBootLoaderAlloc == NULL)
(gdb) 
318        dvmHashTableCreate(256, (HashFreeFunc) dvmFreeClassInnards);
(gdb) 
317    gDvm.loadedClasses =
(gdb) 
320    gDvm.pBootLoaderAlloc = dvmLinearAllocCreate(NULL);
(gdb) 
321    if (gDvm.pBootLoaderAlloc == NULL)
(gdb) 
320    gDvm.pBootLoaderAlloc = dvmLinearAllocCreate(NULL);
(gdb) 
321    if (gDvm.pBootLoaderAlloc == NULL)
(gdb) 
333    gDvm.classSerialNumber = INITIAL_CLASS_SERIAL_NUMBER;
(gdb) 
341        calloc(ZYGOTE_CLASS_CUTOFF, sizeof(InitiatingLoaderList));
(gdb) 
340    gDvm.initiatingLoaderList =
(gdb) 
343    gDvm.classJavaLangClass = (ClassObject*) dvmMalloc(
(gdb) 
345    DVM_OBJECT_INIT(&gDvm.classJavaLangClass->obj, gDvm.classJavaLangClass);
(gdb) 
343    gDvm.classJavaLangClass = (ClassObject*) dvmMalloc(
(gdb) 
345    DVM_OBJECT_INIT(&gDvm.classJavaLangClass->obj, gDvm.classJavaLangClass);
(gdb) 
351    assert(gDvm.bootClassPath == NULL);
(gdb) 
346    gDvm.classJavaLangClass->descriptor = "Ljava/lang/Class;";
(gdb) 
345    DVM_OBJECT_INIT(&gDvm.classJavaLangClass->obj, gDvm.classJavaLangClass);
(gdb) 
346    gDvm.classJavaLangClass->descriptor = "Ljava/lang/Class;";
(gdb) 
351    assert(gDvm.bootClassPath == NULL);
(gdb) 
352    processClassPath(gDvm.bootClassPathStr, true);
(gdb) s
processClassPath () at dalvik/vm/oo/Class.c:548
548    assert(pathStr != NULL);
(gdb) n
dvmClassStartup () at dalvik/vm/oo/Class.c:352
352    processClassPath(gDvm.bootClassPathStr, true);
(gdb) n
358 }
(gdb) 
352    processClassPath(gDvm.bootClassPathStr, true);
(gdb) 
358 }
(gdb) 
dvmPrepForDexOpt (bootClassPath=0x804c130 "", dexOptMode=OPTIMIZE_MODE_VERIFIED, 
    verifyMode=VERIFY_MODE_ALL, dexoptFlags=0) at dalvik/vm/Init.c:1573
1573 }
(gdb) bt
#0  dvmPrepForDexOpt (bootClassPath=0x804c130 "", dexOptMode=OPTIMIZE_MODE_VERIFIED, 
    verifyMode=VERIFY_MODE_ALL, dexoptFlags=0) at dalvik/vm/Init.c:1573
#1  0x08049430 in fromDex (argc=10, argv=0xbffff0c4) at dalvik/dexopt/OptMain.c:516
#2  main (argc=10, argv=0xbffff0c4) at dalvik/dexopt/OptMain.c:581
(gdb) l
1568    return 0;
1569
1570 fail:
1571    dvmShutdown();
1572    return 1;
1573 }
1574
1575
1576 /*
1577 * All threads have stopped.  Finish the shutdown procedure.
(gdb) n
fromDex (argc=10, argv=0xbffff0c4) at dalvik/dexopt/OptMain.c:524
524    if (!dvmContinueOptimization(fd, offset, length, debugFileName,
(gdb) n
E/dalvikvm(21021): Too many exceptions during init (failed on 'Ljava/lang/NoClassDefFoundError;' 'java.lang.NoClassDefFoundError')
E/dalvikvm(21021): VM aborting


Program received signal SIGSEGV, Segmentation fault.
dvmAbort () at dalvik/vm/Init.c:1716
1716    *((char*)0xdeadd00d) = 38;
(gdb) b dvmContinueOptimization
Breakpoint 10 at 0x24d307: file dalvik/vm/analysis/DexPrepare.c, line 476.
(gdb) info b
Num     Type           Disp Enb Address    What
1       breakpoint     keep y   0x08048ff7 in main at dalvik/dexopt/OptMain.c:152 inf 2, 1
breakpoint already hit 2 times
2       breakpoint     keep y   0x0024e724 in dvmOptimizeDexFile
                                       at dalvik/vm/analysis/DexPrepare.c:299 inf 2, 1
breakpoint already hit 1 time
3       breakpoint     keep y   0x00271a27 in dvmClassStartup
                                       at dalvik/vm/oo/Class.c:312 inf 2, 1
breakpoint already hit 2 times
4       breakpoint     keep y   <PENDING>  prepareCpe
5       breakpoint     keep y   <PENDING>  processClassPath
6       breakpoint     keep y   0x00271d18 in dvmClassStartup
                                       at dalvik/vm/oo/Class.c:605 inf 2, 1
breakpoint already hit 1 time
7       breakpoint     keep y   0x0022b3a9 in dvmJarFileOpen at dalvik/vm/JarFile.c:260 inf 2, 1
breakpoint already hit 1 time
8       breakpoint     keep y   0x0024e724 in dvmOptimizeDexFile
                                       at dalvik/vm/analysis/DexPrepare.c:299 inf 2, 1
breakpoint already hit 1 time
9       breakpoint     keep y   0x0024ea91 in dvmOptimizeDexFile
                                       at dalvik/vm/analysis/DexPrepare.c:382 inf 2, 1
breakpoint already hit 1 time
10      breakpoint     keep y   0x0024d307 in dvmContinueOptimization
                                       at dalvik/vm/analysis/DexPrepare.c:476 inf 2, 1
(gdb) run -Xint:portable -cp foo.jar Foo
The program being debugged has been started already.
Start it from the beginning? (y or n) y


Starting program: /media/linux/1/android-20120605-2.3.4_r1/out/debug/host/linux-x86/pr/sim/system/bin/dexopt -Xint:portable -cp foo.jar Foo
W/dalvikvm(20825): DexOpt: --- END 'core.jar' --- status=0x0009, process failed
E/dalvikvm(20825): Unable to extract+optimize DEX from '/media/linux/1/android-20120605-2.3.4_r1/out/debug/host/linux-x86/pr/sim/system/framework/core.jar'
E/dalvikvm(20825): No valid entries found in bootclasspath '/media/linux/1/android-20120605-2.3.4_r1/out/debug/host/linux-x86/pr/sim/system/framework/core.jar'
W/dalvikvm(20825): JNI_CreateJavaVM failed
Dalvik VM init failed (check log file)
[Thread debugging using libthread_db enabled]


Breakpoint 1, main (argc=5, argv=0xbffff144) at dalvik/dexopt/OptMain.c:573
573    set_process_name("dexopt");
(gdb) c
Continuing.
Usage:


Short version: Don't use this.


Slightly longer version: This system-internal tool is used to
produce optimized dex files. See the source code for details.


Program exited with code 01.
(gdb) run -Xint:portable -cp foo.jar Foo
Starting program: /media/linux/1/android-20120605-2.3.4_r1/out/debug/host/linux-x86/pr/sim/system/bin/dexopt -Xint:portable -cp foo.jar Foo
[Thread debugging using libthread_db enabled]


Breakpoint 1, main (argc=5, argv=0xbffff144) at dalvik/dexopt/OptMain.c:573
573    set_process_name("dexopt");
(gdb) info b
Num     Type           Disp Enb Address    What
1       breakpoint     keep y   0x08048ff7 in main at dalvik/dexopt/OptMain.c:152 inf 2, 1
breakpoint already hit 1 time
2       breakpoint     keep y   0x0024e724 in dvmOptimizeDexFile
                                       at dalvik/vm/analysis/DexPrepare.c:299 inf 2, 1
3       breakpoint     keep y   0x00271a27 in dvmClassStartup
                                       at dalvik/vm/oo/Class.c:312 inf 2, 1
4       breakpoint     keep y   <PENDING>  prepareCpe
5       breakpoint     keep y   <PENDING>  processClassPath
6       breakpoint     keep y   0x00271d18 in dvmClassStartup
                                       at dalvik/vm/oo/Class.c:605 inf 2, 1
7       breakpoint     keep y   0x0022b3a9 in dvmJarFileOpen at dalvik/vm/JarFile.c:260 inf 2, 1
8       breakpoint     keep y   0x0024e724 in dvmOptimizeDexFile
                                       at dalvik/vm/analysis/DexPrepare.c:299 inf 2, 1
9       breakpoint     keep y   0x0024ea91 in dvmOptimizeDexFile
                                       at dalvik/vm/analysis/DexPrepare.c:382 inf 2, 1
10      breakpoint     keep y   0x0024d307 in dvmContinueOptimization
                                       at dalvik/vm/analysis/DexPrepare.c:476 inf 2, 1
(gdb) p argc
$12 = 5
(gdb) q
A debugging session is active.


Inferior 2 [process 25586] will be killed.


Quit anyway? (y or n) n
Not confirmed.
(gdb) show thr
Undefined show command: "thr".  Try "help show".
(gdb) info threa
* 1 Thread 0xb7fe96d0 (LWP 25586)  main (argc=5, argv=0xbffff144) at dalvik/dexopt/OptMain.c:573
(gdb) stop
(gdb) info threa
* 1 Thread 0xb7fe96d0 (LWP 25586)  main (argc=5, argv=0xbffff144) at dalvik/dexopt/OptMain.c:573
(gdb) ^CQuit
(gdb) info threa
* 1 Thread 0xb7fe96d0 (LWP 25586)  main (argc=5, argv=0xbffff144) at dalvik/dexopt/OptMain.c:573
(gdb) q
A debugging session is active.


Inferior 2 [process 25586] will be killed.


Quit anyway? (y or n) y
root@ubuntu:/media/linux/1/android-20120605-2.3.4_r1# gdb out/debug/host/linux-x86/pr/sim/symbols/system/bin/dalvikvm
GNU gdb (GDB) 7.2-ubuntu
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
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 "i686-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /media/linux/1/android-20120605-2.3.4_r1/out/debug/host/linux-x86/pr/sim/symbols/system/bin/dalvikvm...done.
(gdb) set solib-search-path /media/linux/1/android-20120605-2.3.4_r1/out/debug/host/linux-x86/pr/sim/symbols/system/lib/
(gdb) b main
Breakpoint 1 at 0x804874a: file dalvik/dalvikvm/Main.c, line 152.
(gdb) 
Note: breakpoint 1 also set at pc 0x804874a.
Breakpoint 2 at 0x804874a: file dalvik/dalvikvm/Main.c, line 152.
(gdb) b main
Note: breakpoints 1 and 2 also set at pc 0x804874a.
Breakpoint 3 at 0x804874a: file dalvik/dalvikvm/Main.c, line 152.
(gdb) run -Xint:portable -cp foo.jar Foo
Starting program: /media/linux/1/android-20120605-2.3.4_r1/out/debug/host/linux-x86/pr/sim/symbols/system/bin/dalvikvm -Xint:portable -cp foo.jar Foo
[Thread debugging using libthread_db enabled]


Breakpoint 1, main (argc=5, argv=0xbffff134) at dalvik/dalvikvm/Main.c:152
152    setvbuf(stdout, NULL, _IONBF, 0);
(gdb) b dvmClassStartup
Breakpoint 4 at 0x22aa27: file dalvik/vm/oo/Class.c, line 312.
(gdb) set follow-fork-mode child
(gdb) b dalvik/vm/analysis/DexPrepare.c:299
Breakpoint 5 at 0x207724: file dalvik/vm/analysis/DexPrepare.c, line 299.
(gdb) c
Continuing.


Breakpoint 4, dvmClassStartup () at dalvik/vm/oo/Class.c:312
312    if (strcmp(gDvm.bootClassPathStr, ".") == 0) {
(gdb) b dvmJarFileOpen
Breakpoint 6 at 0x1e4097: file dalvik/vm/JarFile.c, line 188.
(gdb) b dvmOptimizeDexFile
Note: breakpoint 5 also set at pc 0x207724.
Breakpoint 7 at 0x207724: file dalvik/vm/analysis/DexPrepare.c, line 299.
(gdb) c
Continuing.


Breakpoint 6, dvmJarFileOpen (
    fileName=0x80581e0 "/media/linux/1/android-20120605-2.3.4_r1/out/debug/host/linux-x86/pr/sim/system/framework/core.jar", odexOutputName=0x0, ppJarFile=0xbfffee6c, isBootstrap=true)
    at dalvik/vm/JarFile.c:188
188 {
(gdb) c
Continuing.


Breakpoint 5, dvmOptimizeDexFile (fd=6, dexOffset=40, dexLength=1624, 
    fileName=0x80581e0 "/media/linux/1/android-20120605-2.3.4_r1/out/debug/host/linux-x86/pr/sim/system/framework/core.jar", modWhen=1115621803, crc=2301662202, isBootstrap=true)
    at dalvik/vm/analysis/DexPrepare.c:299
299 {
(gdb) b dvmContinueOptimization
Breakpoint 8 at 0x206307: file dalvik/vm/analysis/DexPrepare.c, line 476.
(gdb) c
Continuing.
[New process 28220]
[Thread debugging using libthread_db enabled]
process 28220 is executing new program: /media/linux/1/android-20120605-2.3.4_r1/out/debug/host/linux-x86/pr/sim/system/bin/dexopt
[Thread debugging using libthread_db enabled]
[Switching to Thread 0xb7fe96d0 (LWP 28220)]


Breakpoint 1, main (argc=10, argv=0xbffff0c4) at dalvik/dexopt/OptMain.c:573
573    set_process_name("dexopt");
(gdb) info b
Num     Type           Disp Enb Address    What
1       breakpoint     keep y   0x08048ff7 in main at dalvik/dexopt/OptMain.c:152 inf 2, 1
breakpoint already hit 2 times
2       breakpoint     keep y   0x08048ff7 in main at dalvik/dexopt/OptMain.c:152 inf 2, 1
breakpoint already hit 2 times
3       breakpoint     keep y   0x08048ff7 in main at dalvik/dexopt/OptMain.c:152 inf 2, 1
breakpoint already hit 2 times
4       breakpoint     keep y   0x00271a27 in dvmClassStartup
                                       at dalvik/vm/oo/Class.c:312 inf 2, 1
breakpoint already hit 1 time
5       breakpoint     keep y   0x0024e724 in dvmOptimizeDexFile
                                       at dalvik/vm/analysis/DexPrepare.c:299 inf 2, 1
breakpoint already hit 1 time
6       breakpoint     keep y   0x0022b097 in dvmJarFileOpen at dalvik/vm/JarFile.c:188 inf 2, 1
breakpoint already hit 1 time
7       breakpoint     keep y   0x0024e724 in dvmOptimizeDexFile
                                       at dalvik/vm/analysis/DexPrepare.c:299 inf 2, 1
breakpoint already hit 1 time
8       breakpoint     keep y   0x0024d307 in dvmContinueOptimization
                                       at dalvik/vm/analysis/DexPrepare.c:476 inf 2, 1
(gdb) c
Continuing.


Breakpoint 4, dvmClassStartup () at dalvik/vm/oo/Class.c:312
312    if (strcmp(gDvm.bootClassPathStr, ".") == 0) {
(gdb) 
Continuing.


Breakpoint 8, dvmContinueOptimization (fd=6, dexOffset=40, dexLength=1624, 
    fileName=0xbffff303 "/media/linux/1/android-20120605-2.3.4_r1/out/debug/host/linux-x86/pr/sim/system/framework/core.jar", modWhen=1115621803, crc=2301662202, isBootstrap=true)
    at dalvik/vm/analysis/DexPrepare.c:476
476 {
(gdb) l
471 *
472 * Returns "true" on success.
473 */
474 bool dvmContinueOptimization(int fd, off_t dexOffset, long dexLength,
475    const char* fileName, u4 modWhen, u4 crc, bool isBootstrap)
476 {
477    DexClassLookup* pClassLookup = NULL;
478    RegisterMapBuilder* pRegMapBuilder = NULL;
479    u4 headerFlags = 0;
480
(gdb) 
481    assert(gDvm.optimizing);
482
483    LOGV("Continuing optimization (%s, isb=%d, vfy=%d, opt=%d)\n",
484        fileName, isBootstrap, doVerify, doOpt);
485
486    assert(dexOffset >= 0);
487
488    /* quick test so we don't blow up on empty file */
489    if (dexLength < (int) sizeof(DexHeader)) {
490        LOGE("too small to be DEX\n");
(gdb) 
491        return false;
492    }
493    if (dexOffset < (int) sizeof(DexOptHeader)) {
494        LOGE("not enough room for opt header\n");
495        return false;
496    }
497
498    bool result = false;
499
500    /*
(gdb) 
501     * Drop this into a global so we don't have to pass it around.  We could
502     * also add a field to DexFile, but since it only pertains to DEX
503     * creation that probably doesn't make sense.
504     */
505    gDvm.optimizingBootstrapClass = isBootstrap;
506
507    {
508        /*
509         * Map the entire file (so we don't have to worry about page
510         * alignment).  The expectation is that the output file contains
(gdb) 
511         * our DEX data plus room for a small header.
512         */
513        bool success;
514        void* mapAddr;
515        mapAddr = mmap(NULL, dexOffset + dexLength, PROT_READ|PROT_WRITE,
516                    MAP_SHARED, fd, 0);
517        if (mapAddr == MAP_FAILED) {
518            LOGE("unable to mmap DEX cache: %s\n", strerror(errno));
519            goto bail;
520        }
(gdb) 
521
522        /*
523         * Rewrite the file.  Byte reordering, structure realigning,
524         * class verification, and bytecode optimization are all performed
525         * here.
526         *
527         * In theory the file could change size and bits could shift around.
528         * In practice this would be annoying to deal with, so the file
529         * layout is designed so that it can always be rewritten in place.
530         *
(gdb) b 498
Breakpoint 9 at 0x24d354: file dalvik/vm/analysis/DexPrepare.c, line 498.
(gdb) c
Continuing.


Breakpoint 9, dvmContinueOptimization (fd=6, dexOffset=40, dexLength=1624, 
    fileName=0xbffff303 "/media/linux/1/android-20120605-2.3.4_r1/out/debug/host/linux-x86/pr/sim/system/framework/core.jar", modWhen=1115621803, crc=2301662202, isBootstrap=true)
    at dalvik/vm/analysis/DexPrepare.c:505
505    gDvm.optimizingBootstrapClass = isBootstrap;
(gdb) l
500    /*
501     * Drop this into a global so we don't have to pass it around.  We could
502     * also add a field to DexFile, but since it only pertains to DEX
503     * creation that probably doesn't make sense.
504     */
505    gDvm.optimizingBootstrapClass = isBootstrap;
506
507    {
508        /*
509         * Map the entire file (so we don't have to worry about page
(gdb) 
510         * alignment).  The expectation is that the output file contains
511         * our DEX data plus room for a small header.
512         */
513        bool success;
514        void* mapAddr;
515        mapAddr = mmap(NULL, dexOffset + dexLength, PROT_READ|PROT_WRITE,
516                    MAP_SHARED, fd, 0);
517        if (mapAddr == MAP_FAILED) {
518            LOGE("unable to mmap DEX cache: %s\n", strerror(errno));
519            goto bail;
(gdb) 
520        }
521
522        /*
523         * Rewrite the file.  Byte reordering, structure realigning,
524         * class verification, and bytecode optimization are all performed
525         * here.
526         *
527         * In theory the file could change size and bits could shift around.
528         * In practice this would be annoying to deal with, so the file
529         * layout is designed so that it can always be rewritten in place.
(gdb) 
530         *
531         * This sets "headerFlags" and creates the class lookup table as
532         * part of doing the processing.
533         */
534        success = rewriteDex(((u1*) mapAddr) + dexOffset, dexLength,
535                    &headerFlags, &pClassLookup);
536
537        if (success) {
538            DvmDex* pDvmDex = NULL;
539            u1* dexAddr = ((u1*) mapAddr) + dexOffset;
(gdb) n
515        mapAddr = mmap(NULL, dexOffset + dexLength, PROT_READ|PROT_WRITE,
(gdb) 
505    gDvm.optimizingBootstrapClass = isBootstrap;
(gdb) 
515        mapAddr = mmap(NULL, dexOffset + dexLength, PROT_READ|PROT_WRITE,
(gdb) 
517        if (mapAddr == MAP_FAILED) {
(gdb) 
515        mapAddr = mmap(NULL, dexOffset + dexLength, PROT_READ|PROT_WRITE,
(gdb) 
517        if (mapAddr == MAP_FAILED) {
(gdb) 
534        success = rewriteDex(((u1*) mapAddr) + dexOffset, dexLength,
(gdb) 
E/dalvikvm(28220): Too many exceptions during init (failed on 'Ljava/lang/NoClassDefFoundError;' 'java.lang.NoClassDefFoundError')
E/dalvikvm(28220): VM aborting


Program received signal SIGSEGV, Segmentation fault.
dvmAbort () at dalvik/vm/Init.c:1716
1716    *((char*)0xdeadd00d) = 38;
(gdb) b rewriteDex
Function "rewriteDex" not defined.
Make breakpoint pending on future shared library load? (y or [n]) n
(gdb) info b
Num     Type           Disp Enb Address    What
1       breakpoint     keep y   0x08048ff7 in main at dalvik/dexopt/OptMain.c:152 inf 2, 1
breakpoint already hit 2 times
2       breakpoint     keep y   0x08048ff7 in main at dalvik/dexopt/OptMain.c:152 inf 2, 1
breakpoint already hit 2 times
3       breakpoint     keep y   0x08048ff7 in main at dalvik/dexopt/OptMain.c:152 inf 2, 1
breakpoint already hit 2 times
4       breakpoint     keep y   0x00271a27 in dvmClassStartup
                                       at dalvik/vm/oo/Class.c:312 inf 2, 1
breakpoint already hit 2 times
5       breakpoint     keep y   0x0024e724 in dvmOptimizeDexFile
                                       at dalvik/vm/analysis/DexPrepare.c:299 inf 2, 1
breakpoint already hit 1 time
6       breakpoint     keep y   0x0022b097 in dvmJarFileOpen at dalvik/vm/JarFile.c:188 inf 2, 1
breakpoint already hit 1 time
7       breakpoint     keep y   0x0024e724 in dvmOptimizeDexFile
                                       at dalvik/vm/analysis/DexPrepare.c:299 inf 2, 1
breakpoint already hit 1 time
8       breakpoint     keep y   0x0024d307 in dvmContinueOptimization
                                       at dalvik/vm/analysis/DexPrepare.c:476 inf 2, 1
breakpoint already hit 1 time
9       breakpoint     keep y   0x0024d354 in dvmContinueOptimization
                                       at dalvik/vm/analysis/DexPrepare.c:498 inf 2, 1
breakpoint already hit 1 time
(gdb) info b
Num     Type           Disp Enb Address    What
1       breakpoint     keep y   0x08048ff7 in main at dalvik/dexopt/OptMain.c:152 inf 2, 1
breakpoint already hit 2 times
2       breakpoint     keep y   0x08048ff7 in main at dalvik/dexopt/OptMain.c:152 inf 2, 1
breakpoint already hit 2 times
3       breakpoint     keep y   0x08048ff7 in main at dalvik/dexopt/OptMain.c:152 inf 2, 1
breakpoint already hit 2 times
4       breakpoint     keep y   0x00271a27 in dvmClassStartup
                                       at dalvik/vm/oo/Class.c:312 inf 2, 1
breakpoint already hit 2 times
5       breakpoint     keep y   0x0024e724 in dvmOptimizeDexFile
                                       at dalvik/vm/analysis/DexPrepare.c:299 inf 2, 1
breakpoint already hit 1 time
6       breakpoint     keep y   0x0022b097 in dvmJarFileOpen at dalvik/vm/JarFile.c:188 inf 2, 1
breakpoint already hit 1 time
7       breakpoint     keep y   0x0024e724 in dvmOptimizeDexFile
                                       at dalvik/vm/analysis/DexPrepare.c:299 inf 2, 1
breakpoint already hit 1 time
8       breakpoint     keep y   0x0024d307 in dvmContinueOptimization
                                       at dalvik/vm/analysis/DexPrepare.c:476 inf 2, 1
breakpoint already hit 1 time
9       breakpoint     keep y   0x0024d354 in dvmContinueOptimization
                                       at dalvik/vm/analysis/DexPrepare.c:498 inf 2, 1
breakpoint already hit 1 time
(gdb) info thread
* 2 Thread 0xb7fe96d0 (LWP 28220)  dvmAbort () at dalvik/vm/Init.c:1716
(gdb) c
Continuing.


Program terminated with signal SIGSEGV, Segmentation fault.
The program no longer exists.
(gdb) W/dalvikvm(26816): DexOpt: --- END 'core.jar' --- status=0x000b, process failed
E/dalvikvm(26816): Unable to extract+optimize DEX from '/media/linux/1/android-20120605-2.3.4_r1/out/debug/host/linux-x86/pr/sim/system/framework/core.jar'
E/dalvikvm(26816): No valid entries found in bootclasspath '/media/linux/1/android-20120605-2.3.4_r1/out/debug/host/linux-x86/pr/sim/system/framework/core.jar'
W/dalvikvm(26816): JNI_CreateJavaVM failed
Dalvik VM init failed (check log file)


The program is not being run.
(gdb) info b
Num     Type           Disp Enb Address    What
1       breakpoint     keep y   0x08048ff7 in main at dalvik/dexopt/OptMain.c:152 inf 2, 1
breakpoint already hit 2 times
2       breakpoint     keep y   0x08048ff7 in main at dalvik/dexopt/OptMain.c:152 inf 2, 1
breakpoint already hit 2 times
3       breakpoint     keep y   0x08048ff7 in main at dalvik/dexopt/OptMain.c:152 inf 2, 1
breakpoint already hit 2 times
4       breakpoint     keep y   0x00271a27 in dvmClassStartup
                                       at dalvik/vm/oo/Class.c:312 inf 2, 1
breakpoint already hit 2 times
5       breakpoint     keep y   0x0024e724 in dvmOptimizeDexFile
                                       at dalvik/vm/analysis/DexPrepare.c:299 inf 2, 1
breakpoint already hit 1 time
6       breakpoint     keep y   0x0022b097 in dvmJarFileOpen at dalvik/vm/JarFile.c:188 inf 2, 1
breakpoint already hit 1 time
7       breakpoint     keep y   0x0024e724 in dvmOptimizeDexFile
                                       at dalvik/vm/analysis/DexPrepare.c:299 inf 2, 1
breakpoint already hit 1 time
8       breakpoint     keep y   0x0024d307 in dvmContinueOptimization
                                       at dalvik/vm/analysis/DexPrepare.c:476 inf 2, 1
breakpoint already hit 1 time
9       breakpoint     keep y   0x0024d354 in dvmContinueOptimization
                                       at dalvik/vm/analysis/DexPrepare.c:498 inf 2, 1
breakpoint already hit 1 time
(gdb) info thread
(gdb) clean main
Undefined command: "clean".  Try "help".
(gdb) clear main
已删除的多个断点 1 2 3 
(gdb) b main
Breakpoint 10 at 0x8048ff7: file dalvik/dexopt/OptMain.c, line 573.
(gdb) clear main
已删除的断点 10 
(gdb) help load
Dynamically load FILE into the running program, and record its symbols
for access from GDB.
A load OFFSET may also be given.
(gdb) clear main
No breakpoint at main.
(gdb) load out/debug/host/linux-x86/pr/sim/symbols/system/bin/dalvikvm
You can't do that when your target is `exec'
(gdb) help
List of classes of commands:


aliases -- Aliases of other commands
breakpoints -- Making program stop at certain points
data -- Examining data
files -- Specifying and examining files
internals -- Maintenance commands
obscure -- Obscure features
running -- Running the program
stack -- Examining the stack
status -- Status inquiries
support -- Support facilities
tracepoints -- Tracing of program execution without stopping the program
user-defined -- User-defined commands


Type "help" followed by a class name for a list of commands in that class.
Type "help all" for the list of all commands.
Type "help" followed by command name for full documentation.
Type "apropos word" to search for commands related to "word".
Command name abbreviations are allowed if unambiguous.
(gdb) help runn
Running the program.


List of commands:


advance -- Continue the program up to the given location (same form as args for break command)
attach -- Attach to a process or file outside of GDB
continue -- Continue program being debugged
detach -- Detach a process or file previously attached
detach checkpoint -- Detach from a checkpoint (experimental)
detach inferior -- Detach from inferior ID
disconnect -- Disconnect from a target
finish -- Execute until selected stack frame returns
handle -- Specify how to handle a signal
inferior -- Use this command to switch between inferiors
interrupt -- Interrupt the execution of the debugged program
jump -- Continue program being debugged at specified line or address
kill -- Kill execution of program being debugged
kill inferior -- Kill inferior ID
next -- Step program
nexti -- Step one instruction
reverse-continue -- Continue program being debugged but run it in reverse
reverse-finish -- Execute backward until just before selected stack frame is called
reverse-next -- Step program backward
reverse-nexti -- Step backward one instruction
reverse-step -- Step program backward until it reaches the beginning of another source line
reverse-stepi -- Step backward exactly one instruction
run -- Start debugged program
signal -- Continue program giving it signal specified by the argument
---Type <return> to continue, or q <return> to quit---
start -- Run the debugged program until the beginning of the main procedure
step -- Step program until it reaches a different source line
stepi -- Step one instruction exactly
target -- Connect to a target machine or process
target child -- Unix child process (started by the "run" command)
target core -- Use a core file as a target
target exec -- Use an executable file as a target
target extended-remote -- Use a remote computer via a serial line
target multi-thread -- Threads and pthreads support
target record -- Log program while executing and replay execution from log
target record-core -- Log program while executing and replay execution from log
target remote -- Use a remote computer via a serial line
target tfile -- Use a trace file as a target
task -- Use this command to switch between Ada tasks
thread -- Use this command to switch between threads
thread apply -- Apply a command to a list of threads
thread apply all -- Apply a command to all threads
until -- Execute until the program reaches a source line greater than the current


Type "help" followed by command name for full documentation.
Type "apropos word" to search for commands related to "word".
Command name abbreviations are allowed if unambiguous.
(gdb) help run
Start debugged program.  You may specify arguments to give it.
Args may include "*", or "[...]"; they are expanded using "sh".
Input and output redirection with ">", "<", or ">>" are also allowed.


With no arguments, uses arguments last specified (with "run" or "set args").
To cancel previous arguments and run with no arguments,
use "set args" without arguments.
(gdb) help
List of classes of commands:


aliases -- Aliases of other commands
breakpoints -- Making program stop at certain points
data -- Examining data
files -- Specifying and examining files
internals -- Maintenance commands
obscure -- Obscure features
running -- Running the program
stack -- Examining the stack
status -- Status inquiries
support -- Support facilities
tracepoints -- Tracing of program execution without stopping the program
user-defined -- User-defined commands


Type "help" followed by a class name for a list of commands in that class.
Type "help all" for the list of all commands.
Type "help" followed by command name for full documentation.
Type "apropos word" to search for commands related to "word".
Command name abbreviations are allowed if unambiguous.
(gdb) help runn
Running the program.


List of commands:


advance -- Continue the program up to the given location (same form as args for break command)
attach -- Attach to a process or file outside of GDB
continue -- Continue program being debugged
detach -- Detach a process or file previously attached
detach checkpoint -- Detach from a checkpoint (experimental)
detach inferior -- Detach from inferior ID
disconnect -- Disconnect from a target
finish -- Execute until selected stack frame returns
handle -- Specify how to handle a signal
inferior -- Use this command to switch between inferiors
interrupt -- Interrupt the execution of the debugged program
jump -- Continue program being debugged at specified line or address
kill -- Kill execution of program being debugged
kill inferior -- Kill inferior ID
next -- Step program
nexti -- Step one instruction
reverse-continue -- Continue program being debugged but run it in reverse
reverse-finish -- Execute backward until just before selected stack frame is called
reverse-next -- Step program backward
reverse-nexti -- Step backward one instruction
reverse-step -- Step program backward until it reaches the beginning of another source line
reverse-stepi -- Step backward exactly one instruction
run -- Start debugged program
signal -- Continue program giving it signal specified by the argument
---Type <return> to continue, or q <return> to quit---
start -- Run the debugged program until the beginning of the main procedure
step -- Step program until it reaches a different source line
stepi -- Step one instruction exactly
target -- Connect to a target machine or process
target child -- Unix child process (started by the "run" command)
target core -- Use a core file as a target
target exec -- Use an executable file as a target
target extended-remote -- Use a remote computer via a serial line
target multi-thread -- Threads and pthreads support
target record -- Log program while executing and replay execution from log
target record-core -- Log program while executing and replay execution from log
target remote -- Use a remote computer via a serial line
target tfile -- Use a trace file as a target
task -- Use this command to switch between Ada tasks
thread -- Use this command to switch between threads
thread apply -- Apply a command to a list of threads
thread apply all -- Apply a command to all threads
until -- Execute until the program reaches a source line greater than the current


Type "help" followed by command name for full documentation.
Type "apropos word" to search for commands related to "word".
Command name abbreviations are allowed if unambiguous.
(gdb) quit
root@ubuntu:/media/linux/1/android-20120605-2.3.4_r1# gdb out/debug/host/linux-x86/pr/sim/symbols/system/bin/dalvikvm
GNU gdb (GDB) 7.2-ubuntu
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
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 "i686-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /media/linux/1/android-20120605-2.3.4_r1/out/debug/host/linux-x86/pr/sim/symbols/system/bin/dalvikvm...done.
(gdb) 


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值