Question

I am working on graphical GDB frontend and I am curious if there is a way to obtain full executable name from a remote target assuming I don't have executable loaded in my local debugger.

I'm fine with using either CLI or MI.

Était-ce utile?

La solution

You can get the PID through "info inferiors" and get ps(1) like output through "info os processes". You'll then have to search the whole process list to find the matching PID and get its command line:

(gdb) info inferiors 
  Num  Description       Executable        
* 1    process 14382
(gdb) info os processes
pid        user       command    cores      
1          root       /usr/lib/systemd/systemd --system --deserialize 22 1
2          root       [kthreadd] 3          
......

I checked the GDB source code, the relevant functions for "info os process" are info_osdata_command() and get_osdata(). There's no builtin way to filter on a PID.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top