How to copy listen between two streams

How do iI read the content of "gpsPort" (Software Serial(9600)) for debugging, and still be able to provide everything to gnss.

My code:

#include <NMEAGPS.h>
#include <GPSport.h>
static NMEAGPS gnss;
static void handleGNSSdata( const gps_fix & fix );

loop() {
while (gnss.available( gpsPort ))
handleGNSSdata( gnss.read() );
}

psaudo code:
stream gpsPortCopy;
loop{
while(gpsPort.ready()){
stuff = gpsPort.read()
Serial.print(stuff);
gpsPortCopy.write(stuff )
handleGNSSdata( gpsPortCopy.read() );
}
}

This is basic c stuff, i know. But all answers I was able to pull out of Google was for c++ stl.

I want to be able to insert a line: Serial.print("stuff from GPS:" ); Serial.print(stuff);

class DebugPrint : public Print {
public:

  Print* stream;
  bool nl = true;

  virtual size_t write(uint8_t b) {
    if (nl) {
      Serial.print("stuff from GPS ");
      nl = false;
    }
    if (b == '\n') {
      nl = true;
    }
    Serial.write(b);
    return stream->write(b);
  }
}