≡

wincent.dev

  • Products
  • Blog
  • Wiki
  • Issues
You are viewing an historical archive of past issues. Please report new issues to the appropriate project issue tracker on GitHub.
Home » Issues » Bug #1273

Bug #1273: atosym doesn't handle dSYM packages

Kind bug
Product atosym
When Created 2009-04-13T13:48:10Z, updated 2009-04-27T05:14:11Z
Status closed
Reporter anonymous
Tags no tags

Description

It's not real obvious that atosym literally expects a dSYM file, whereas Xcode creates a dSYM package. If you try to pass the path to the package to atosym, atosym gives a confusing "no such file or directory" error.

Comments

  1. Greg Hurrell 2009-04-13T14:01:05Z

    Status changed:

    • From: New
    • To: Open
  2. Greg Hurrell 2009-04-13T14:01:26Z

    Thanks for the report. I'll see if I can do something about that unhelpful error message.

  3. Greg Hurrell 2009-04-13T14:10:21Z

    I've got a patch from Nicholas Riley here locally that I haven't made public yet which might be of use.

    I couldn't get Leopard's atos to work with dSYM files despite Apple's Web site claiming otherwise, so here's a patch to atosym that helps with decoding crash logs. It pulls the dSYM file out of a dSYM bundle as Apple uses in their kernel debug kits and subtracts rather than adds the offset (as atos does; I'm guessing that feature wasn't tested :-)

    And the patch itself:

    Index: atosym.m
    ===================================================================
    --- atosym.m	(revision 8)
    +++ atosym.m	(working copy)
    @@ -79,7 +79,7 @@
     
     NSString *get_symbol_information (unsigned address)
     {
    -    const char *command = [[NSString stringWithFormat:@"info line *%#x", address + offset] UTF8String];
    +    const char *command = [[NSString stringWithFormat:@"info line *%#x", address - offset] UTF8String];
         char *template[MAXPATHLEN];
         strcpy((char *)template, "/tmp/atosym.XXXXXX");
         int temp = mkstemp((char *)template);
    @@ -170,11 +170,21 @@
             show_usage();
             goto Cleanup;
         }
    -    if (![manager fileExistsAtPath:file])
    +    BOOL isDirectory;
    +    if (![manager fileExistsAtPath:file isDirectory:&isDirectory])
         {
             fprintf(stderr, "error: file \"%s\" does not exist\n", [file fileSystemRepresentation]);
             goto Cleanup;
         }
    +    if (isDirectory) {
    +	NSArray *dSYMs = [[NSBundle bundleWithPath:file] pathsForResourcesOfType:nil inDirectory:@"DWARF"];
    +	if ([dSYMs count] != 1)
    +	{
    +	    fprintf(stderr, "error: found %d dSYM files (expected 1) in \"%s\"\n", [dSYMs count], [file fileSystemRepresentation]);
    +	    goto Cleanup;
    +	}
    +	file = [dSYMs objectAtIndex: 0];
    +    }
         dsym = [file retain]; // leak until exit
         
         NSString *architecture = [[defaults stringForKey:@"architecture"] lowercaseString];

    Before I apply this I'm going to migrate the old Subversion repository over to Git.

  4. Greg Hurrell 2009-04-13T17:49:42Z

    Ok, I've split Nicholas's patch into two commits and pushed it out.

  5. Greg Hurrell 2009-04-13T17:49:59Z

    Status changed:

    • From: Open
    • To: Closed
  6. Greg Hurrell 2009-04-27T05:13:49Z

    Product changed:

    • From: atosym
    • To: buildtools
  7. Greg Hurrell 2009-04-27T05:14:04Z

    Whoops, accidentally changed the product without meaning to.

  8. Greg Hurrell 2009-04-27T05:14:11Z

    Product changed:

    • From: buildtools
    • To: atosym
Add a comment

Comments are now closed for this issue.

  • contact
  • legal

Menu

  • Blog
  • Wiki
  • Issues
  • Snippets