Bug 473687 - Implement qDefaultExecAndArgs and qMachineId for vgdb
Summary: Implement qDefaultExecAndArgs and qMachineId for vgdb
Status: REPORTED
Alias: None
Product: valgrind
Classification: Developer tools
Component: general (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Julian Seward
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-08-23 14:29 UTC by Mark Wielaard
Modified: 2023-08-23 14:29 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Wielaard 2023-08-23 14:29:34 UTC
qDefaultExecAndArgs and qMachineId are proposed new gdb remote packets described in this gdb patch series:
https://inbox.sourceware.org/gdb-patches/cover.1692200989.git.aburgess@redhat.com/

The implementation of qDefaultExecAndArgs is trivial (since we don't have any, we just return "U"):

diff --git a/coregrind/vgdb.c b/coregrind/vgdb.c
index c024ffca6..59c9bb4b4 100644
--- a/coregrind/vgdb.c
+++ b/coregrind/vgdb.c
@@ -1354,6 +1354,7 @@ void do_multi_mode(int check_trials, int in_port)
 #define QENVIRONMENTUNSET "QEnvironmentUnset"
 #define QSETWORKINGDIR "QSetWorkingDir"
 #define QTSTATUS "qTStatus"
+#define QDEFAULTEXECANDARGS "qDefaultExecAndArgs"
        
        if (strncmp(QSUPPORTED, buf, strlen(QSUPPORTED)) == 0) {
           DEBUG(1, "CASE %s\n", QSUPPORTED);
@@ -1600,6 +1601,10 @@ void do_multi_mode(int check_trials, int in_port)
           DEBUG(1, "Got qfThreadInfo\n");
           /* There are no threads yet, reply 'l' end of list. */
           send_packet ("l", noackmode);
+       } else if (strcmp(QDEFAULTEXECANDARGS, buf) == 0) {
+          DEBUG(1, "Got qDefaultExecAndArgs\n");
+          /* We don't have any.  */
+          send_packet ("U", noackmode);
        } else if (buf[0] != '\0') {
           // We didn't understand.
           DEBUG(1, "Unknown packet received: '%s'\n", buf);

This immediately makes run/start work without having to set remote exec-file.

qMachineId is a bit more complicated, but would automatically set sysroot to /