I have some shader code/routines that define several GLSL functions as strings and compiles them as smaller individual shader objects. Then before each pass I create a main program and attach (using glAttachObject) the necessary smaller objects (depending on my current pass and needs) to the main program. Once everything is attached I perform a link and call glUseProgramObject() on the main program.

The shaders work, as I see a correct scene drawn.

However, when I call glGetShaderSource() after I call glUseProgramObject() it returns nothing? Is it because I never called glShaderSource()? I want to be able to spit out my current shader (which changes as my passes change) at a given point but I can't seem to get GL to return the shader via glGetShaderSource?

glGetError() does report an error but simple returns INVALID_OPERATION.