Gdb Error In Sourced Command File
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up gdb stops in a command file if there is an error. How to continue despite the error? up vote 7 down vote favorite 2 I my real gdb script while analyzing a core file I try to dereference a pointer and get "Error in sourced command file: Cannot access memory at address " and then my gdb script stops. What I want is just to go on executing my gdb script without stopping. Is it possible? This is a test program and a test gdb script that demonstrates my problem. In this situation the pointer has NULL value but in a real situation the pointer will like have not null invalid value. This is test C program: #include struct my_struct { int v1; int v2; }; int main() { my_struct *p; printf("%d %d\n", p->v1, p->v2); return 0; } This is a test gdb script: >cat analyze.gdb p p->v1 q And this is demonstration of the problem (what I want from gdb here is to get this error message and then go process quit command): >gdb -silent a.out ./core.22384 -x ./analyze.gdb Reading symbols from /a.out...done. [New Thread 22384] Core was generated by `./a.out'. Program terminated with signal 11, Segmentation fault. #0 0x0000000000400598 in main () at main.cpp:11 11 printf("%d %d\n", p->v1, p->v2); ./analyze.gdb:1: Error in sourced command file: Cannot access memory at address 0x0 Missing separate debuginfos, use: debuginfo-install glibc-2.12-1.80.el6.x86_64 Update Thanks to Tom. This is a gdb script that handles this problem: >cat ./analyze.v2.gdb python def my_ignore_errors(arg): try: gdb.execute("print \"" + "Executing command: " + arg + "\"") gdb.execute (arg) except: gdb.execute("print \"" + "ERROR: " + arg + "\"") pass my_ignore_errors("p p") my_ignore_errors("p p->
text] Re: Error in sourced command file .. From: Keith Seitz To: çç å Cc: "insight at sources dot redhat dot com" Date: 05 Jul 2003 11:55:11 -0700 Subject: Re: Error in sourced http://stackoverflow.com/questions/17923865/gdb-stops-in-a-command-file-if-there-is-an-error-how-to-continue-despite-the-er command file .. Organization: References: On Sat, 2003-07-05 at 08:27, ççå wrote: > When open source file ... > it show message " Error in sourced command file Undefined command." > How to solve the problem ? It https://sourceware.org/ml/insight/2003-q3/msg00015.html sounds like you are using the File->Source... option. This does not do what you apparently think it does. This item sources a gdb command script. If you want to jump to another source file for viewing, there are several ways to do that: 1. Select your file from the comobox near the top of the source window 2. Type in the name of the file you want to view in the combobox 3. Type the name of the function you want to view in the function combobox 4. Use the function browser window to view it Keith References: Error in sourced command file .. From: =?big5?b?w7ml37C3?= Index Nav: [DateIndex] [SubjectIndex] [AuthorIndex] [ThreadIndex] Message Nav: [DatePrev][DateNext] [ThreadPrev][ThreadNext]
från GoogleLogga inDolda fältSök efter grupper eller meddelanden
KB/s (56611683 bytes in 63.209s) OOPS, device appears to not support `adb shell run-as ...` OOPS cannot just_attach because process not found 83 KB/s (9488 bytes in 0.111s) creating temp file for environment /tmp/tmphRWF9K 11 KB/s (121 bytes in 0.009s) am start -e EARLY_LIFECYCLE_DEBUG 1 -e WAIT_FOR_ATTACH 1 -e DEBUGGER_PATH /data/data/org.cocos2d.Delivery/lib/gdbserver -e DEBUGGER_PORT 5039 -n org.cocos2d.Delivery/org.cocos2d.Delivery.DeliveryActivity Starting: Intent { cmp=org.cocos2d.Delivery/.DeliveryActivity (has extras) } GNU gdb (GDB) 7.5-https://github.com/apportable/gdb Feb 20 2014 18:49:38 Copyright (C) 2012 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=x86_64-apple-darwin12.4.0 --target=arm-elf-linux". For bug reporting instructions, please see: . /var/folders/1w/q86x7hrx7tbflnx_rxd1hk5w0000gn/C/com.apple.DeveloperTools/6.1.1-6A2008a/Xcode/gdb_cache/android-armv7a-neon-debug/Delivery Android/gdb/gdb.setup:6: Error in sourced command file: Remote connection closed This is logcat report 01-23 21:17:58.399 18745-18745/org.cocos2d.Delivery E/AndroidRuntime? FATAL EXCEPTION: main Process: org.cocos2d.Delivery, PID: 18745 java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{org.cocos2d.Delivery/org.cocos2d.Delivery.DeliveryActivity}: java.lang.ClassNotFoundException: Didn't find class "org.cocos2d.Delivery.DeliveryActivity" on path: DexPathList[[zip file "/data/app/org.cocos2d.Delivery-9.apk"],nativeLibraryDirectories=[/data/app-lib/org.cocos2d.Delivery-9, /vendor/lib, /system/lib]] at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2298) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2453) at android.app.ActivityThread.access$900(Activi