vscode / gdb debug C binary on Mac fails

1

I am failing to debug a C binary files on my Mac. However, I am able to debug on my Ubuntu computer with this launch.json. I appreciate any help or hint.

My vscode launch.json configuration:

  {
    "version": "0.2.0",
    "configurations": [
      {
        "name": "aps2scala",
        "type": "cppdbg",
        "request": "launch",
        "program": "${workspaceFolder}/bin/aps2scala",
        "args": [
          "-p",
          "..:base",
          "-G",
          "../examples/test"
        ],
        "logging": { "engineLogging": true },
        "stopAtEntry": false,
        "cwd": "${workspaceFolder}",
        "environment": [],
        "externalConsole": false,
        "MIMode": "gdb",
        "setupCommands": [
          {
            "description": "Enable pretty-printing for gdb",
            "text": "-enable-pretty-printing",
            "ignoreFailures": true
          }
        ]
      }
   }

Vscode logs:

1: (178) LaunchOptions<LocalLaunchOptions xmlns='http://schemas.microsoft.com/vstudio/MDDDebuggerOptions/2014'
1: (194) LaunchOptions  ExePath='/Users/HES8493/workspace/aps/bin/aps2scala'
1: (194) LaunchOptions  WorkingDirectory='/Users/HES8493/workspace/aps'
1: (194) LaunchOptions  ExeArguments='-p ..:base -G ../examples/test'
1: (194) LaunchOptions  MIMode='gdb'
1: (195) LaunchOptions  MIDebuggerPath=''
1: (195) LaunchOptions  WaitDynamicLibLoad='false'
1: (195) LaunchOptions>
1: (195) LaunchOptions    <SetupCommands>
1: (195) LaunchOptions        <Command IgnoreFailures='true' Description='Enable pretty-printing for gdb'>-enable-pretty-printing</Command>
1: (195) LaunchOptions    </SetupCommands>
1: (195) LaunchOptions</LocalLaunchOptions>
1: (361) codeSign-stderr: /usr/local/bin/gdb: code object is not signed at all
1: (365) Send Event AD7MessageEvent
1: (369) Starting: "/usr/local/bin/gdb" --interpreter=mi
1: (388) DebuggerPid=24130
1: (565) ->=thread-group-added,id="i1"
1: (565) ->~"GNU gdb (GDB) 9.1\n"
1: (566) ->~"Copyright (C) 2020 Free Software Foundation, Inc.\n"
1: (566) ->~"License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law."
1: (566) ->~"\nType \"show copying\" and \"show warranty\" for details.\n"
1: (567) ->~"This GDB was configured as \"x86_64-apple-darwin18.7.0\".\n"
1: (567) ->~"Type \"show configuration\" for configuration details.\n"
1: (567) ->~"For bug reporting instructions, please see:\n"
1: (567) ->~"<http://www.gnu.org/software/gdb/bugs/>.\n"
1: (567) ->~"Find the GDB manual and other documentation resources online at:\n    <http://www.gnu.org/software/gdb/documentation/>."
1: (567) ->~"\n\n"
1: (567) ->~"For help, type \"help\".\n"
1: (567) ->~"Type \"apropos word\" to search for commands related to \"word\".\n"
1: (567) ->(gdb)
1: (572) <-1001-gdb-set target-async on
1: (573) ->1001^done
1: (573) ->(gdb)
1: (576) 1001: elapsed time 4
1: (585) <-1002-enable-pretty-printing
1: (585) ->1002^done
1: (585) ->(gdb)
1: (585) 1002: elapsed time 0
1: (585) <-1003-interpreter-exec console "set pagination off"
1: (585) ->=cmd-param-changed,param="pagination",value="off"
1: (586) ->1003^done
1: (586) ->(gdb)
1: (586) 1003: elapsed time 0
1: (586) <-1004-gdb-set auto-solib-add on
1: (586) ->1004^done
1: (586) ->(gdb)
1: (586) 1004: elapsed time 0
1: (586) <-1005-gdb-set solib-search-path /Users/HES8493/workspace/aps/bin:
1: (587) ->1005^done
1: (587) ->(gdb)
1: (587) 1005: elapsed time 0
1: (587) <-1006-environment-cd /Users/HES8493/workspace/aps
1: (588) ->1006^done
1: (588) ->(gdb)
1: (588) 1006: elapsed time 0
1: (588) <-1007-file-exec-and-symbols /Users/HES8493/workspace/aps/bin/aps2scala
1: (695) ->~"../../gdb/inferior.c:283: internal-error: struct inferior *find_inferior_pid(int): Assertion `pid != 0' failed.\nA problem internal to GDB has been detected,\nfurther debugging may prove unreliable."
1: (695) ->~"\nQuit this debugging session? "
1: (695) ->~"(y or n) [answered Y; input not from terminal]\n"
1: (695) ->&"\nThis is a bug, please report it."
1: (695) ->&"  For instructions, see:\n"
1: (696) ->&"<http://www.gnu.org/software/gdb/bugs/>.\n\n"
1: (696) ->~"../../gdb/inferior.c:283: internal-error: struct inferior *find_inferior_pid(int): Assertion `pid != 0' failed.\nA problem internal to GDB has been detected,\nfurther debugging may prove unreliable."
1: (696) ->~"\nCreate a core file of GDB? "
1: (696) ->~"(y or n) [answered Y; input not from terminal]\n"
1: (16705) "/usr/local/bin/gdb" exited with code 134 (0x86).
1: (16712) <-logout
1: (16728) Send Event AD7MessageEvent
1: (16731) Send Event AD7ProgramDestroyEvent
ERROR: Unable to start debugging. GDB exited unexpectedly with exit code 134 (0x86).
The program '/Users/HES8493/workspace/aps/bin/aps2scala' has exited with code 42 (0x0000002a).
c
visual-studio-code
gdb
macos-mojave
asked on Stack Overflow Feb 27, 2020 by Node.JS

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0