microsoft / microsoft/vscode-cpptools

Loading shared library to debug with executable

Aperta
#2,530 4 commenti 0 reazioni 1 assegnatario Vedi su GitHub

@pieandcakes ci sta già lavorando.

Dal 21/9/2018.

debugger
Lingua principale
TypeScript
Stelle
6.2k
Fork
1.7k
Merge medio
14h 46m
PR unite (30g)
61

Descrizione

What i am doing basically is building shared library and linking it to my executable. Project build and runs just fine. But when it come to debugging i can't do it (---If i debugging executable alone, there not problems, i can debug and everything works). Problem appears when i am launching debbuger. This is output with logging:

=thread-group-added,id="i1"
GNU gdb (Ubuntu 7.11.1-0ubuntu116.5) 7.11.1
Copyright (C) 2016 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 "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
http://www.gnu.org/software/gdb/bugs/.
Find the GDB manual and other documentation resources online at:
http://www.gnu.org/software/gdb/documentation/.
For help, type "help".
Type "apropos word" to search for commands related to "word".
Warning: Debuggee TargetArchitecture not detected, assuming x86_64.
=cmd-param-changed,param="pagination",value="off"
1: (930) <-1012-exec-run
1: (934) ->=thread-group-started,id="i1",pid="12605"
1: (934) ->=thread-created,id="1",group-id="i1"
1: (940) ->=library-loaded,id="/lib64/ld-linux-x86-64.so.2",target-name="/lib64/ld-linux-x86-64.so.2",host-name="/lib64/ld-linux-x86-64.so.2",symbols-loaded="0",thread-group="i1"
1: (949) ->1012^running
1: (949) ->*running,thread-id="all"
1: (951) ->(gdb)
1: (953) ->
"Stopped due to shared library event (no libraries added or removed)\n"
1: (954) ->*stopped,reason="solib-event",thread-id="1",stopped-threads="all",core="1"
1: (1007) <-1013-thread-info 1
1: (1010) ->1013^done,threads=[{id="1",target-id="process 12605",name="TestYolo4Video",frame={level="0",addr="0x00007ffff7dda96a",func="dl_main",args=[{name="phdr",value=""},{name="phnum",value=""},{name="user_entry",value=""},{name="auxv",value=""}],file="rtld.c",fullname="/build/glibc-Cl5G7W/glibc-2.23/elf/rtld.c",line="1513"},state="stopped",core="1"}]
1: (1010) ->(gdb)
1: (1041) 1012: elapsed time 110
Stopped due to shared library event (no libraries added or removed)
1: (1122) 1013: elapsed time 114
1: (1124) <-1014-interpreter-exec console "shell echo -e \\033c 1>&2"
1: (1126) ->1014^done
1: (1126) ->(gdb)
1: (1186) 1014: elapsed time 61
1: (1187) <-1015-gdb-set stop-on-solib-events 0
1: (1188) ->1015^done
1: (1188) ->(gdb)
1: (1190) 1015: elapsed time 3
1: (1250) <-1016-interpreter-exec console "info sharedlibrary"
1: (1251) ->"From To Syms Read Shared Object Library\n"
1: (1251) ->
"0x00007ffff7dd7ac0 0x00007ffff7df5850 Yes /lib64/ld-linux-x86-64.so.2\n"
1: (1252) ->1016^done
1: (1252) ->(gdb)
1: (1267) 1016: elapsed time 16
Loaded '/lib64/ld-linux-x86-64.so.2'. Symbols loaded.
1: (1304) <--exec-continue
1: (1305) ->^running
1: (1305) ->*running,thread-id="all"
1: (1306) ->(gdb)
1: (1306) ->~"[Inferior 1 (process 12605) exited with code 0177]\n"
1: (1306) ->=thread-exited,id="1",group-id="i1"
1: (1306) ->=thread-group-exited,id="i1",exit-code="0177"
1: (1306) ->*stopped,reason="exited",exit-code="0177"
[Inferior 1 (process 12605) exited with code 0177]
1: (1351) <--gdb-exit
1: (1352) ->^exit
The program '/home/rytis/Desktop/DeepLearningSampleRemake/build/TestYolo4Video/TestYolo4Video' has exited with code 177 (0x000000b1).

My launch.json file:
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "(gdb) Launch",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/build/TestYolo4Video/TestYolo4Video",
"additionalSOLibSearchPath": "${workspaceFolder}/build/YoloDetector/",
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": true,
"MIMode": "gdb",
"logging": { "engineLogging": true },
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
}
]
}

Should i include my library (*.so) file to 'launch.json'? or am i doing something not correctly?
(Generated with -g flag)

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.