yetist / ios-toolchain-based-on-clang-for-linux

Automatically exported from code.google.com/p/ios-toolchain-based-on-clang-for-linux
0 stars 0 forks source link

arm-apple-darwin11-gdb can't list source more than once #2

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
(gdb) list
1       #import <Foundation/Foundation.h>
2
3       int main(int argc, char **argv)
4       {
5         @autoreleasepool {
6           NSLog(@"Hello World");
7         }
8       }
(gdb) list
Line number 9 out of range; main.m has 8 lines.
(gdb) list
Line number 9 out of range; main.m has 8 lines.

 I'm going to spend some time check this again apple gdb source code.

Original issue reported on code.google.com by titan....@gmail.com on 18 Dec 2012 at 6:38

GoogleCodeExporter commented 9 years ago
Take it back. 
 Give a new line number seems work. The problem is that shared symbol/binary between device and host are not in sync. Host darwin-gdb looks for file path that only exists in IOS.
============log
0x2fef6028 in ?? ()
warning: Unable to read symbols for /private/var/....../bin/hello-c (file not 
found).
warning: No copy of <No file name> found locally, reading from memory on remote 
device.  This may slow down the debug session.
(gdb) list
Line number 9 out of range; main.m has 8 lines.
(gdb) list 1
1       #import <Foundation/Foundation.h>
2
3       int main(int argc, char **argv)
4       {
5         @autoreleasepool {
6           NSLog(@"Hello World");
7         }
8       }

Original comment by titan....@gmail.com on 18 Dec 2012 at 7:01

GoogleCodeExporter commented 9 years ago
To solve this problem we can build code under Linux /var/root/ directory or 
/Applications.

Original comment by titan....@gmail.com on 18 Dec 2012 at 7:09

GoogleCodeExporter commented 9 years ago
It is the default behavior of gdb, by default, it will list 10 line source code 
once, if reach the end of source file, if will show the message like this.

you can use line number to list the source code again.

Original comment by cjac...@gmail.com on 18 Dec 2012 at 6:25